Running a Grails+Maven app in Maia

<sarcasm>I am having more fun with the Maia beta than I can possibly imagine.</sarcasm>

I moved an existing Grails 1.1.1 project from Idea 8 to the Maia beta.  We use the grails-maven plugin so all of our dependencies are in the pom.xml file.  Aside from the issue that I posted yesterday related to WebFlowTestCase, the project compiles and runs unit tests fine under Maia.  The problem is that when I try to run the project within Maia, it does not pass the classpath parameter on the command line, so none of the dependencies from the pom (that are also in the .iml file) are included.  Thus, it fails as soon as it tries to load a service that depends on one of those libraries.  This did work in Idea 8.

I thought that maybe something went wrong in the conversion process, so I tried removing the .idea and .iml directory/file to create the Intellij project from scratch.  First I tried to created it from external model and pointed it at the pom.  The new project was created and all the dependencies were brought in, but Intellij did not detect that it was a grails app.  I deleted the project again and tried creating it as a grails app.  This time it gave me the grails views, but no dependencies from the pom were created.

Has anyone else converted such a project from Idea 8 and had it run fine?  Any general tips on how to tell Maia that a given project is a Grails project now that there is no such thing as a Grails facet?

BTW - as a last attempt to get it to work, I did try opening the Maven Projects tool window and selecting the Plugins->grails->grails:run-app target.  That did work.  I would just prefer it if the normal run/debug commands worked.

24 comments
Comment actions Permalink

I just happened to try an integration test and hit the same problem.  It's very strange because unit tests run great.  Is anyone else out there using the grails-maven plugin with Idea?  I just want to know if it's my machine or project or if there is bug with Maia.

Thanks,

e

0
Comment actions Permalink

Hi, Eric,

Could you please make a smaple project? I'll try to fix the problem.

Thanks,
Anton Makeev

0
Comment actions Permalink

Eric, do you still experience this problem in IDEA 9 release? It should
be fixed now.

0
Comment actions Permalink

Nope, same problem still exists both for running the app and running integration tests.  Is there some piece in a file under the .idea directory that I can check to see if it's trying to pull in the right info or not?

0
Comment actions Permalink

How do you run your Grails application? Do you use Grails run configuration for this? Are the additional dependencies still in your .iml file? Do you have the 'add --classpath' checkbox enabled in your Grails run configuration?

0
Comment actions Permalink

Under Intellij 8 I could run the application with a configuration under the Grails section in the Run/Debug Configurations dialog.  Under 9, it doesn't work.  The 'add --classpath' checkboxis enabled, but also greyed out so that I cannot modify it.  All the dependencies are still in the iml file, and compilation (Ctrl-F9) and unit tests work fine using the built in JUnit runner.

Here is the initial line that appears in the run console when I try to run using a Grails run config:

C:\Dev\java\jdk1.6.0_16\bin\java -Dserver.port=8090 -Xmx256M -Dgrails.home=C:\Dev\utilities\grails\grails-1.1.1 -Dbase.dir=C:\Dev\workspace\hub\user-ui -Dtools.jar=C:\Dev\java\jdk1.6.0_16\lib\tools.jar -Dgroovy.starter.conf=C:\Dev\utilities\grails\grails-1.1.1/conf/groovy-starter.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Dev\intellij\IntelliJ IDEA 9.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\Dev\utilities\grails\grails-1.1.1\lib\groovy-all-1.6.3.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-bootstrap-1.1.1.jar;C:\Dev\intellij\IntelliJ IDEA 9.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\Dev\utilities\grails\grails-1.1.1/conf/groovy-starter.conf run-app

It fails on init because it cannot find library classes required by one of the services.  The app successfully runs within Intellij using a Maven run config with the goal "org.grails:grails-maven-plugin:1.1:run-app".  I can also run integration tests using a Maven run config.

For comparision, here is the initial line when I run a Unit test using the built in JUnit runner (which runs successfully):

