Monday, June 04, 2007

NullPointerException in the Israfil Mojo?

If you experience a NullPointerException when you try to compile flex2 sources with the Israfil maven mojo, it is most likely due to either setting the flexHome property wrongly or simply forgetting to set it. Make this mistake (as I just did) and you will get these complaints:

[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building flash-lesson3
[INFO] task-segment: [install]
[INFO] ----------------------------------------------------------------------------
[INFO] [flex2:compile-swf]
[INFO] Compiling Flex 2 code
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
at net.israfil.mojo.flex2.AbstractFlexMojo.execute(AbstractFlexMojo.java:278)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Jun 04 21:10:21 CEST 2007
[INFO] Final Memory: 4M/9M
[INFO] ------------------------------------------------------------------------

No comments: