You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jerome creignou <je...@gmail.com> on 2008/12/22 19:06:20 UTC
NPE in MapperUtil
Hello,
I'm trying to use file mappers inside a maven plugin with the
file-management shared project.
I've added a fileset definition in the plugin's configuration as follow :
<plugin>
<groupId>info.flex-mojos</groupId>
<artifactId>flex-compiler-mojo</artifactId>
<extensions>true</extensions>
<version>2.0M11-SNAPSHOT</version>
<configuration>
<includeSources>
<param>${basedir}/src</param>
</includeSources>
<targetPlayer>9.0.28</targetPlayer>
<fileset>
<directory>${basedir}/src</directory>
<includes>
<include>**/*.mxml</include>
</includes>
<mapper>
<type>flatten</type>
</mapper>
</fileset>
</configuration>
</plugin>
Unfortunately, I get a NPE while trying to retrieve my mapper :
java.lang.NullPointerException
at
org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
at
info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
at
info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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)
I've checked current trunk on shared/file-management, it seems that the
"initializeBuiltIns" call should initialize implementations but it does not.
I have enclosed a trivial patch which should fix this.
Am I missing something ? Is there a better way to handle mappers ?
Jerome.
Re: NPE in MapperUtil
Posted by jerome creignou <je...@gmail.com>.
Hi Petar,
I opened an issue in Jira : http://jira.codehaus.org/browse/MSHARED-92
I've also enclosed unit tests inside the patch.
Regards,
Jerome
2009/2/3 Petar Tahchiev <pa...@gmail.com>
> Hi Jerome,
>
> looks obvious to me.
>
> Can you open an issue in the JIRA with the patch attached?
>
> 2009/2/2 jerome creignou <je...@gmail.com>:
> >
> > Hi,
> >
> > I'm trying to use file mappers inside a maven plugin with the
> > file-management shared project.
> >
> > I've added a fileset definition in the plugin's configuration as follow :
> > <plugin>
> > <groupId>info.flex-mojos</groupId>
> > <artifactId>flex-compiler-mojo</artifactId>
> > <extensions>true</extensions>
> > <version>2.0M11-SNAPSHOT</version>
> > <configuration>
> > <includeSources>
> > <param>${basedir}/src</param>
> > </includeSources>
> > <fileset>
> > <directory>${basedir}/src</directory>
> > <includes>
> > <include>**/*.mxml</include>
> > </includes>
> > <mapper>
> > <type>flatten</type>
> > </mapper>
> > </fileset>
> > </configuration>
> > </plugin>
> >
> > Unfortunately, I get a NPE while trying to retrieve my mapper :
> >
> > java.lang.NullPointerException
> > at
> >
> org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
> > at
> >
> info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
> > at
> >
> info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
> > at
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> > 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)
> >
> > I've checked current trunk on shared/file-management, it seems that the
> > "initializeBuiltIns" call should initialize implementations but it does
> not.
> > I have enclosed a trivial patch which should fix this.
> >
> > Am I missing something ? Is there a better way to handle mappers ?
> >
> > Jerome.
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
> - - - - - - - -
> | Author @ Manning Publications.
> | Senior Solution Architect @ Unic
> | BGJUG-Bulgarian Java User Group Leader.
> | Apache Maven Developer.
> | Apache Jakarta PMC member.
> | Jakarta Cactus Lead Developer.
> | Blogger: http://weblogs.java.net/blog/paranoiabla/
> - - - - - - - -
> Public PGP Key at:
> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: NPE in MapperUtil
Posted by Petar Tahchiev <pa...@gmail.com>.
Hi Jerome,
looks obvious to me.
Can you open an issue in the JIRA with the patch attached?
2009/2/2 jerome creignou <je...@gmail.com>:
>
> Hi,
>
> I'm trying to use file mappers inside a maven plugin with the
> file-management shared project.
>
> I've added a fileset definition in the plugin's configuration as follow :
> <plugin>
> <groupId>info.flex-mojos</groupId>
> <artifactId>flex-compiler-mojo</artifactId>
> <extensions>true</extensions>
> <version>2.0M11-SNAPSHOT</version>
> <configuration>
> <includeSources>
> <param>${basedir}/src</param>
> </includeSources>
> <fileset>
> <directory>${basedir}/src</directory>
> <includes>
> <include>**/*.mxml</include>
> </includes>
> <mapper>
> <type>flatten</type>
> </mapper>
> </fileset>
> </configuration>
> </plugin>
>
> Unfortunately, I get a NPE while trying to retrieve my mapper :
>
> java.lang.NullPointerException
> at
> org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
> at
> info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
> at
> info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> 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)
>
> I've checked current trunk on shared/file-management, it seems that the
> "initializeBuiltIns" call should initialize implementations but it does not.
> I have enclosed a trivial patch which should fix this.
>
> Am I missing something ? Is there a better way to handle mappers ?
>
> Jerome.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
--
Regards, Petar!
Karlovo, Bulgaria.
- - - - - - - -
| Author @ Manning Publications.
| Senior Solution Architect @ Unic
| BGJUG-Bulgarian Java User Group Leader.
| Apache Maven Developer.
| Apache Jakarta PMC member.
| Jakarta Cactus Lead Developer.
| Blogger: http://weblogs.java.net/blog/paranoiabla/
- - - - - - - -
Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
NPE in MapperUtil
Posted by jerome creignou <je...@gmail.com>.
Hi,
I'm trying to use file mappers inside a maven plugin with the
file-management shared project.
I've added a fileset definition in the plugin's configuration as follow :
<plugin>
<groupId>info.flex-mojos</groupId>
<artifactId>flex-compiler-mojo</artifactId>
<extensions>true</extensions>
<version>2.0M11-SNAPSHOT</version>
<configuration>
<includeSources>
<param>${basedir}/src</param>
</includeSources>
<fileset>
<directory>${basedir}/src</directory>
<includes>
<include>**/*.mxml</include>
</includes>
<mapper>
<type>flatten</type>
</mapper>
</fileset>
</configuration>
</plugin>
Unfortunately, I get a NPE while trying to retrieve my mapper :
java.lang.NullPointerException
at
org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
at
info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
at
info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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)
I've checked current trunk on shared/file-management, it seems that the
"initializeBuiltIns" call should initialize implementations but it does not.
I have enclosed a trivial patch which should fix this.
Am I missing something ? Is there a better way to handle mappers ?
Jerome.