Back Forum Reply New

Eclipse Roo project templates

I've installed the STS 2.1.0 m1 but can't fintd the Roo project templates when creating a project...

I've also tries 2.0.2 with the Roo dropin jars but also in this configuration I don't see any Roo project templates.

Any idea?

In STS 2.1.0.M1, just use New gt; Project gt; SpringSource Tool Suite gt; Template Project.

You'll then ask asked which template to use. Leave the default as quot;Roo Simplequot; and click quot;Nextquot;. You'll then be asked for the project name, and top-level package. A project name might be quot;helloquot; and the top-level package quot;com..helloquot;. Finally click quot;Finishquot;.

If you receive any messages about enabling AJDT weaving service, answer quot;yesquot; and then allow it to restart the workbench. This will only happen once.

I did notice an issue on my (Linux) machine regarding the template. Specifically, you need to go into Project Properties then Java Build Path, Libraries, and quot;editquot; the Apple JVM option and change it to your workspace default JRE. This has been reported against the STS project under browse/STS-95.

You can open the Roo shell within STS for your project by right clicking the project and then selecting Spring Tools gt; Open Roo Shell. You can then enter commands by typing them into the Roo Shell area, or by opening any editor and then hitting CTRL + R at the same time (APPLE + R on an Apple). Your first commands will probably be something like:Code:
install jpa -database HYPERSONIC_IN_MEMORY -provider HIBERNATE
new persistent class jpa -name ~.Hello -testAutomatically
add field string -fieldName helloWorld -notNull
run all tests
new controller automatic -name ~.web.HelloController
deploy -server quot;SpringSource dm Server v1.0quot;
Next you can visit your application in a browser using something like hello, assuming you called your project quot;helloquot; in the initial wizard.

You can also use quot;hintquot; whenever you like for guidance. You don't need to remember all those commands! :-)

I think it's pretty cool you can build an entire best-practice application like this, run actual tests, and deploy it all without leaving the comfort of STS. You can even make it a deployable WAR for official production deployment by right-clicking the project, then Run as gt; Maven Package.

Ben,

I had a slightly different experience. I could access the template via quot;New gt; Other ... gt; SpringSource Tool Suite gt; Template Projectquot; but the SpringSource Tool Suite was not listed under quot;New gt; Projectquot;.

Also, if I named the project something like quot;com.springdeveloper.rootestquot; the project was created but not added to my workspace - i had to import it. Is there a way to controll the root context for the web app so it would be deployed as quot;rootestquot; instead of using the full project name?

The roo version in the created pom vas 1.0.0.A1-SNAPSHOT which I did not have in my maven repo - so changing that to 1.0.0.A2 worked since that's the version that the Roo readme.txt file specified to use when adding the jar to local Maven repo.

Am I running a slightly outdated roo plugin? I'm using what came with STS 2.1.0.M1.

From both Java and Java EE perspective I don't see SpringSource Tool Suite when starting the project wizard from File gt; New gt; Project...

However when using ctrl + n then the SpringSource Tool Suite branch is available, and I can choose the Roo Template.

Am I just doing something wrong or is this a bug?Originally Posted by Ben AlexIn STS 2.1.0.M1, just use New gt; Project gt; SpringSource Tool Suite gt; Template Project.

You'll then ask asked which template to use. Leave the default as quot;Roo Simplequot; and click quot;Nextquot;. You'll then be asked for the project name, and top-level package. A project name might be quot;helloquot; and the top-level package quot;com..helloquot;. Finally click quot;Finishquot;.
From both Java and Java EE perspective I don't see SpringSource Tool Suite when starting the project wizard from File gt; New gt; Project...

Try File gt; New gt; Other... and SpringSource Tool Suite should be listed there - same as the ctrl-N shortcut

Thomas,

thanks for raising the issue here. I fixed the project template to not include a Mac-specific JVM and use the latest M2 roo-annotations in the pom.xml.

Also the project wizards (New Spring Project and New Template Project) are now available from File -gt; New -gt; Project...

With upcoming 2.1.0.M2 you will also not able to enter a project name with a '.' as this is going to confuse the template: the project name is used throughout the Spring XML configs, e.g. servletName and ucl mappings. '.' don't make a lot of sense there.

HTH

Christian

when will eclipse update milestone/e3.4 has the M2 version available ...

when trying to execute

new persistent class jpa -name ~.Hello -testAutomatically i get errorCode:
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(Unknown Source)
at com..sts.server.quickfix.jdt.JdtMarkerResolutionGenerator.getResolutions(JdtMarkerResolutionGenerator.java:38)
at org.eclipse.ui.internal.ide.registry.MarkerHelpRegistry.hasResolution(MarkerHelpRegistry.java:192)
at org.eclipse.ui.internal.ide.registry.MarkerHelpRegistry.hasResolutions(MarkerHelpRegistry.java:156)
at org.eclipse.ui.views.markers.MarkerField.annotateImage(MarkerField.java:72)
at org.eclipse.ui.internal.views.markers.MarkerProblemSeverityAndMessageField.update(MarkerProblemSeverityAndMessageField.java:86)
at org.eclipse.ui.internal.views.markers.MarkerColumnLabelProvider.update(MarkerColumnLabelProvider.java:62)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:145)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:932)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1012)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:466)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2041)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:827)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:802)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:776)
at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:634)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1702)
at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1054)
at org.eclipse.ui.internal.views.markers.MarkersTreeViewer.expandToLevel(MarkersTreeViewer.java:74)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.reexpandCategories(ExtendedMarkersView.java:1509)
at org.eclipse.ui.internal.views.markers.ExtendedMarkersView$12.runInUIThread(ExtendedMarkersView.java:1302)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

eclipse.buildId=M20090211-1700
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86The Roo command you have used looks fine to me.

The exception stack trace is showing an issue within the STS/Eclipse IDE. Can you reproduce this, or was it a one-off? If you cannot reproduce, it could be that the file was still being written out by Roo at the same time as STS/Eclipse started to parse it (ie before the content was fully formed).

If you'd like to log a bug report against STS at browse/STS we would be happy to look into it some more.

seem to be ok today after i re-generate

just one point want to hight-light.

the file applicationContext.xml generate some #13; making the file showing some error. after delete all the #13; . it's ok. by the way, i working on windows machine
¥
Back Forum Reply New