You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Graham Leggett <mi...@sharp.fm> on 2006/07/06 18:38:49 UTC

confusion: maven-ear-plugin and NoClassDefFoundError

Hi all,

I have a maven2 ear project that depends on a maven2 ejb project. When I
used maven1, the ear plugin made sure the application.xml file was built
correctly, and everything was done for you.

This doesn't work with maven2, I get the following error:

18:08:13,632 WARN  [EJBDeployer] Verify failed; continuing
java.lang.NoClassDefFoundError: [Lalchemy/trader/workbench/TraderProject;

The class "alchemy/trader/workbench/TraderProject" exists inside the EJB
jar, and is definitely not missing.

Reading the docs for the ear:ear goal doesn't specify any minumum required
configuration for the ear plugin to work.

Reading "Better builds with maven" it suggests that each jar and ejb file
needs to be explicitly defined within the <plugin> tag for
maven-ear-plugin, over and above the dependancy mechanism.

This seems to be against the spirit of maven, which is to do stuff for the
developer.

I am now confused.

Can anyone point at any docs that explain clearly and concisely what needs
to be done to build an ear file?

Regards,
Graham
--



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: confusion: maven-ear-plugin and NoClassDefFoundError

Posted by Graham Leggett <mi...@sharp.fm>.
Stephane Nicoll wrote:

>> Reading the docs for the ear:ear goal doesn't specify any minumum 
>> required
>> configuration for the ear plugin to work.
> 
> The doc is up-to-date, provided that your pom.xml has a dependency on
> the ejb (either by explicitelty declaring it or by getting it through
> transitive dependencies) is enough. You can just check that by
> yourself and see that your ejb module is bundled in the EAR file and
> defined in the application.xml correctly (?!)

The docs need to explicitly state "to generate an ear file, make sure 
the components of the ear file are listed as dependencies, and run 
ear:ear". Again, the docs assume a priori knowledge from the user that 
this is the case.

I know from experience with maven 1 that ear:ear required no external 
config over and above dependencies, but no corresponding statement was 
present in the maven 2 docs.

>> Reading "Better builds with maven" it suggests that each jar and ejb file
>> needs to be explicitly defined within the <plugin> tag for
>> maven-ear-plugin, over and above the dependancy mechanism.
> 
> Read this section again. The book does not suggest that at all. If you
> want to *customize* the way the EAR plugin works, just configure the
> modules within the configuration/modules element of your plugin's
> config (see the doc again for pom samples)

This is the impression I got from reading the book. Because it didn't 
explicitly state "at a minimum, dependancies need to be set, and the 
ear:ear goal, and you should have a working ear file", when the ear:ear 
plugin didn't produce a working ear file, the logical assumption was 
that a configuration step had been missed. Again, the docs assumed a 
priori knowledge from the reader.

> I would suggest to read the doc again and if does not help,
> investigate why JBoss does not find your class. IMO it has nothing to
> do with the EAR and/or maven

Now that the docs have been clarified, it seems that I have configured 
maven correctly (set dependencies, run ear:ear).

Lots of Googling shows the error I was getting was caused by an 
incorrect classpath inside the manifest file. The manifest file is 
generated by maven. Therefore, all evidence suggests the problem is with 
maven.

Regards,
Graham
--

Re: confusion: maven-ear-plugin and NoClassDefFoundError

Posted by Stephane Nicoll <st...@gmail.com>.
Hi,

On 7/6/06, Graham Leggett <mi...@sharp.fm> wrote:

> Reading the docs for the ear:ear goal doesn't specify any minumum required
> configuration for the ear plugin to work.

The doc is up-to-date, provided that your pom.xml has a dependency on
the ejb (either by explicitelty declaring it or by getting it through
transitive dependencies) is enough. You can just check that by
yourself and see that your ejb module is bundled in the EAR file and
defined in the application.xml correctly (?!)

>
> Reading "Better builds with maven" it suggests that each jar and ejb file
> needs to be explicitly defined within the <plugin> tag for
> maven-ear-plugin, over and above the dependancy mechanism.

Read this section again. The book does not suggest that at all. If you
want to *customize* the way the EAR plugin works, just configure the
modules within the configuration/modules element of your plugin's
config (see the doc again for pom samples)

> Can anyone point at any docs that explain clearly and concisely what needs
> to be done to build an ear file?

I would suggest to read the doc again and if does not help,
investigate why JBoss does not find your class. IMO it has nothing to
do with the EAR and/or maven

Cheers,
Stéphane

>
> Regards,
> Graham
> --
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
.::You're welcome ::.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org