Grails Maven Plugin

Modify eclipse create-app generated launcher to work with grails 1.1

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Activity

Hide
Dale Frye added a comment -

Here's the stack trace when trying to run 1.1 beta 2 app from Eclipse using app created with grails create-app

Error executing script RunApp: GrailsScriptRunner loader is not a Groovy RootLoader instance!
java.lang.RuntimeException: GrailsScriptRunner loader is not a Groovy RootLoader instance!
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at grails.util.GrailsMain.run(GrailsMain.groovy:16)
at grails.util.GrailsMain.main(GrailsMain.groovy)

grails run-app works fine.

Show
Dale Frye added a comment - Here's the stack trace when trying to run 1.1 beta 2 app from Eclipse using app created with grails create-app Error executing script RunApp: GrailsScriptRunner loader is not a Groovy RootLoader instance! java.lang.RuntimeException: GrailsScriptRunner loader is not a Groovy RootLoader instance! at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108) at grails.util.GrailsMain.run(GrailsMain.groovy:16) at grails.util.GrailsMain.main(GrailsMain.groovy) grails run-app works fine.
Hide
Peter Ledbrook added a comment -

Done. Should be available in next Grails SNAPSHOT and 1.1 beta3.

Show
Peter Ledbrook added a comment - Done. Should be available in next Grails SNAPSHOT and 1.1 beta3.
Hide
Peter Ledbrook added a comment -

Actually, I haven't tested it with the debugger, so if that causes problems, re-open the issue.

Show
Peter Ledbrook added a comment - Actually, I haven't tested it with the debugger, so if that causes problems, re-open the issue.
Hide
Peter Ledbrook added a comment -

Bleh - class-loader problems

Show
Peter Ledbrook added a comment - Bleh - class-loader problems
Hide
Peter Ledbrook added a comment -

OK, classloader issue came down to the fact that I was starting Grails 1.1 with GRAILS_HOME pointing at a 1.0.x installation. Not sure how to pass the value of the GRAILS_HOME classpath variable in Eclipse to the launched Grails instance.

Show
Peter Ledbrook added a comment - OK, classloader issue came down to the fact that I was starting Grails 1.1 with GRAILS_HOME pointing at a 1.0.x installation. Not sure how to pass the value of the GRAILS_HOME classpath variable in Eclipse to the launched Grails instance.
Hide
David Buschman added a comment -

It WORKS!!!!

Just downloaded 1.1b3 and generated a test file in

Eclipse Europa
Version: 3.3.0
Build id: I20070621-1340

Since I am stuck in OSGI land, using eclipse is a must

Awesome

Show
David Buschman added a comment - It WORKS!!!! Just downloaded 1.1b3 and generated a test file in Eclipse Europa Version: 3.3.0 Build id: I20070621-1340 Since I am stuck in OSGI land, using eclipse is a must Awesome
Hide
David Buschman added a comment -

I would like to have a small change made to the Eclipse launch configuration template file to make it more Eclipse friendly

The template .launch is configured so that a grails project has to be selected before the launch will work, a simple change will eliminate this headache of a problem. I quickly drove me nuts, such that I had to go fix it immediately. All of my projects have this change so I can keep my sanity.

In the file <grails_base>\src\grails\templates\ide-support\eclipse\.launch

the following line

<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir=${project_loc} -Dserver.port=8080 -Dgrails.env=development"/>

is changed to

<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir=${workspace_loc}/@grails.project.name@ -Dserver.port=8080 -Dgrails.env=development"/>

Now clicking on a launch always works no matter where your current cursor selection is.

Show
David Buschman added a comment - I would like to have a small change made to the Eclipse launch configuration template file to make it more Eclipse friendly The template .launch is configured so that a grails project has to be selected before the launch will work, a simple change will eliminate this headache of a problem. I quickly drove me nuts, such that I had to go fix it immediately. All of my projects have this change so I can keep my sanity. In the file <grails_base>\src\grails\templates\ide-support\eclipse\.launch the following line <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir=${project_loc} -Dserver.port=8080 -Dgrails.env=development"/> is changed to <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir=${workspace_loc}/@grails.project.name@ -Dserver.port=8080 -Dgrails.env=development"/> Now clicking on a launch always works no matter where your current cursor selection is.
Hide
Peter Ledbrook added a comment -

Thanks for the info David. That irritated the hell out of me too, but I didn't realise it was configurable in the .launch file. I'll make that change and close the issue.

Show
Peter Ledbrook added a comment - Thanks for the info David. That irritated the hell out of me too, but I didn't realise it was configurable in the .launch file. I'll make that change and close the issue.
Hide
Peter Ledbrook added a comment -

Unfortunately, that fix broke "out-of-workspace" projects. I have committed another change which should resolve the "selecting project" issue without the side-effect. The launch configuration now uses:

${project_loc:<proj.name>}

where <proj.name> is the hard-coded name of the project.

Fixed in revision 8505.

Show
Peter Ledbrook added a comment - Unfortunately, that fix broke "out-of-workspace" projects. I have committed another change which should resolve the "selecting project" issue without the side-effect. The launch configuration now uses:
${project_loc:<proj.name>}
where <proj.name> is the hard-coded name of the project. Fixed in revision 8505.

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: