raby / play2-maven-plugin

Automatically exported from code.google.com/p/play2-maven-plugin
0 stars 0 forks source link

"ebean-enhance" goal throws NullPointerException #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On a project that works fine using alpha6, running the goal ebean-enhance has 
no issues, after changing to alpha7, each and everytime I get the following 
error (thanks!):

I'm running Play 2.2.1.

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha7:ebean-enhance
 (default-cli) on project ibd.services.streaming.core: Execution default-cli of 
goal 
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha7:ebean-enhance
 failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha7:ebean-enhance
 (default-cli) on project ibd.services.streaming.core: Execution default-cli of 
goal 
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha7:ebean-enhance
 failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
default-cli of goal 
com.google.code.play2-maven-plugin:play2-maven-plugin:1.0.0-alpha7:ebean-enhance
 failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.NullPointerException
    at com.google.code.play2.plugin.Play2EbeanEnhanceMojo.collectClassFilesToEnhanceFromPackage(Play2EbeanEnhanceMojo.java:246)
    at com.google.code.play2.plugin.Play2EbeanEnhanceMojo.collectClassFilesToEnhance(Play2EbeanEnhanceMojo.java:236)
    at com.google.code.play2.plugin.Play2EbeanEnhanceMojo.internalExecute(Play2EbeanEnhanceMojo.java:115)
    at com.google.code.play2.plugin.AbstractPlay2Mojo.execute(AbstractPlay2Mojo.java:139)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more

Original issue reported on code.google.com by lramo...@gmail.com on 10 Jun 2014 at 12:08

GoogleCodeExporter commented 9 years ago
This is a bug, but it occurs because you probably have some kind of ebean 
configuration error.

"ebean-enhance" mojo searches for class files in nonexistent directory.

You are calling it when the directory does not exist yet or you have it 
misconfigured somehow.

1.0.0-alpha6 handles this case differently, catching such errors silently 
(https://play2-maven-plugin.googlecode.com/svn/mavensite/1.0.0-alpha6/play2-prov
iders/play2-provider-play22/xref/com/google/code/play2/provider/play22/Play22Ebe
anEnhancer.html#L65). I changed implementation in 1.0.0-alpha7 for some reasons 
(including not catching all throwables without any action) and I didn't handle 
all cases properly.

To find how to fix it in your case I need to know why "ebean-enhance" mojo 
searches for classes to enhance in nonexistent directory.

Can you attach log file from Maven execution with "-X" flag? 
What's your "ebean.default" setting value in "conf/application.conf" file?
Is it proper, do such files exist in your project?

Original comment by gslowiko...@gmail.com on 11 Jun 2014 at 6:34

GoogleCodeExporter commented 9 years ago
https://code.google.com/p/play2-maven-plugin/source/detail?r=667 - issue fixed

1.0.0-alpha8-SNAPSHOT snapshot deployed. Can you try? Read "Using plugin 
SNAPSHOT versions" section in [Usage Usage] wiki page.

I'm still waiting for more details about your configuration.

Original comment by gslowiko...@gmail.com on 12 Jun 2014 at 1:29

GoogleCodeExporter commented 9 years ago

Original comment by gslowiko...@gmail.com on 12 Jun 2014 at 1:30

GoogleCodeExporter commented 9 years ago
I am facing the same issue and I am attaching my log. Please solve this issue , 
Also if you need any further information tell me.

Original comment by coolbhus...@gmail.com on 7 Aug 2014 at 2:01

Attachments:

GoogleCodeExporter commented 9 years ago
Well for me its issue with play ebean configuration. I am using two databases 
and created two ebean servers. so i just commented the second server and it 
worked. I am working now to provide second server by dynamically. Please look 
into this issue. If you need any further information please ask me.

Thanks 
Bhushan

Original comment by coolbhus...@gmail.com on 7 Aug 2014 at 3:58

GoogleCodeExporter commented 9 years ago
Try to use 1.0.0-alpha8-SNAPSHOT version of the plugin. Read "Using plugin 
SNAPSHOT versions" section in "Usage" wiki page.

Original comment by gslowiko...@gmail.com on 7 Aug 2014 at 9:01

GoogleCodeExporter commented 9 years ago
Version 1.0.0-alpha8 released.

Original comment by gslowiko...@gmail.com on 25 Aug 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Thank you very much

Original comment by coolbhus...@gmail.com on 27 Aug 2014 at 7:13

GoogleCodeExporter commented 9 years ago
Does it work now?

Original comment by gslowiko...@gmail.com on 27 Aug 2014 at 8:09