You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Tim Davidson <tr...@gmail.com> on 2007/01/29 17:57:28 UTC

EAR fails to deploy library JARs

I am a newbie to Geronimo, I have an EAR file which I have
successfully managed to deploy to JBoss and Glassfish, I am now trying
to deploy it to Geronimo however when it deploys it fails saying
Deployment failed:

-----------------
Module was not an application client: dom4j.jar
org.apache.geronimo.common.DeploymentException: Module was not an
application client: dom4j.jar
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules(EARConfigBuilder.java:771)
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan(EARConfigBuilder.java:362)
-----------------

my application.xml is as follows:
-----------------
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
              version="1.4">
        <display-name>MyProject</display-name>
        <module>
                <web>
                        <web-uri>MyProject.war</web-uri>
                        <context-root>/MyProject</context-root>
                </web>
        </module>
        <module>
                <java>dom4j.jar</java>
        </module>
.....
-----------------

whatever jar file I reference in the <java> element it says the same
thing, the contents of my EAR file are as follows:

EAR

   - META-INF/MANIFEST.MF
   - META-INF/application.xml
   - dom4j.jar
   - MyProject.war

dom4j.jar is a third party library required for my application, why am
I getting this error? I have debugged this and it appears that if the
<module> is type <java> then AppClientModuleBuilder is used and this
requires the jar to contain an application-client.xml, otherwise it
will fail, is this a bug or how are you supposed to specify library
jars contained with an EAR?

many thanks

Tim.

Re: EAR fails to deploy library JARs

Posted by Don Hill <ju...@gmail.com>.
In JBOSS the dom4j.jar in in the $JBOSS_HOME/server/x/lib so if you removed
the dom4j from the ear I believe it would still work in JBOSS, I would
probably add it to the META-INF/MANIFEST.MF of the application for example

EAR

   - META-INF/MANIFEST.MF
   - META-INF/application.xml
   - dom4j.jar
   - MyProject.war/META-INF/MANIFEST.MF

            Manifest-Version: 1.0
            Class-Path: dom4j.jar




On 1/29/07, Tim Davidson <tr...@gmail.com> wrote:
>
> I am a newbie to Geronimo, I have an EAR file which I have
> successfully managed to deploy to JBoss and Glassfish, I am now trying
> to deploy it to Geronimo however when it deploys it fails saying
> Deployment failed:
>
> -----------------
> Module was not an application client: dom4j.jar
> org.apache.geronimo.common.DeploymentException: Module was not an
> application client: dom4j.jar
>         at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules
> (EARConfigBuilder.java:771)
>         at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan
> (EARConfigBuilder.java:362)
> -----------------
>
> my application.xml is as follows:
> -----------------
> <?xml version="1.0" encoding="UTF-8"?>
> <application xmlns="http://java.sun.com/xml/ns/j2ee"
>               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
>               version="1.4">
>         <display-name>MyProject</display-name>
>         <module>
>                 <web>
>                         <web-uri>MyProject.war</web-uri>
>                         <context-root>/MyProject</context-root>
>                 </web>
>         </module>
>         <module>
>                 <java>dom4j.jar</java>
>         </module>
> .....
> -----------------
>
> whatever jar file I reference in the <java> element it says the same
> thing, the contents of my EAR file are as follows:
>
> EAR
>
>    - META-INF/MANIFEST.MF
>    - META-INF/application.xml
>    - dom4j.jar
>    - MyProject.war
>
> dom4j.jar is a third party library required for my application, why am
> I getting this error? I have debugged this and it appears that if the
> <module> is type <java> then AppClientModuleBuilder is used and this
> requires the jar to contain an application-client.xml, otherwise it
> will fail, is this a bug or how are you supposed to specify library
> jars contained with an EAR?
>
> many thanks
>
> Tim.
>

Re: EAR fails to deploy library JARs

Posted by Tim Davidson <tr...@gmail.com>.
I haved removed references from application.xml to my third party
libraries (struts, spring dom4j etc) and placed them in a list in the
Class-Path attribute in manifest of the WAR. This has fixed the
problem thanks! It would appear GlassFish and JBoss are not as strict
with regard to the spec in this respect and allow any JAR files to be
added to application.xml and in turn add them to the classpath. Unlike
Geronimo they do not require you to specify an application-client.xml
file either so in my migration I will have to create these for my
application clients.

I found this which explined the spec:
http://java.sun.com/j2ee/verified/packaging.html

Thanks again.

