Cannot get JetGroovy to work

Okay, since I cannot seem to find a reference to this anywhere else, then I can only assume that it is something I have forgotten.

I'm using version 1.0.13702 of JetGroovy
Version 1.5.1 of Groovy
and Grails 1.0 RC3

Not really sure what is going on, but it looks as if the files are not generating correctly.

Generating a new application causes a dialog box to come up, saying that it cannot create the application (no reason given), but when I exit the dialog, the app gets generated anyway!

When I try to start the application, the build process comes up with the following warnings

-


Information:Compilation completed successfully with 7 warnings
Information:0 errors
Information:7 warnings
C:\MyProjects\DVD\web-app\WEB-INF\applicationContext.xml
Warning:Warning:line (36)Cannot find matching files
Warning:Warning:line (9)Cannot resolve file or web directory element or directory 'WEB-INF'.
Warning:Warning:line (15)Cannot resolve file or web directory element or directory 'WEB-INF'.
Warning:Warning:line (20)Cannot resolve file 'plugin.xml'.
Warning:Warning:line (36)Cannot resolve file or web directory element or directory 'grails-app'.
Warning:Warning:line (15)Cannot resolve file 'grails.xml'.
Warning:Warning:line (9)Cannot resolve file 'grails.xml'.
-



And then refuses to run the application.

Any ideas?

9 comments

Well, from what I see from the output of running grails app, it seems the files have not been generated, at least no grails-app is found. Wasn't it access denied (on grails.bat) caused by lack of execute flag on that file, that caused the original error?

Eugene.

0

File permissions seem to be okay.

.. and after the error message, it does seem to carry on and generate the files. When I try to run it though, I get this:

-


Welcome to Grails null - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:\grails-1.0-RC3;C:\grails-1.0-RC3

Base Directory: C:\MyProjects\DVDRental
Environment set to development
Note: No plugin scripts found
Script RunApp not found.
Run 'grails help' for a complete list of available scripts.

Process finished with exit code 0
-



It looks as if the Grails home path is not being set correctly. Now I already have it set as an environment variable, so I'll try removing it.

.. which works, it can now find the script folder. Perhaps JetGroovy could check to see if an existing location for Groovy/Grails has been defined and use that?

Now I'm getting a load of errors when it starts up. This is weird. It looks as if this machine may have a port locked down or something. I'll give it a try on another machine when I get the chance



Attachment(s):
error.txt
0

GRAILS_HOME is injected to your grails configuration in IDEA, not an external env variable when running external process from JetGroovy. So if you have configured it properly, it should work OK.

0

Hi,

I also cannot seem to get JetGroovy to work, at all.

I'm using IntelliJ 9.0.4, and I just enabled the JetGroovy plugin that comes with it, and also some Griffon/Grails plugin.

Well maybe some of it is working. I can click New -> Groovy Script, and get a blank file. Most frustratingly autocomplete does not work, the compiler/debugger does not work, which makes it nothing but a cumbersome text editor. My groovy files in the project view have a strange crossed-out J icon next to them, so maybe it is not recognizing that they are groovy files?? But when I click New -> Groovy script, those generated files also have a crossed-out J as their icons.

Sorry, I am very new to intelliJ and Groovy. I actually tried going back to Eclipse and using a Groovy plugin for Eclipse, and of course that failed miserably too, I just get some huge org.codehaus.groovy stracktrace when I try to open a Groovy file in Eclipse, but I digress.

Please help me get this JetGroovy plugin working, it is getting extremely annoying trying to develop Groovy without any code completion or debugging.



Attachment(s):
screen.png
0

Hello Dave,

For all of the JetGroovy features to work, the .groovy files need to be under
a source root of a module.

I also cannot seem to get JetGroovy to work, at all.

I'm using IntelliJ 9.0.4, and I just enabled the JetGroovy plugin that
comes with it, and also some Griffon/Grails plugin.

