Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Eclipse Roo project templates

  1. #1
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    230

    Default 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?

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

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

    You'll then ask asked which template to use. Leave the default as "Roo Simple" and click "Next". You'll then be asked for the project name, and top-level package. A project name might be "hello" and the top-level package "com.springsource.hello". Finally click "Finish".

    If you receive any messages about enabling AJDT weaving service, answer "yes" 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 "edit" the Apple JVM option and change it to your workspace default JRE. This has been reported against the STS project under https://issuetracker.springsource.com/browse/STS-95.

    You can open the Roo shell within STS for your project by right clicking the project and then selecting Spring Tools > 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 "SpringSource dm Server v1.0"
    Next you can visit your application in a browser using something like http://localhost:8080/hello, assuming you called your project "hello" in the initial wizard.

    You can also use "hint" 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 > Maven Package.
    Last edited by Ben Alex; May 14th, 2009 at 01:56 AM.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    Ben,

    I had a slightly different experience. I could access the template via "New > Other ... > SpringSource Tool Suite > Template Project" but the SpringSource Tool Suite was not listed under "New > Project".

    Also, if I named the project something like "com.springdeveloper.rootest" 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 "rootest" 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.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  4. #4
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    230

    Default

    From both Java and Java EE perspective I don't see SpringSource Tool Suite when starting the project wizard from File > New > 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?

    Quote Originally Posted by Ben Alex View Post
    In STS 2.1.0.M1, just use New > Project > SpringSource Tool Suite > Template Project.

    You'll then ask asked which template to use. Leave the default as "Roo Simple" and click "Next". You'll then be asked for the project name, and top-level package. A project name might be "hello" and the top-level package "com.springsource.hello". Finally click "Finish".

  5. #5
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    From both Java and Java EE perspective I don't see SpringSource Tool Suite when starting the project wizard from File > New > Project...
    Try File > New > Other... and SpringSource Tool Suite should be listed there - same as the ctrl-N shortcut
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  6. #6
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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 -> New -> 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 URL mappings. '.' don't make a lot of sense there.

    HTH

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  7. #7

    Default M2

    when will eclipse update http://www.springsource.org/milestone/e3.4 has the M2 version available ...

  8. #8

    Default error

    when trying to execute

    new persistent class jpa -name ~.Hello -testAutomatically


    i get error

    Code:
    java.lang.StringIndexOutOfBoundsException: String index out of range: -2
    at java.lang.String.substring(Unknown Source)
    at com.springsource.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 x86

  9. #9
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    The 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 https://issuetracker.springsource.com/browse/STS we would be happy to look into it some more.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  10. #10

    Default =)

    seem to be ok today after i re-generate

    just one point want to hight-light.

    the file applicationContext.xml generate some making the file showing some error. after delete all the . it's ok. by the way, i working on windows machine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •