play-groovy
play-groovy copied to clipboard
The groovy plugin throws an exception at application startup
I've installed the groovy module and created an Play app with groovy option. Starting the application the following exception is thrown
00:30:16,979 INFO ~ Starting /Users/ptommaso/workspace/groovyapp
00:30:16,983 INFO ~ Module groovy is available (/Users/ptommaso/tools/play-1.2.3/modules/groovy-0.1)
00:30:17,938 INFO ~ Groovy support is active
00:30:17,939 WARN ~ You're running Play! in DEV mode
~
~ Go to http://localhost:9000/@tests to run the tests
~
00:30:18,024 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
Not sure what to do with this source. This is probably a bug
Not sure what to do with this source. This is probably a bug
00:30:29,568 ERROR ~
@68p05a770
Internal Server Error (500) for request GET /
Oops: NullPointerException
An unexpected error occured caused by exception NullPointerException: Cannot invoke method refresh() on null object
play.exceptions.UnexpectedException: Unexpected Error
at play.Play.start(Play.java:525)
at play.Play.detectChanges(Play.java:610)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException: Cannot invoke method refresh() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at play.groovysupport.GroovyPlugin$_updateJava_closure10.doCall(GroovyPlugin.groovy:242)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:884)
at groovy.lang.Closure.call(Closure.java:410)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:3374)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1406)
at org.codehaus.groovy.runtime.dgm$143.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at play.groovysupport.GroovyPlugin.updateJava(GroovyPlugin.groovy:215)
at play.groovysupport.GroovyPlugin$updateJava.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at play.groovysupport.GroovyPlugin.compileSources(GroovyPlugin.groovy:101)
at play.plugins.PluginCollection.compileSources(PluginCollection.java:349)
at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:397)
at play.Play.start(Play.java:485)
hi - sorry I didn't see this before. I'll look into this now
OK, there was a syntax error in one of the default tests so I've fixed that, but I don't think that's what was causing your error.
Did you put any of your own source files in your play-groovy app before you got this error? Or is this from the exact sample app that you get given when you do > play new groovyapp --with groovy ?
No, I didn't add any new files. It's the "welcome" app as it is generated by the new command. Trying to debug it I've added a more detailed log message. It seems the problem is that absolute paths are not resolved for some modules. Look:
19:31:13,181 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ... Not sure what to do with this source '/Users/yo/tools/play-1.2.3/modules/docviewer/app/controllers/PlayDocumentation'. This is probably a bug Not sure what to do with this source '/Users/yo/tools/play-1.2.3/modules/docviewer/app/controllers/PlayDocumentation'. This is probably a bug 19:31:20,034 ERROR ~
Hi.
My last pull request is a bugfix for that issue.