Well maybe some of it is working. I can click New -> Groovy Script,
and get a blank file. Most frustratingly autocomplete does not work,
the compiler/debugger does not work, which makes it nothing but a
cumbersome text editor. My groovy files in the project view have a
strange crossed-out J icon next to them, so maybe it is not
recognizing that they are groovy files?? But when I click New ->
Groovy script, those generated files also have a crossed-out J as
their icons.

Sorry, I am very new to intelliJ and Groovy. I actually tried going
back to Eclipse and using a Groovy plugin for Eclipse, and of course
that failed miserably too, I just get some huge org.codehaus.groovy
stracktrace when I try to open a Groovy file in Eclipse, but I
digress.

Please help me get this JetGroovy plugin working, it is getting
extremely annoying trying to develop Groovy without any code
completion or debugging.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks, that got rid of the anti-J icons, but now everything is in red because it is validating it like a regular java file.

Please see attachment.



Attachment(s):
screen2.png
0

Hello Dave,

Please make sure that the .groovy extension is assigned to Groovy, rather
than Java, file type in Settings | File Types.

Thanks, that got rid of the anti-J icons, but now everything is in red
because it is validating it like a regular java file.

Please see attachment.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks so much, that seemed to finally solve my problem... :)

But now the intellij code inspector (or something) is constantly throwing exceptions when I try to use autocomplete, or just randomly:

java.lang.NoSuchMethodError: com.intellij.codeInspection.ProblemsHolder.<init>(Lcom/intellij/codeInspection/InspectionManager;)V
at com.siyeh.inspectorgroovy.BaseInspection.checkFile(BaseInspection.java:79)
at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:87)
at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:91)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.process(LocalInspectionsPass.java:215)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.process(LocalInspectionsPass.java:195)
at com.intellij.concurrency.JobUtil$2$1.run(JobUtil.java:94)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:198)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:223)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:189)
at com.intellij.concurrency.JobUtil$2.process(JobUtil.java:92)
at com.intellij.concurrency.JobUtil$1.run(JobUtil.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:77)
at com.intellij.concurrency.JobUtil.invokeConcurrentlyForAll(JobUtil.java:71)
at com.intellij.concurrency.JobUtil.invokeConcurrentlyUnderMyProgress(JobUtil.java:89)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:195)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.b(LocalInspectionsPass.java:118)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:105)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:52)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:329)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:924)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:321)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:223)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:319)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)


And if I try to rebuild the whole project I get this:

BUG! exception in phase 'semantic analysis' in source unit 'C:\dev\MobileTVServer_ConfigManager\trunk\configmanager-administration-web\grails-app\conf\DataSource.groovy' Groovyc error: org/hibernate/cfg/AnnotationConfiguration class not found while resolving class org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration; try compiling org/hibernate/cfg/AnnotationConfiguration explicitly
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:802)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:43)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:75)
Caused by: java.lang.RuntimeException: Groovyc error: org/hibernate/cfg/AnnotationConfiguration class not found while resolving class org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration; try compiling org/hibernate/cfg/AnnotationConfiguration explicitly
at org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRunner.java:432)
at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:618)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:264)
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:988)
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141)
at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.java:553)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:798)
... 8 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:646)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:513)
at org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRunner.java:427)
... 14 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.AnnotationConfiguration
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 28 more



Does it actually say BUG at the beginning of that stacktrace?! :O
0

Hello Dave,

Please uninstall the InspectorGroovy plugin. It's old, incompatible with
recent versions of IntelliJ IDEA, and its entire functionality is included
in JetGroovy.

Thanks so much, that seemed to finally solve my problem...


But now the intellij code inspector (or something) is constantly
throwing exceptions when I try to use autocomplete, or just randomly:

+java.lang.NoSuchMethodError:
com.intellij.codeInspection.ProblemsHolder.<init>(Lcom/intellij/codeIn
spection/InspectionManager;)V+

+at
com.siyeh.inspectorgroovy.BaseInspection.checkFile(BaseInspection.java
:79)+

+at
com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspe
ctionTool.java:87)+

at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:91)

+at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.process(Lo
calInspectionsPass.java:215)+