On 29/01/07, David Jencks <da...@yahoo.com> wrote:
> Your application.xml is claiming that dom4j.jar is an application
> client jar.  However from the name and your email subject I'd suspect
> that it's the normal dom4j jar that you'd like to get in the
> classloader of your application.  To do this in a portable way you
> need to (in j2ee 1.4) include the jar in the manifest classpath of
> the module(s) that you intend to use it in, presumably the
> MyProject.war.  (In javaee5 there's a lib directory in an ear).
> There's also a geronimo specific way to do this by putting the
> library jar directly in the geronimo repository and listing it as a
> dependency in a geronimo plan for your app.
>
> I have no explanation for why the other servers let you deploy with
> this application.xml: with the new annotation stuff in javaee5
> perhaps they don't check whether its a plausible application client
> until you try to use it?
>
> thanks
> david jencks
>
> On Jan 29, 2007, at 8:57 AM, Tim Davidson wrote:
>
> > I am a newbie to Geronimo, I have an EAR file which I have
> > successfully managed to deploy to JBoss and Glassfish, I am now trying
> > to deploy it to Geronimo however when it deploys it fails saying
> > Deployment failed:
> >
> > -----------------
> > Module was not an application client: dom4j.jar
> > org.apache.geronimo.common.DeploymentException: Module was not an
> > application client: dom4j.jar
> >        at
> > org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules
> > (EARConfigBuilder.java:771)
> >        at
> > org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan
> > (EARConfigBuilder.java:362)
> > -----------------
> >
> > my application.xml is as follows:
> > -----------------
> > <?xml version="1.0" encoding="UTF-8"?>
> > <application xmlns="http://java.sun.com/xml/ns/j2ee"
> >              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> >                http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
> >              version="1.4">
> >        <display-name>MyProject</display-name>
> >        <module>
> >                <web>
> >                        <web-uri>MyProject.war</web-uri>
> >                        <context-root>/MyProject</context-root>
> >                </web>
> >        </module>
> >        <module>
> >                <java>dom4j.jar</java>
> >        </module>
> > .....
> > -----------------
> >
> > whatever jar file I reference in the <java> element it says the same
> > thing, the contents of my EAR file are as follows:
> >
> > EAR
> >
> >   - META-INF/MANIFEST.MF
> >   - META-INF/application.xml
> >   - dom4j.jar
> >   - MyProject.war
> >
> > dom4j.jar is a third party library required for my application, why am
> > I getting this error? I have debugged this and it appears that if the
> > <module> is type <java> then AppClientModuleBuilder is used and this
> > requires the jar to contain an application-client.xml, otherwise it
> > will fail, is this a bug or how are you supposed to specify library
> > jars contained with an EAR?
> >
> > many thanks
> >
> > Tim.
>
>

Re: EAR fails to deploy library JARs

Posted by David Jencks <da...@yahoo.com>.
Your application.xml is claiming that dom4j.jar is an application  
client jar.  However from the name and your email subject I'd suspect  
that it's the normal dom4j jar that you'd like to get in the  
classloader of your application.  To do this in a portable way you  
need to (in j2ee 1.4) include the jar in the manifest classpath of  
the module(s) that you intend to use it in, presumably the  
MyProject.war.  (In javaee5 there's a lib directory in an ear).   
There's also a geronimo specific way to do this by putting the  
library jar directly in the geronimo repository and listing it as a  
dependency in a geronimo plan for your app.

I have no explanation for why the other servers let you deploy with  
this application.xml: with the new annotation stuff in javaee5  
perhaps they don't check whether its a plausible application client  
until you try to use it?

thanks
david jencks

On Jan 29, 2007, at 8:57 AM, Tim Davidson wrote:

> I am a newbie to Geronimo, I have an EAR file which I have
> successfully managed to deploy to JBoss and Glassfish, I am now trying
> to deploy it to Geronimo however when it deploys it fails saying
> Deployment failed:
>
> -----------------
> Module was not an application client: dom4j.jar
> org.apache.geronimo.common.DeploymentException: Module was not an
> application client: dom4j.jar
>        at  
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.addModules 
> (EARConfigBuilder.java:771)
>        at  
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan 
> (EARConfigBuilder.java:362)
> -----------------
>
> my application.xml is as follows:
> -----------------
> <?xml version="1.0" encoding="UTF-8"?>
> <application xmlns="http://java.sun.com/xml/ns/j2ee"
>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>                http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
>              version="1.4">
>        <display-name>MyProject</display-name>
>        <module>
>                <web>
>                        <web-uri>MyProject.war</web-uri>
>                        <context-root>/MyProject</context-root>
>                </web>
>        </module>
>        <module>
>                <java>dom4j.jar</java>
>        </module>
> .....
> -----------------
>
> whatever jar file I reference in the <java> element it says the same
> thing, the contents of my EAR file are as follows:
>
> EAR
>
>   - META-INF/MANIFEST.MF
>   - META-INF/application.xml
>   - dom4j.jar
>   - MyProject.war
>
> dom4j.jar is a third party library required for my application, why am
> I getting this error? I have debugged this and it appears that if the
> <module> is type <java> then AppClientModuleBuilder is used and this
> requires the jar to contain an application-client.xml, otherwise it
> will fail, is this a bug or how are you supposed to specify library
> jars contained with an EAR?
>
> many thanks
>
> Tim.