C:\Dev\java\jdk1.6.0_16\bin\java -Didea.launcher.port=7534 "-Didea.launcher.bin.path=C:\Dev\intellij\IntelliJ IDEA 9.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\Dev\intellij\IntelliJ IDEA 9.0\plugins\junit\lib\junit-rt.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\alt-rt.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\charsets.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\deploy.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\javaws.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\jce.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\jsse.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\management-agent.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\plugin.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\resources.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\rt.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\ext\dnsns.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\ext\localedata.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\ext\sunjce_provider.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\ext\sunmscapi.jar;C:\Dev\java\jdk1.6.0_16\jre\lib\ext\sunpkcs11.jar;C:\Dev\workspace\hub\user-ui\target\test-classes;C:\Dev\workspace\hub\user-ui\target\classes;C:\Dev\utilities\grails\grails-1.1.1\lib\jstl-2.3.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ehcache-1.5.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\org.springframework.binding-2.0.3.RELEASE.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jetty-plus-6.1.14.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jsp-api-2.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\xpp3_min-1.1.3.4.O.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\log4j-1.2.15.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jetty-naming-6.1.14.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-spring-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-validator-1.3.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\groovy-all-1.6.3.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jasper-runtime-5.5.15.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\antlr-2.7.6.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\hibernate3-3.3.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ejb3-persistence-3.3.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\spring-2.5.6.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-bootstrap-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-el-1.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-beanutils-1.7.0.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-gorm-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\svnkit-1.2.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\standard-2.4.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-pool-1.2.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ognl-2.6.9.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ant-junit-1.7.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-io-1.4.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jetty-6.1.14.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\standard-2.3.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jta-1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\backport-util-concurrent-3.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\spring-test-2.5.6.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-lang-2.4.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\hibernate-annotations-3.3.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-collections-3.2.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jsp-api-2.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jcl-over-slf4j-1.5.6.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ant-1.7.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\servlet-api-2.5-6.1.14.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-dbcp-1.2.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ant-nodeps-1.7.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\start.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\sitemesh-2.4.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\hibernate-commons-annotations-3.3.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jasper-compiler-jdt-5.5.15.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\oro-2.0.8.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\org.springframework.webflow-2.0.3.RELEASE.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jasper-compiler-5.5.15.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-crud-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jline-0.9.91.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\cglib-nodep-2.1_3.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-test-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ant-launcher-1.7.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\oscache-2.4.1.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-resources-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jetty-util-6.1.14.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-web-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\org.springframework.js-2.0.3.RELEASE.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jsr107cache-1.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\jstl-2.4.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\gant_groovy1.6-1.6.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\slf4j-api-1.5.6.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ivy-2.0.0.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-core-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\slf4j-log4j12-1.5.6.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\hsqldb-1.8.0.5.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-fileupload-1.2.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-codec-1.3.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\commons-cli-1.0.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\ant-trax.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-scripts-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\serializer.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\junit-3.8.2.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-webflow-1.1.1.jar;C:\Dev\utilities\grails\grails-1.1.1\lib\spring-webmvc-2.5.6.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\quartz-0.4.1\lib;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib\hibernate3-3.3.1.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib\dom4j-1.6.1.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\shiro-1.0-SNAPSHOT\lib;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib\javassist-3.4.GA.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\shiro-1.0-SNAPSHOT\lib\shiro-all-1.0-incubating-SNAPSHOT.jar;C:\Dev\workspace\hub\user-ui\lib;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\quartz-0.4.1\lib\quartz-1.6.5.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib\hibernate-annotations-3.3.0.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\hibernate-1.1.1\lib\hibernate-commons-annotations-3.3.0.jar;C:\Documents and Settings\esword\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-crud\1.1.1\grails-crud-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\codehaus\groovy\groovy-all\1.6.3\groovy-all-1.6.3.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\ant\ant\1.7.1\ant-1.7.1.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\ant\ant-launcher\1.7.1\ant-launcher-1.7.1.jar;C:\Documents and Settings\esword\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;C:\Documents and Settings\esword\.m2\repository\org\slf4j\jcl-over-slf4j\1.5.6\jcl-over-slf4j-1.5.6.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\spring\2.5.6\spring-2.5.6.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\spring-webmvc\2.5.6\spring-webmvc-2.5.6.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\spring-web\2.5.6\spring-web-2.5.6.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-core\1.1.1\grails-core-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\cglib\cglib-nodep\2.1_3\cglib-nodep-2.1_3.jar;C:\Documents and Settings\esword\.m2\repository\commons-collections\commons-collections\3.2\commons-collections-3.2.jar;C:\Documents and Settings\esword\.m2\repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar;C:\Documents and Settings\esword\.m2\repository\commons-pool\commons-pool\1.3\commons-pool-1.3.jar;C:\Documents and Settings\esword\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar;C:\Documents and Settings\esword\.m2\repository\commons-validator\commons-validator\1.3.1\commons-validator-1.3.1.jar;C:\Documents and Settings\esword\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Documents and Settings\esword\.m2\repository\commons-digester\commons-digester\1.6\commons-digester-1.6.jar;C:\Documents and Settings\esword\.m2\repository\oro\oro\2.0.8\oro-2.0.8.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\spring-test\2.5.6\spring-test-2.5.6.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-spring\1.1.1\grails-spring-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\slf4j\slf4j-api\1.5.5\slf4j-api-1.5.5.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-resources\1.1.1\grails-resources-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-web\1.1.1\grails-web-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\commons-el\commons-el\1.0\commons-el-1.0.jar;C:\Documents and Settings\esword\.m2\repository\commons-fileupload\commons-fileupload\1.2.1\commons-fileupload-1.2.1.jar;C:\Documents and Settings\esword\.m2\repository\opensymphony\sitemesh\2.3\sitemesh-2.3.jar;C:\Documents and Settings\esword\.m2\repository\xpp3\xpp3_min\1.1.3.4.O\xpp3_min-1.1.3.4.O.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-gorm\1.1.1\grails-gorm-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\hibernate\hibernate-core\3.3.1.GA\hibernate-core-3.3.1.GA.jar;C:\Documents and Settings\esword\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar;C:\Documents and Settings\esword\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\Documents and Settings\esword\.m2\repository\javax\transaction\jta\1.1\jta-1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-test\1.1.1\grails-test-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\grails\grails-webflow\1.1.1\grails-webflow-1.1.1.jar;C:\Documents and Settings\esword\.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\webflow\org.springframework.webflow\2.0.3.RELEASE\org.springframework.webflow-2.0.3.RELEASE.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\webflow\org.springframework.binding\2.0.3.RELEASE\org.springframework.binding-2.0.3.RELEASE.jar;C:\Documents and Settings\esword\.m2\repository\org\springframework\webflow\org.springframework.js\2.0.3.RELEASE\org.springframework.js-2.0.3.RELEASE.jar;C:\Documents and Settings\esword\.m2\repository\ognl\ognl\2.6.9\ognl-2.6.9.jar;C:\Documents and Settings\esword\.m2\repository\org\codehaus\groovy\modules\http-builder\http-builder\0.5.0-SNAPSHOT\http-builder-0.5.0-SNAPSHOT.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\httpcomponents\httpclient\4.0-beta2\httpclient-4.0-beta2.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\httpcomponents\httpcore\4.0-beta3\httpcore-4.0-beta3.jar;C:\Documents and Settings\esword\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar;C:\Documents and Settings\esword\.m2\repository\net\sf\json-lib\json-lib\2.2.2\json-lib-2.2.2-jdk15.jar;C:\Documents and Settings\esword\.m2\repository\net\sf\ezmorph\ezmorph\1.0.4\ezmorph-1.0.4.jar;C:\Documents and Settings\esword\.m2\repository\org\codehaus\groovy\groovy\1.7-beta-1\groovy-1.7-beta-1.jar;C:\Documents and Settings\esword\.m2\repository\asm\asm\3.2\asm-3.2.jar;C:\Documents and Settings\esword\.m2\repository\asm\asm-commons\3.2\asm-commons-3.2.jar;C:\Documents and Settings\esword\.m2\repository\asm\asm-tree\3.2\asm-tree-3.2.jar;C:\Documents and Settings\esword\.m2\repository\asm\asm-util\3.2\asm-util-3.2.jar;C:\Documents and Settings\esword\.m2\repository\asm\asm-analysis\3.2\asm-analysis-3.2.jar;C:\Documents and Settings\esword\.m2\repository\net\sourceforge\nekohtml\nekohtml\1.9.9\nekohtml-1.9.9.jar;C:\Documents and Settings\esword\.m2\repository\xml-resolver\xml-resolver\1.2\xml-resolver-1.2.jar;C:\Documents and Settings\esword\.m2\repository\opensymphony\oscache\2.4\oscache-2.4.jar;C:\Documents and Settings\esword\.m2\repository\org\tmatesoft\svnkit\svnkit\1.2.3.5521\svnkit-1.2.3.5521.jar;C:\Documents and Settings\esword\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;C:\Documents and Settings\esword\.m2\repository\hsqldb\hsqldb\1.8.0.5\hsqldb-1.8.0.5.jar;C:\Documents and Settings\esword\.m2\repository\org\slf4j\slf4j-log4j12\1.5.5\slf4j-log4j12-1.5.5.jar;C:\Documents and Settings\esword\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar;C:\Documents and Settings\esword\.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\poi\poi\3.5-beta6\poi-3.5-beta6.jar;C:\Documents and Settings\esword\.m2\repository\org\apache\poi\poi-scratchpad\3.5-beta6\poi-scratchpad-3.5-beta6.jar;C:\Dev\java\jdk1.6.0_16\jre\..\lib\tools.jar;C:\Documents and Settings\esword\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;C:\Documents and Settings\esword\.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.0.1\tagsoup-1.0.1.jar;C:\Dev\workspace\hub\out\test\user-ui-grailsPlugins;C:\Dev\workspace\hub\out\production\user-ui-grailsPlugins;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\selenium-rc-0.1.1\lib\selenium-java-client-driver-1.0.1.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\selenium-rc-0.1.1\lib\selenium-java-client-driver.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\selenium-rc-0.1.1\lib\gmock-0.8.0.jar;C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\plugins\selenium-rc-0.1.1\lib;C:\Dev\intellij\IntelliJ IDEA 9.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.saic.hub.MapLayerTests