+at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.process(Lo
calInspectionsPass.java:195)+

at com.intellij.concurrency.JobUtil$2$1.run(JobUtil.java:94)

+at
com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressM
anagerImpl.java:198)+

+at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessU
nderProgress(ProgressManagerImpl.java:223)+

+at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(Prog
ressManagerImpl.java:189)+

at com.intellij.concurrency.JobUtil$2.process(JobUtil.java:92)

at com.intellij.concurrency.JobUtil$1.run(JobUtil.java:59)

+at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441
)+

+at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)+

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

+at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.jav
a:77)+

+at
com.intellij.concurrency.JobUtil.invokeConcurrentlyForAll(JobUtil.java
:71)+

+at
com.intellij.concurrency.JobUtil.invokeConcurrentlyUnderMyProgress(Job
Util.java:89)+

+at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspe
ctionsPass.java:195)+

+at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.b(LocalInspe
ctionsPass.java:118)+

+at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInfor
mationWithProgress(LocalInspectionsPass.java:105)+

+at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightin
gPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java
:52)+

+at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInform
ation(TextEditorHighlightingPass.java:54)+

+at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass
$1$1.run(PassExecutorService.java:329)+

+at
com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction
(ApplicationImpl.java:924)+

+at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass
$1.run(PassExecutorService.java:321)+

+at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessU
nderProgress(ProgressManagerImpl.java:223)+

+at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass
.run(PassExecutorService.java:319)+

+at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441
)+

+at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)+

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

+at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu
tor.java:886)+

+at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
java:908)+

at java.lang.Thread.run(Thread.java:619)

And if I try to rebuild the whole project I get this:

+BUG! exception in phase 'semantic analysis' in source unit
'C:\dev\MobileTVServer_ConfigManager\trunk\configmanager-administratio
n-web\grails-app\conf\DataSource.groovy' Groovyc error:
org/hibernate/cfg/AnnotationConfiguration class not found while
resolving class
org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfigura
tion; try compiling org/hibernate/cfg/AnnotationConfiguration
explicitly+

++ +at
org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compila
tionUnit.java:802)+

++ +at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.ja
va:464)+

++ +at
org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyC
ompilerWrapper.java:43)+

++ +at
org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java
:128)+

++ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

++ +at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:39)+

++ +at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)+

++ at java.lang.reflect.Method.invoke(Method.java:597)

++ +at
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.j
ava:75)+

+Caused by: java.lang.RuntimeException: Groovyc error:
org/hibernate/cfg/AnnotationConfiguration class not found while
resolving class
org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfigura
tion; try compiling org/hibernate/cfg/AnnotationConfiguration
explicitly+

++ +at
org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRu
nner.java:432)+

++ +at
org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisit
or.java:618)+

++ +at
org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java
:264)+

++ +at
org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.j
ava:988)+

++ +at
org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisit
or.java:141)+

++ +at
org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.jav
a:553)+

++ +at
org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compila
tionUnit.java:798)+

++ ... 8 more

+Caused by: java.lang.NoClassDefFoundError:
org/hibernate/cfg/AnnotationConfiguration+

++ at java.lang.ClassLoader.defineClass1(Native Method)

++ at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

++ at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

++ +at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141
)+

++ at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

++ at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

++ at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

++ at java.security.AccessController.doPrivileged(Native Method)

++ at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

++ at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

++ at java.lang.ClassLoader.loadClass(ClassLoader.java:296)

++ +at
groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:646)+

++ +at
groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:513)+

++ +at
org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRu
nner.java:427)+

++ ... 14 more

+Caused by: java.lang.ClassNotFoundException:
org.hibernate.cfg.AnnotationConfiguration+

++ at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

++ at java.security.AccessController.doPrivileged(Native Method)

++ at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

++ at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

++ at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

++ ... 28 more

Does it actually say BUG at the beginning of that stacktrace?!


---
Original message URL:
http://devnet.jetbrains.net/message/5279380#5279380


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.