You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Rahul Thakur <ra...@xtra.co.nz> on 2006/01/02 22:31:51 UTC
Mapping complex object in Mojo Configuration
Hi,
I am following the mini guide to set up a complex mapping for a Mojo.
http://maven.apache.org/guides/mini/guide-configuring-plugins.html
The POJO that models the complex type for Mojo configuration has a field
'implementation' of type java.lang.Class.
When I run the Mojo, I get an error:
Cause: Cannot assign configuration entry 'implementation' to 'class
java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration', which is of
type class java.lang.String
The Plugin configuration for my Mojo is as follows:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>true</wait>
<configuration>
<implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
<dir>${project.build.directory}/tomcat5x/container</dir>
<type>standalone</type>
</configuration>
</configuration>
</plugin>
I am not sure what's wrong here?? I am reproducing the stacktrace below and
would appreciate any pointers.
Thanks in advance,
Rahul
<snip>
Cause: Cannot assign configuration entry 'implementation' to 'class
java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration', which is of
type class java.lang.String
[INFO] ----------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring:
org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to parse the created DOM
for plugin configuration
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
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:589)
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)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to parse the
created DOM for plugin configuration
at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:410)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
... 16 more
Caused by:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Cannot assign configuration entry 'implementation' to 'class java.lang.Class'
from 'com.effacy.sample.EffacyTomcatConfiguration', which is of type class
java.lang.String
at
org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression(AbstractConfigurationConverter.java:149)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:80)
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:207)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
at
org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
at
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1050)
... 19 more
</snip>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by Rinku <ra...@gmail.com>.
Hi Mark,
The problem is not with the multiple nested <configuration> tags. The inner
nested <configuration> tag rightly maps to a Configuration class in the Mojo,
the problem is with assigning one of the fields in the Configuration POJO of
type java.lang.Class which should pick value from 'implementation', it fails to
load the class.
Thanks for the note though!
Cheers,
Rahul
----- Original Message -----
From: "Mark Struberg" <st...@yahoo.de>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, January 03, 2006 11:45 PM
Subject: Re: Mapping complex object in Mojo Configuration
> Maybe it is a really complex problem, but
> maybe there is only a problem with the 2 nested
> <configuration> entries?
>
> <plugin>
> <groupId>org.codehaus.cargo</groupId>
> <artifactId>cargo-maven2-plugin</artifactId>
> --> <configuration>
> <wait>true</wait>
> --> <configuration>
>
> <implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
>
> <dir>${project.build.directory}/tomcat5x/container</dir>
> <type>standalone</type>
> </configuration>
> </configuration>
> </plugin>
>
> May u please check if it works when u change the 2nd
> <configuration> tag in <tomcatconf> for example?
>
> txs in advance and best regards,
> struberg
>
>
>> org.codehaus.cargo:cargo-maven2-plugin. Reason:
> Unable to parse the
>> created DOM for plugin configuration
>
>
> --- Brett Porter <br...@apache.org> schrieb:
>
>> Good point. It's probably looking in the plexus
>> classloader.
>>
>> I'd need to investigate further how to get the
>> correct classloader. If
>> you'd like to do so yourself, the class to change is
>>
> plexus/plexus-containers/plexus-container-default/src/main/java/org/codehaus/plexus/component/configurator/basic/ClassConverter.java
>>
>> Cheers,
>> Brett
>>
>> Rinku wrote:
>> > Hi ,
>> >
>> > I did relevant updates to m2 sources on local and
>> updated m2 install for
>> > plexus-container-default verison
>> 1.0-alpha-10-SNAPSHOT. But still
>> > running into a ClassNotFound error. Looks like its
>> coming from
>> > Classworld libs.
>> >
>> > I have posted the stacktrace at:
>> > http://www.rafb.net/paste/results/tke4hi45.html
>> >
>> > Could this be a Realm related issue with
>> Classworlds (sorry, not very
>> > well-versed with Classworlds). I am sure that
>> implementation class I am
>> > specifying is available via dependencies in
>> project's pom.xml. Am I
>> > missing something here or could this be a bug?
>> >
>> > Cheers for any help!
>> >
>> > Rahul
>> >
>> >
>> > ----- Original Message ----- From: "Brett Porter"
>> <br...@apache.org>
>> > To: "Maven Developers List" <de...@maven.apache.org>
>> > Sent: Tuesday, January 03, 2006 10:46 AM
>> > Subject: Re: Mapping complex object in Mojo
>> Configuration
>> >
>> >
>> >> There is no plexus converter for String -> Class.
>> We should probably
>> >> have one, so I'll add it now.
>> >>
>> >> You'll need to use a String and do the forName
>> yourself in the mean time.
>> >>
>> >> - Brett
>> >>
>> >> Rahul Thakur wrote:
>> >>> Hi,
>> >>>
>> >>> I am following the mini guide to set up a
>> complex mapping for a Mojo.
>> >>>
>>
> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
>> >>>
>> >>> The POJO that models the complex type for Mojo
>> configuration has a field
>> >>> 'implementation' of type java.lang.Class.
>> >>>
>> >>> When I run the Mojo, I get an error:
>> >>> Cause: Cannot assign configuration entry
>> 'implementation' to 'class
>> >>> java.lang.Class' from
>> 'com.effacy.sample.EffacyTomcatConfiguration',
>> >>> which is of type class java.lang.String
>> >>>
>> >>> The Plugin configuration for my Mojo is as
>> follows:
>> >>> <plugin>
>> >>> <groupId>org.codehaus.cargo</groupId>
>> >>>
>> <artifactId>cargo-maven2-plugin</artifactId>
>> >>> <configuration>
>> >>> <wait>true</wait>
>> >>> <configuration>
>> >>>
>> >>>
>>
> <implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
>> >>>
>> >>>
>> >>>
>>
> <dir>${project.build.directory}/tomcat5x/container</dir>
>> >>> <type>standalone</type>
>> >>> </configuration>
>> >>> </configuration>
>> >>> </plugin>
>> >>>
>> >>> I am not sure what's wrong here?? I am
>> reproducing the stacktrace below
>> >>> and would appreciate any pointers.
>> >>>
>> >>> Thanks in advance,
>> >>>
>> >>> Rahul
>> >>>
>> >>> <snip>
>> >>> Cause: Cannot assign configuration entry
>> 'implementation' to 'class
>> >>> java.lang.Class' from
>> 'com.effacy.sample.EffacyTomcatConfiguration',
>> >>> which is of type class java.lang.String
>> >>> [INFO]
>> >>>
>>
> ----------------------------------------------------------------------------
>> >>>
>> >>>
>> >>> [INFO] Trace
>> >>>
>>
> org.apache.maven.lifecycle.LifecycleExecutionException:
>> Error
>> >>> configuring:
>> org.codehaus.cargo:cargo-maven2-plugin. Reason:
>> Unable to
>> >>> parse the created DOM for plugin configuration
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>> >>>
>> >>>
>> >>> at
>>
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>> >>> at
>>
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>> >>> at
>>
> org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>> >>> 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:589)
>> >>> 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)
>> >>> Caused by:
>>
> org.apache.maven.plugin.PluginConfigurationException:
>> Error
>> >>> configuring:
>> org.codehaus.cargo:cargo-maven2-plugin. Reason:
>> Unable to
>> >>> parse the created DOM for plugin configuration
>> >>> at
>> >>>
>>
> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
>> >>>
>> >>>
>> >>> at
>> >>>
>>
> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
>> >>>
>> >>>
>> >>> at
>>
> === message truncated ===
>
>
>
>
>
>
>
> ___________________________________________________________
> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by Mark Struberg <st...@yahoo.de>.
Maybe it is a really complex problem, but
maybe there is only a problem with the 2 nested
<configuration> entries?
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
--> <configuration>
<wait>true</wait>
--> <configuration>
<implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
<dir>${project.build.directory}/tomcat5x/container</dir>
<type>standalone</type>
</configuration>
</configuration>
</plugin>
May u please check if it works when u change the 2nd
<configuration> tag in <tomcatconf> for example?
txs in advance and best regards,
struberg
> org.codehaus.cargo:cargo-maven2-plugin. Reason:
Unable to parse the
> created DOM for plugin configuration
--- Brett Porter <br...@apache.org> schrieb:
> Good point. It's probably looking in the plexus
> classloader.
>
> I'd need to investigate further how to get the
> correct classloader. If
> you'd like to do so yourself, the class to change is
>
plexus/plexus-containers/plexus-container-default/src/main/java/org/codehaus/plexus/component/configurator/basic/ClassConverter.java
>
> Cheers,
> Brett
>
> Rinku wrote:
> > Hi ,
> >
> > I did relevant updates to m2 sources on local and
> updated m2 install for
> > plexus-container-default verison
> 1.0-alpha-10-SNAPSHOT. But still
> > running into a ClassNotFound error. Looks like its
> coming from
> > Classworld libs.
> >
> > I have posted the stacktrace at:
> > http://www.rafb.net/paste/results/tke4hi45.html
> >
> > Could this be a Realm related issue with
> Classworlds (sorry, not very
> > well-versed with Classworlds). I am sure that
> implementation class I am
> > specifying is available via dependencies in
> project's pom.xml. Am I
> > missing something here or could this be a bug?
> >
> > Cheers for any help!
> >
> > Rahul
> >
> >
> > ----- Original Message ----- From: "Brett Porter"
> <br...@apache.org>
> > To: "Maven Developers List" <de...@maven.apache.org>
> > Sent: Tuesday, January 03, 2006 10:46 AM
> > Subject: Re: Mapping complex object in Mojo
> Configuration
> >
> >
> >> There is no plexus converter for String -> Class.
> We should probably
> >> have one, so I'll add it now.
> >>
> >> You'll need to use a String and do the forName
> yourself in the mean time.
> >>
> >> - Brett
> >>
> >> Rahul Thakur wrote:
> >>> Hi,
> >>>
> >>> I am following the mini guide to set up a
> complex mapping for a Mojo.
> >>>
>
http://maven.apache.org/guides/mini/guide-configuring-plugins.html
> >>>
> >>> The POJO that models the complex type for Mojo
> configuration has a field
> >>> 'implementation' of type java.lang.Class.
> >>>
> >>> When I run the Mojo, I get an error:
> >>> Cause: Cannot assign configuration entry
> 'implementation' to 'class
> >>> java.lang.Class' from
> 'com.effacy.sample.EffacyTomcatConfiguration',
> >>> which is of type class java.lang.String
> >>>
> >>> The Plugin configuration for my Mojo is as
> follows:
> >>> <plugin>
> >>> <groupId>org.codehaus.cargo</groupId>
> >>>
> <artifactId>cargo-maven2-plugin</artifactId>
> >>> <configuration>
> >>> <wait>true</wait>
> >>> <configuration>
> >>>
> >>>
>
<implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
> >>>
> >>>
> >>>
>
<dir>${project.build.directory}/tomcat5x/container</dir>
> >>> <type>standalone</type>
> >>> </configuration>
> >>> </configuration>
> >>> </plugin>
> >>>
> >>> I am not sure what's wrong here?? I am
> reproducing the stacktrace below
> >>> and would appreciate any pointers.
> >>>
> >>> Thanks in advance,
> >>>
> >>> Rahul
> >>>
> >>> <snip>
> >>> Cause: Cannot assign configuration entry
> 'implementation' to 'class
> >>> java.lang.Class' from
> 'com.effacy.sample.EffacyTomcatConfiguration',
> >>> which is of type class java.lang.String
> >>> [INFO]
> >>>
>
----------------------------------------------------------------------------
> >>>
> >>>
> >>> [INFO] Trace
> >>>
>
org.apache.maven.lifecycle.LifecycleExecutionException:
> Error
> >>> configuring:
> org.codehaus.cargo:cargo-maven2-plugin. Reason:
> Unable to
> >>> parse the created DOM for plugin configuration
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> >>>
> >>>
> >>> at
>
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
> >>> at
>
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> >>> at
>
org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> >>> 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:589)
> >>> 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)
> >>> Caused by:
>
org.apache.maven.plugin.PluginConfigurationException:
> Error
> >>> configuring:
> org.codehaus.cargo:cargo-maven2-plugin. Reason:
> Unable to
> >>> parse the created DOM for plugin configuration
> >>> at
> >>>
>
org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
> >>>
> >>>
> >>> at
> >>>
>
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
> >>>
> >>>
> >>> at
>
=== message truncated ===
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by Brett Porter <br...@apache.org>.
Good point. It's probably looking in the plexus classloader.
I'd need to investigate further how to get the correct classloader. If
you'd like to do so yourself, the class to change is
plexus/plexus-containers/plexus-container-default/src/main/java/org/codehaus/plexus/component/configurator/basic/ClassConverter.java
Cheers,
Brett
Rinku wrote:
> Hi ,
>
> I did relevant updates to m2 sources on local and updated m2 install for
> plexus-container-default verison 1.0-alpha-10-SNAPSHOT. But still
> running into a ClassNotFound error. Looks like its coming from
> Classworld libs.
>
> I have posted the stacktrace at:
> http://www.rafb.net/paste/results/tke4hi45.html
>
> Could this be a Realm related issue with Classworlds (sorry, not very
> well-versed with Classworlds). I am sure that implementation class I am
> specifying is available via dependencies in project's pom.xml. Am I
> missing something here or could this be a bug?
>
> Cheers for any help!
>
> Rahul
>
>
> ----- Original Message ----- From: "Brett Porter" <br...@apache.org>
> To: "Maven Developers List" <de...@maven.apache.org>
> Sent: Tuesday, January 03, 2006 10:46 AM
> Subject: Re: Mapping complex object in Mojo Configuration
>
>
>> There is no plexus converter for String -> Class. We should probably
>> have one, so I'll add it now.
>>
>> You'll need to use a String and do the forName yourself in the mean time.
>>
>> - Brett
>>
>> Rahul Thakur wrote:
>>> Hi,
>>>
>>> I am following the mini guide to set up a complex mapping for a Mojo.
>>> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
>>>
>>> The POJO that models the complex type for Mojo configuration has a field
>>> 'implementation' of type java.lang.Class.
>>>
>>> When I run the Mojo, I get an error:
>>> Cause: Cannot assign configuration entry 'implementation' to 'class
>>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>>> which is of type class java.lang.String
>>>
>>> The Plugin configuration for my Mojo is as follows:
>>> <plugin>
>>> <groupId>org.codehaus.cargo</groupId>
>>> <artifactId>cargo-maven2-plugin</artifactId>
>>> <configuration>
>>> <wait>true</wait>
>>> <configuration>
>>>
>>> <implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
>>>
>>>
>>> <dir>${project.build.directory}/tomcat5x/container</dir>
>>> <type>standalone</type>
>>> </configuration>
>>> </configuration>
>>> </plugin>
>>>
>>> I am not sure what's wrong here?? I am reproducing the stacktrace below
>>> and would appreciate any pointers.
>>>
>>> Thanks in advance,
>>>
>>> Rahul
>>>
>>> <snip>
>>> Cause: Cannot assign configuration entry 'implementation' to 'class
>>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>>> which is of type class java.lang.String
>>> [INFO]
>>> ----------------------------------------------------------------------------
>>>
>>>
>>> [INFO] Trace
>>> org.apache.maven.lifecycle.LifecycleExecutionException: Error
>>> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
>>> parse the created DOM for plugin configuration
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>>>
>>>
>>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>>> 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:589)
>>> 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)
>>> Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
>>> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
>>> parse the created DOM for plugin configuration
>>> at
>>> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
>>>
>>>
>>> at
>>> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
>>>
>>>
>>> at
>>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:410)
>>>
>>>
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
>>>
>>>
>>> ... 16 more
>>> Caused by:
>>> org.codehaus.plexus.component.configurator.ComponentConfigurationException:
>>>
>>> Cannot assign configuration entry 'implementation' to 'class
>>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>>> which is of type class java.lang.String
>>> at
>>> org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression(AbstractConfigurationConverter.java:149)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:80)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:207)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>>>
>>>
>>> at
>>> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
>>>
>>>
>>> at
>>> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1050)
>>>
>>>
>>> ... 19 more
>>> </snip>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by Rinku <ra...@gmail.com>.
Hi Dan,
I believe this is slightly different - I am trying to set a field for a complex
type ( the field is of type 'java.lang.Class'). The complex type itself gets
instantiated fine but the issue comes when attempting to setup the field. Brett
drilled down the issue to be missing convertor impl (String -> Class) in plexus
container, and now it seems to a related to ClassLoader.
But even in case of what you are referring to you should be able to specify an
'implementation' attribute for your complex type and specify the implementing
class from a different package.
Cheers,
Rahul
----- Original Message -----
From: "dan tran" <da...@gmail.com>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, January 03, 2006 12:59 PM
Subject: Re: Mapping complex object in Mojo Configuration
I think i ran to this before. The configuraiton object must be in the same
packge of your mojo.
Not sure if this helps thou.
-Dan
On 1/2/06, Rinku <ra...@gmail.com> wrote:
>
> Hi ,
>
> I did relevant updates to m2 sources on local and updated m2 install for
> plexus-container-default verison 1.0-alpha-10-SNAPSHOT. But still running
> into a
> ClassNotFound error. Looks like its coming from Classworld libs.
>
> I have posted the stacktrace at:
> http://www.rafb.net/paste/results/tke4hi45.html
>
> Could this be a Realm related issue with Classworlds (sorry, not very
> well-versed with Classworlds). I am sure that implementation class I am
> specifying is available via dependencies in project's pom.xml. Am I
> missing
> something here or could this be a bug?
>
> Cheers for any help!
>
> Rahul
>
>
> ----- Original Message -----
> From: "Brett Porter" <br...@apache.org>
> To: "Maven Developers List" <de...@maven.apache.org>
> Sent: Tuesday, January 03, 2006 10:46 AM
> Subject: Re: Mapping complex object in Mojo Configuration
>
>
> > There is no plexus converter for String -> Class. We should probably
> > have one, so I'll add it now.
> >
> > You'll need to use a String and do the forName yourself in the mean
> time.
> >
> > - Brett
> >
> > Rahul Thakur wrote:
> >> Hi,
> >>
> >> I am following the mini guide to set up a complex mapping for a Mojo.
> >> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
> >>
> >> The POJO that models the complex type for Mojo configuration has a
> field
> >> 'implementation' of type java.lang.Class.
> >>
> >> When I run the Mojo, I get an error:
> >> Cause: Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >>
> >> The Plugin configuration for my Mojo is as follows:
> >> <plugin>
> >> <groupId>org.codehaus.cargo</groupId>
> >> <artifactId>cargo-maven2-plugin</artifactId>
> >> <configuration>
> >> <wait>true</wait>
> >> <configuration>
> >>
> >> <implementation>com.effacy.sample.EffacyTomcatConfiguration
> </implementation>
> >>
> >> <dir>${project.build.directory}/tomcat5x/container</dir>
> >> <type>standalone</type>
> >> </configuration>
> >> </configuration>
> >> </plugin>
> >>
> >> I am not sure what's wrong here?? I am reproducing the stacktrace below
> >> and would appreciate any pointers.
> >>
> >> Thanks in advance,
> >>
> >> Rahul
> >>
> >> <snip>
> >> Cause: Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >> [INFO]
> >>
> ----------------------------------------------------------------------------
> >>
> >> [INFO] Trace
> >> org.apache.maven.lifecycle.LifecycleExecutionException: Error
> >> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> >> parse the created DOM for plugin configuration
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:559)
> >>
> >> at
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
> DefaultLifecycleExecutor.java:485)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:455)
> >>
> >> at
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:303)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
> (DefaultLifecycleExecutor.java:270)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:139)
> >>
> >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
> :322)
> >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> >> 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:589)
> >> 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)
> >> Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
> >> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> >> parse the created DOM for plugin configuration
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(
> DefaultPluginManager.java:1056)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(
> DefaultPluginManager.java:596)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:410)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:530)
> >>
> >> ... 16 more
> >> Caused by:
> >>
> org.codehaus.plexus.component.configurator.ComponentConfigurationException
> :
> >> Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression
> (AbstractConfigurationConverter.java:149)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration
> (ObjectWithFieldsConverter.java:80)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure
> (ComponentValueSetter.java:207)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
> (ObjectWithFieldsConverter.java:137)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration
> (ObjectWithFieldsConverter.java:90)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure
> (ComponentValueSetter.java:247)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
> (ObjectWithFieldsConverter.java:137)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent
> (BasicComponentConfigurator.java:56)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(
> DefaultPluginManager.java:1050)
> >>
> >> ... 19 more
> >> </snip>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by dan tran <da...@gmail.com>.
I think i ran to this before. The configuraiton object must be in the same
packge of your mojo.
Not sure if this helps thou.
-Dan
On 1/2/06, Rinku <ra...@gmail.com> wrote:
>
> Hi ,
>
> I did relevant updates to m2 sources on local and updated m2 install for
> plexus-container-default verison 1.0-alpha-10-SNAPSHOT. But still running
> into a
> ClassNotFound error. Looks like its coming from Classworld libs.
>
> I have posted the stacktrace at:
> http://www.rafb.net/paste/results/tke4hi45.html
>
> Could this be a Realm related issue with Classworlds (sorry, not very
> well-versed with Classworlds). I am sure that implementation class I am
> specifying is available via dependencies in project's pom.xml. Am I
> missing
> something here or could this be a bug?
>
> Cheers for any help!
>
> Rahul
>
>
> ----- Original Message -----
> From: "Brett Porter" <br...@apache.org>
> To: "Maven Developers List" <de...@maven.apache.org>
> Sent: Tuesday, January 03, 2006 10:46 AM
> Subject: Re: Mapping complex object in Mojo Configuration
>
>
> > There is no plexus converter for String -> Class. We should probably
> > have one, so I'll add it now.
> >
> > You'll need to use a String and do the forName yourself in the mean
> time.
> >
> > - Brett
> >
> > Rahul Thakur wrote:
> >> Hi,
> >>
> >> I am following the mini guide to set up a complex mapping for a Mojo.
> >> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
> >>
> >> The POJO that models the complex type for Mojo configuration has a
> field
> >> 'implementation' of type java.lang.Class.
> >>
> >> When I run the Mojo, I get an error:
> >> Cause: Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >>
> >> The Plugin configuration for my Mojo is as follows:
> >> <plugin>
> >> <groupId>org.codehaus.cargo</groupId>
> >> <artifactId>cargo-maven2-plugin</artifactId>
> >> <configuration>
> >> <wait>true</wait>
> >> <configuration>
> >>
> >> <implementation>com.effacy.sample.EffacyTomcatConfiguration
> </implementation>
> >>
> >> <dir>${project.build.directory}/tomcat5x/container</dir>
> >> <type>standalone</type>
> >> </configuration>
> >> </configuration>
> >> </plugin>
> >>
> >> I am not sure what's wrong here?? I am reproducing the stacktrace below
> >> and would appreciate any pointers.
> >>
> >> Thanks in advance,
> >>
> >> Rahul
> >>
> >> <snip>
> >> Cause: Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >> [INFO]
> >>
> ----------------------------------------------------------------------------
> >>
> >> [INFO] Trace
> >> org.apache.maven.lifecycle.LifecycleExecutionException: Error
> >> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> >> parse the created DOM for plugin configuration
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:559)
> >>
> >> at
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
> DefaultLifecycleExecutor.java:485)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:455)
> >>
> >> at
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:303)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
> (DefaultLifecycleExecutor.java:270)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:139)
> >>
> >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
> :322)
> >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> >> 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:589)
> >> 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)
> >> Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
> >> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> >> parse the created DOM for plugin configuration
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(
> DefaultPluginManager.java:1056)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(
> DefaultPluginManager.java:596)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:410)
> >>
> >> at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:530)
> >>
> >> ... 16 more
> >> Caused by:
> >>
> org.codehaus.plexus.component.configurator.ComponentConfigurationException
> :
> >> Cannot assign configuration entry 'implementation' to 'class
> >> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> >> which is of type class java.lang.String
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression
> (AbstractConfigurationConverter.java:149)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration
> (ObjectWithFieldsConverter.java:80)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure
> (ComponentValueSetter.java:207)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
> (ObjectWithFieldsConverter.java:137)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration
> (ObjectWithFieldsConverter.java:90)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure
> (ComponentValueSetter.java:247)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration
> (ObjectWithFieldsConverter.java:137)
> >>
> >> at
> >>
> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent
> (BasicComponentConfigurator.java:56)
> >>
> >> at
> >> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(
> DefaultPluginManager.java:1050)
> >>
> >> ... 19 more
> >> </snip>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Mapping complex object in Mojo Configuration
Posted by Rinku <ra...@gmail.com>.
Hi ,
I did relevant updates to m2 sources on local and updated m2 install for
plexus-container-default verison 1.0-alpha-10-SNAPSHOT. But still running into a
ClassNotFound error. Looks like its coming from Classworld libs.
I have posted the stacktrace at:
http://www.rafb.net/paste/results/tke4hi45.html
Could this be a Realm related issue with Classworlds (sorry, not very
well-versed with Classworlds). I am sure that implementation class I am
specifying is available via dependencies in project's pom.xml. Am I missing
something here or could this be a bug?
Cheers for any help!
Rahul
----- Original Message -----
From: "Brett Porter" <br...@apache.org>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, January 03, 2006 10:46 AM
Subject: Re: Mapping complex object in Mojo Configuration
> There is no plexus converter for String -> Class. We should probably
> have one, so I'll add it now.
>
> You'll need to use a String and do the forName yourself in the mean time.
>
> - Brett
>
> Rahul Thakur wrote:
>> Hi,
>>
>> I am following the mini guide to set up a complex mapping for a Mojo.
>> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
>>
>> The POJO that models the complex type for Mojo configuration has a field
>> 'implementation' of type java.lang.Class.
>>
>> When I run the Mojo, I get an error:
>> Cause: Cannot assign configuration entry 'implementation' to 'class
>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>> which is of type class java.lang.String
>>
>> The Plugin configuration for my Mojo is as follows:
>> <plugin>
>> <groupId>org.codehaus.cargo</groupId>
>> <artifactId>cargo-maven2-plugin</artifactId>
>> <configuration>
>> <wait>true</wait>
>> <configuration>
>>
>> <implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
>>
>> <dir>${project.build.directory}/tomcat5x/container</dir>
>> <type>standalone</type>
>> </configuration>
>> </configuration>
>> </plugin>
>>
>> I am not sure what's wrong here?? I am reproducing the stacktrace below
>> and would appreciate any pointers.
>>
>> Thanks in advance,
>>
>> Rahul
>>
>> <snip>
>> Cause: Cannot assign configuration entry 'implementation' to 'class
>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>> which is of type class java.lang.String
>> [INFO]
>> ----------------------------------------------------------------------------
>>
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Error
>> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
>> parse the created DOM for plugin configuration
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>>
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>> 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:589)
>> 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)
>> Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
>> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
>> parse the created DOM for plugin configuration
>> at
>> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
>>
>> at
>> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
>>
>> at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:410)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
>>
>> ... 16 more
>> Caused by:
>> org.codehaus.plexus.component.configurator.ComponentConfigurationException:
>> Cannot assign configuration entry 'implementation' to 'class
>> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
>> which is of type class java.lang.String
>> at
>> org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression(AbstractConfigurationConverter.java:149)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:80)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:207)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
>>
>> at
>> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>>
>> at
>> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
>>
>> at
>> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1050)
>>
>> ... 19 more
>> </snip>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Mapping complex object in Mojo Configuration
Posted by Brett Porter <br...@apache.org>.
There is no plexus converter for String -> Class. We should probably
have one, so I'll add it now.
You'll need to use a String and do the forName yourself in the mean time.
- Brett
Rahul Thakur wrote:
> Hi,
>
> I am following the mini guide to set up a complex mapping for a Mojo.
> http://maven.apache.org/guides/mini/guide-configuring-plugins.html
>
> The POJO that models the complex type for Mojo configuration has a field
> 'implementation' of type java.lang.Class.
>
> When I run the Mojo, I get an error:
> Cause: Cannot assign configuration entry 'implementation' to 'class
> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> which is of type class java.lang.String
>
> The Plugin configuration for my Mojo is as follows:
> <plugin>
> <groupId>org.codehaus.cargo</groupId>
> <artifactId>cargo-maven2-plugin</artifactId>
> <configuration>
> <wait>true</wait>
> <configuration>
>
> <implementation>com.effacy.sample.EffacyTomcatConfiguration</implementation>
>
> <dir>${project.build.directory}/tomcat5x/container</dir>
> <type>standalone</type>
> </configuration>
> </configuration>
> </plugin>
>
> I am not sure what's wrong here?? I am reproducing the stacktrace below
> and would appreciate any pointers.
>
> Thanks in advance,
>
> Rahul
>
> <snip>
> Cause: Cannot assign configuration entry 'implementation' to 'class
> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> which is of type class java.lang.String
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error
> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> parse the created DOM for plugin configuration
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> 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:589)
> 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)
> Caused by: org.apache.maven.plugin.PluginConfigurationException: Error
> configuring: org.codehaus.cargo:cargo-maven2-plugin. Reason: Unable to
> parse the created DOM for plugin configuration
> at
> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1056)
>
> at
> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:596)
>
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:410)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
>
> ... 16 more
> Caused by:
> org.codehaus.plexus.component.configurator.ComponentConfigurationException:
> Cannot assign configuration entry 'implementation' to 'class
> java.lang.Class' from 'com.effacy.sample.EffacyTomcatConfiguration',
> which is of type class java.lang.String
> at
> org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.fromExpression(AbstractConfigurationConverter.java:149)
>
> at
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:80)
>
> at
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:207)
>
> at
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>
> at
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:90)
>
> at
> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
>
> at
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
>
> at
> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
>
> at
> org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1050)
>
> ... 19 more
> </snip>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org