However, when I run a unit test with the "Grails" option, the line is missing everything like it does if I use the built in Grails config for run-app::

C:\Dev\java\jdk1.6.0_16\bin\java -Xmx256M -Dgrails.home=C:\Dev\utilities\grails\grails-1.1.1 -Dbase.dir=C:\Dev\workspace\hub\user-ui -Dtools.jar=C:\Dev\java\jdk1.6.0_16\lib\tools.jar -Dgroovy.starter.conf=C:\Dev\utilities\grails\grails-1.1.1/conf/groovy-starter.conf -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Dev\intellij\IntelliJ IDEA 9.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\Dev\utilities\grails\grails-1.1.1\lib\groovy-all-1.6.3.jar;C:\Dev\utilities\grails\grails-1.1.1\dist\grails-bootstrap-1.1.1.jar;C:\Dev\intellij\IntelliJ IDEA 9.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\Dev\utilities\grails\grails-1.1.1/conf/groovy-starter.conf "test-app -unit com.saic.hub.MapLayer"

And it has problems compiling/running just like if I try to use the Grails run-app.

0
Comment actions Permalink

I guess it's Maven dependencies that are missing while should not be. OK. Are they marked as 'Compile' in your module dependencies or as something else?

0
Comment actions Permalink

You mean in the maven pom?  Nearly all are default dependency type (i.e. compile).  There are a couple runtime and provided libraries, but the particular one that it errors out on first is definitately a compile time dependency.

0
Comment actions Permalink

I mean IDEA module classpath editor, there are different types of module dependencies now. Please make sure they're for compilation. Could you attach your .iml file?

0
Comment actions Permalink

Sorry for the delay.  Yes, the dependencies are listed with scope = compile in the module dependencies view.  IML is attached.  We just moved to 93.67 and behavior is the same.



Attachment(s):
user-ui.iml.zip
0
Comment actions Permalink

Please replace the GrailsGriffon plugin with the attached one (I hope it's compatible with 9.0.1) and add the following lines to your <idea>/bin/idea.log file:

<category name="#org.jetbrains.plugins.groovy.mvc">
<priority value="DEBUG"/>
<appender-ref ref="CONSOLE-ALL"/>
</category>

After that, restart IDEA, open the Grails Run Configuration, look at the disabled checkbox, try running run-app and test-app, and post the <idea_system>/logs/idea.log here. I've added some diagnostics.



Attachment(s):
GrailsGriffon.zip
0
Comment actions Permalink

Thanks for the help.  We are in a release cycle right now, so it will be a couple of days before I can set it up.

0
Comment actions Permalink

Log enclosed, along with a threadDumps folder that was created and the console output.  I cleared the existing idea.log, launched with the modified GrailsGriffon plugin, ran the app using a standard grails configuration, saw the error, and then quit.



Attachment(s):
log.zip
0
Comment actions Permalink

Perfect. I've refined the diagnostics a bit, since the previous didn't help. So, please repeat those steps with the attached plugin version (should be compatible with the last 9.0.2 EAP).



Attachment(s):
GrailsGriffon.zip
0
Comment actions Permalink

Sorry it took so long to respond.  Attached are two zip files,  one using build 23.67 and one using build 24.273, both using the GriffonGrails plugin that you posted on 1/28.  Sorry if you needed it run with build 94.192.  I didn't have time to look at it until today and I saw that 24.273 was out, so I pulled that.

For both builds, I cleared the log file, launched, did a full Rebuild, and then ran the Grails run-app config that I had created previously.  For the 24.273 build, I also ran the Grails run-app with the Make option unchecked just to see if made a difference.  The error occurred in all configs.

Hope this helps narrow it down.



Attachment(s):
log-94.273.zip
log-23.67.zip
0
Comment actions Permalink

Thank you. Here's the plugin that hopefully should fix the problem.



Attachment(s):
GrailsGriffon.zip
0
Comment actions Permalink

No dice, sorry.  Same problem under build 94.273.  I just realized that I had not set up the log4j.xml file correctly under this version with the last GrailsGriffon plugin you uploaded.  Sorry about that.  Here is a zip with the log and console output from the latest plugin you put up.  Hopefully it contains more information for you.



Attachment(s):
log.zip
0
Comment actions Permalink

Oops, my fault. Try this version.



Attachment(s):
GrailsGriffon.zip
0
Comment actions Permalink

Nope.  Same results.



Attachment(s):
log.zip
0
Comment actions Permalink

More diagnostics added.



Attachment(s):
GrailsGriffon.zip
0
Comment actions Permalink

I had a quick break so was able to run with it.  Normal sequence of steps.  I also added another log with an expanded sequence - launch, rebuild, run via maven target, run via grails, and then another run via grails with a slightly different config (passing option as VM argument).  Hopefully this gets you useful info.



Attachment(s):
log.zip
0
Comment actions Permalink

It looks like you have unchecked the 'add --classpath' checkbox in the run configuration. Please check it. (It's always on in your version of the plugin)

0
Comment actions Permalink

Sorry about not checking that setting.  It actually defaults to off (and greyed out) in the plugin version I have when creating a new run configuration.  If I go back and edit a run configuration after creating it, I can then turn it on.  That gets me much closer, but there is still a strange behavior.  When compiling/rebuilding, Intellij respects the output directories for maven (they are set in the module paths setting).  When using a Grails run configuration, however, it tries to compile classes, copy resources, etc into the $USER_HOME/.grails/1.1.1/projects/[project-name] directory.  Here's a snippet from the console:

[class path stuff here]
Settings\esword\.m2\repository\hibernate-entitymanager\ejb3-persistence\3.3.2.GA\ejb3-persistence-3.3.2.GA.jar;." "run-app -Dserver.port=8090"
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\Dev\utilities\grails\grails-1.1.1

Base Directory: C:\Dev\workspace\hub\user-ui
Running script C:\Dev\utilities\grails\grails-1.1.1\scripts\RunApp.groovy
Environment set to development
     [copy] Copied 7 empty directories to 3 empty directories under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 3 empty directories to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copying 1 file to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 3 empty directories to 2 empty directories under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 2 empty directories to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 3 empty directories to 2 empty directories under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
    [mkdir] Created dir: C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\classes
  [groovyc] Compiling 47 source files to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\classes
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
  [groovyc] Compiling 63 source files to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\classes
Unable to load specified config location classpath:user-ui-config.properties : class path resource [user-ui-config.properties] cannot be opened because it does not existUnable to load specified config location classpath:custom_hub_config.groovy : class path resource [custom_hub_config.groovy] cannot be opened because it does not exist
[mkdir] Created dir: C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources\grails-app\i18n
[native2ascii] Converting 13 files from C:\Dev\workspace\hub\user-ui\grails-app\i18n to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources\grails-app\i18n
     [copy] Copying 1 file to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\classes
     [copy] Copied 1 empty directory to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copied 4 empty directories to 1 empty directory under C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\resources
     [copy] Copying 1 file to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui
Running Grails application..


The problem with this recompile/copy is that it will not always do it.  I had several class files and resources sitting in that directory that were a couple of months old (not clear what put them there to begin with).  Even doing a complete rebuild would not get rid of or replace them.  Here's the console snippet when I tried to use the grails run config with those files sitting in the directory:

Settings\esword\.m2\repository\hibernate-entitymanager\ejb3-persistence\3.3.2.GA\ejb3-persistence-3.3.2.GA.jar;." "run-app -Dserver.port=8090"
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\Dev\utilities\grails\grails-1.1.1

Base Directory: C:\Dev\workspace\hub\user-ui
Running script C:\Dev\utilities\grails\grails-1.1.1\scripts\RunApp.groovy
Environment set to development
  [groovyc] Compiling 1 source file to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui\classes
Unable to load specified config location classpath:user-ui-config.properties : class path resource [user-ui-config.properties] cannot be opened because it does not existUnable to load specified config location classpath:custom_hub_config.groovy : class path resource [custom_hub_config.groovy] cannot be opened because it does not exist
  [copy] Copying 1 file to C:\Documents and Settings\esword\.grails\1.1.1\projects\user-ui
Running Grails application..


The only file that is recompiled into that directory is the grails-app/conf/spring/resources.groovy file.  Nothing else is copied there or replaced.  If I manually remove the contents of the $USER_HOME/.grails/1.1.1/projects/[project-name] (except for the plugins directory), then all of the proper files are compiled/copy into place and the program works as expected (see the first console output snippet, above).

FYI, when running the maven grails:run-app run config, Intellij still uses the proper output directories set by maven:

[INFO] [grails:run-app {execution: default-cli}]
[INFO] Using Grails 1.1.1
Running pre-compiled script
Environment set to development
     [copy] Copied 7 empty directories to 3 empty directories under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 3 empty directories to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copying 1 file to C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 3 empty directories to 2 empty directories under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 1 empty directory to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 2 empty directories to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 3 empty directories to 2 empty directories under C:\Dev\workspace\hub\user-ui\target\resources
[groovyc] Compiling 47 source files to C:\Dev\workspace\hub\user-ui\target\classes
[groovyc] Compiling 12 source files to C:\Dev\workspace\hub\user-ui\target\classes
    [mkdir] Created dir: C:\Dev\workspace\hub\user-ui\target\resources\grails-app\i18n
[native2ascii] Converting 13 files from C:\Dev\workspace\hub\user-ui\grails-app\i18n to C:\Dev\workspace\hub\user-ui\target\resources\grails-app\i18n
     [copy] Copying 1 file to C:\Dev\workspace\hub\user-ui\target\classes
     [copy] Copied 1 empty directory to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
     [copy] Copied 4 empty directories to 1 empty directory under C:\Dev\workspace\hub\user-ui\target\resources
Unable to load specified config location classpath:user-ui-config.properties : class path resource [user-ui-config.properties] cannot be opened because it does not existUnable to load specified config location classpath:custom_hub_config.groovy : class path resource [custom_hub_config.groovy] cannot be opened because it does not exist
[copy] Copying 1 file to C:\Dev\workspace\hub\user-ui\target
Running Grails application..


Attached is the log file for when it fails (i.e. doesn't properly compile/copy the files).  Hopefully, there is just a single parameter that needs to be set for grails to know where it should put the assembled application and you can set that to the proper output targets.

Thanks for the help,

e



Attachment(s):
log.zip
0
Comment actions Permalink

It's may be more of a question to Grails. The Grails run configuration basically aims to do exactly the same what 'grails <cmd-name>' would do from the command line. I suspect that the Maven integration does something else. We don't have any Maven-specific functionality in Grails support yet (http://youtrack.jetbrains.net/issue/IDEA-48560).

You can try invoking Grails 'clean' command. Theoretically, it should clean everything it has compiled.

0

Please sign in to leave a comment.