You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Markus Wolf <ma...@emedia-solutions-wolf.de> on 2006/06/12 11:04:55 UTC

EAR Classloader

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

what classloader hierarchy does geronimo implement for EAR archives?
I have an EAR archive I want to deploy. It contains some JAR libraries
and a WAR archive. But when the WAR archive is loaded and the
application is started than I get some CNF exceptions for classes which
reside in the JAR libraries. Note that the jar files are no EJB modules.

Thanks
Markus Wolf
- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjS43eyJE91ndMG4RAgUoAJ4gZkuCclcuvEG9qVFW8twzct/sWwCfXJ64
D0FOc4KcOb4YzkX5zP+bKFE=
=4KLa
-----END PGP SIGNATURE-----

Re: EAR Classloader

Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> [...]
> 
>> Is there any other code in this EAR, or just the WAR and these set of
>> JARs?, If yes so I think you can put the JARs in the lib dir for this
>> EAR, or you can put them under the repository dir and mention that you
>> depend on them.
> 
Yes there is code besides the WAR achive, otherwise I would deploy just
a single WAR application. :)
The JAR libraries contain Hibernate POJOs and business logic used by
different clients.
Is there a lib dir in EAR archives like the one in WAR files? I've found
no documentation for it.

- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjTkVeyJE91ndMG4RAh0gAJ9oCds6WWtuHRZpOYH0OSLbkfFAKwCfeyD4
ZlEd2HIcFSU/EcPU5UGZBOw=
=BmdQ
-----END PGP SIGNATURE-----

Re: EAR Classloader

Posted by Mohammed Nour <no...@gmail.com>.
On 6/12/06, Markus Wolf <ma...@emedia-solutions-wolf.de> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> >     Where these jars are deployed?, do they reside under the
> >     <WEB_APP_DIR>/WEB-INF/lib directory or what?, generally for a web
> >     application, referenced jars should reside under this dir or more
> >     common lib dir, the one of the web container for example.
> >
> The jars are in the root of the EAR archive, because they are common
> libraries which are not only used in the WAR application.
> If I put them also in the WEB-INF/lib directory it does work, but I
> think there will be classloading issues at a later time and also this is
> a duplication of the compiled code inside the EAR file.


Is there any other code in this EAR, or just the WAR and these set of JARs?,
If yes so I think you can put the JARs in the lib dir for this EAR, or you
can put them under the repository dir and mention that you depend on them.

I would deploy the JAR libraries as EJB archives, but there are no EJBs
> inside, and I do need a descriptor which needs at least one EJB...
>
> > what classloader hierarchy does geronimo implement for EAR archives?
> > I have an EAR archive I want to deploy. It contains some JAR libraries
> > and a WAR archive. But when the WAR archive is loaded and the
> > application is started than I get some CNF exceptions for classes which
> > reside in the JAR libraries. Note that the jar files are no EJB
> > modules.
> >
>
> - --
> >
> > emedia-solutions wolf
> > Wedeler Landstrasse 63
> > 22559 Hamburg
> > (040) 550 083 70
> >
> >>  web: http://www.emedia-solutions-wolf.de
> >> mail: markus@emedia-solutions-wolf.de
> >>  pgp: http://wwwkeys.de.pgp.net
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFEjTYfeyJE91ndMG4RAgIYAKCBgdR9p449BqthaNoff63h/UPnEACfSc79
> ppwpWP6MdayTM9SkZNq//Mg=
> =FjY6
> -----END PGP SIGNATURE-----
>

Re: EAR Classloader

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On 6/15/06, Mario Rübsam <mr...@coderesearch.com> wrote:
> Is the classloading behaviour without adding the Classpath in MANIFEST.MF
> a bug in 1.1rc1 ? Should I file a Jira?

Please do.

Thanks,
    Aaron

> Mario Rübsam wrote:
> > I had a working EAR for 1.0 with this structure
> >
> > app.ear/
> >         app.jar
> >         cpa.jar
> >         found.jar
> >         webclient.war
> >
> > I referenced the jars from the webclient.war/META-INF/MANIFEST.MF
> > Classpath: app.jar cpa.jar found.jar
> >
> > When I deploy this EAR in G 1.1-rc1 I get ClassNotFoundExceptions.
> >
> > When I put the JARs into the webclient.war/WEB-INF/lib everything
> > work fine. But this is not an option because I have some other
> > WARs to deploy in that EAR.
> >
> > A general class loading and dependency resolution description for
> > EARs would be very helpful.
> >
> > The next thing I found out is that the DB connector dependency
> > must be placed into the geronimo-application.xml when deploying
> > as an EAR. When deploying as an WAR the dependency is good in
> > geronimo-web.xml as stated in the docs or the console example.
> >
> > Thanks,
> > Mario
> >
> >
> > paul.newport@targetgroup.net wrote:
> >>
> >>
> >>  >Which G version are you running because in 1.1-rc1 adding the jars to
> >>  >the war MANIFEST classpath stopped working for me?
> >>
> >> 1 not 1.1
> >>
> >> I can't get my app to deploy in 1.1 for other reasons but if adding
> >> jars to the mainfest classpath is broken in 1.1 this is a fairly
> >> serious bug.
> >>
> >> Target
> >>
> >> www.targetgroup.net
> >>
> >> **********************************************************************
> >>
> >> DISCLAIMER.
> >>
> >> This message is intended only for the use of the Addressee and may
> >>
> >> contain information that is PRIVILEGED and CONFIDENTIAL.
> >>
> >> If you are not the intended recipient you must not copy,
> >>
> >> distribute or take any action or reliance upon it.
> >>
> >> The content of this message may also contain personal
> >>
> >> views of an employee of this company and does
> >>
> >> not necessarily represent the view of the company.
> >>
> >> **********************************************************************
> >>
> >> This message has been scanned by Norton Anti-Virus.
> >>
> >> It has also been scanned by MAILsweeper to enforce our e-mail
> >>
> >> policy. If you have any concerns or comments about the content
> >>
> >> of this message, please e-mail support@targetgroup.net.
> >>
> >> **********************************************************************
> >>
> >>
> >> _____________________________________________________________________
> >> This email has been scanned for all viruses by the MessageLabs Email
> >> Security System. For more information on a proactive email security
> >> service working around the clock, around the globe, visit
> >> http://www.messagelabs.com
> >
>
>
>

Re: EAR Classloader

Posted by Mario Rübsam <mr...@coderesearch.com>.
Is the classloading behaviour without adding the Classpath in MANIFEST.MF
a bug in 1.1rc1 ? Should I file a Jira?

Thanks,
Mario

Mario Rübsam wrote:
> I had a working EAR for 1.0 with this structure
> 
> app.ear/
>         app.jar
>         cpa.jar
>         found.jar
>         webclient.war
> 
> I referenced the jars from the webclient.war/META-INF/MANIFEST.MF
> Classpath: app.jar cpa.jar found.jar
> 
> When I deploy this EAR in G 1.1-rc1 I get ClassNotFoundExceptions.
> 
> When I put the JARs into the webclient.war/WEB-INF/lib everything
> work fine. But this is not an option because I have some other
> WARs to deploy in that EAR.
> 
> A general class loading and dependency resolution description for
> EARs would be very helpful.
> 
> The next thing I found out is that the DB connector dependency
> must be placed into the geronimo-application.xml when deploying
> as an EAR. When deploying as an WAR the dependency is good in
> geronimo-web.xml as stated in the docs or the console example.
> 
> Thanks,
> Mario
> 
> 
> paul.newport@targetgroup.net wrote:
>>
>>
>>  >Which G version are you running because in 1.1-rc1 adding the jars to
>>  >the war MANIFEST classpath stopped working for me?
>>
>> 1 not 1.1
>>
>> I can't get my app to deploy in 1.1 for other reasons but if adding 
>> jars to the mainfest classpath is broken in 1.1 this is a fairly 
>> serious bug.
>>
>> Target
>>
>> www.targetgroup.net
>>
>> **********************************************************************
>>
>> DISCLAIMER.
>>
>> This message is intended only for the use of the Addressee and may
>>
>> contain information that is PRIVILEGED and CONFIDENTIAL.
>>
>> If you are not the intended recipient you must not copy,
>>
>> distribute or take any action or reliance upon it.
>>
>> The content of this message may also contain personal
>>
>> views of an employee of this company and does
>>
>> not necessarily represent the view of the company.
>>
>> **********************************************************************
>>
>> This message has been scanned by Norton Anti-Virus.
>>
>> It has also been scanned by MAILsweeper to enforce our e-mail
>>
>> policy. If you have any concerns or comments about the content
>>
>> of this message, please e-mail support@targetgroup.net.
>>
>> **********************************************************************
>>
>>
>> _____________________________________________________________________
>> This email has been scanned for all viruses by the MessageLabs Email
>> Security System. For more information on a proactive email security
>> service working around the clock, around the globe, visit
>> http://www.messagelabs.com
> 

Re: EAR Classloader

Posted by Mario Rübsam <mr...@coderesearch.com>.
I had a working EAR for 1.0 with this structure

app.ear/
         app.jar
         cpa.jar
         found.jar
         webclient.war

I referenced the jars from the webclient.war/META-INF/MANIFEST.MF
Classpath: app.jar cpa.jar found.jar

When I deploy this EAR in G 1.1-rc1 I get ClassNotFoundExceptions.

When I put the JARs into the webclient.war/WEB-INF/lib everything
work fine. But this is not an option because I have some other
WARs to deploy in that EAR.

A general class loading and dependency resolution description for
EARs would be very helpful.

The next thing I found out is that the DB connector dependency
must be placed into the geronimo-application.xml when deploying
as an EAR. When deploying as an WAR the dependency is good in
geronimo-web.xml as stated in the docs or the console example.

Thanks,
Mario


paul.newport@targetgroup.net wrote:
> 
> 
>  >Which G version are you running because in 1.1-rc1 adding the jars to
>  >the war MANIFEST classpath stopped working for me?
> 
> 1 not 1.1
> 
> I can't get my app to deploy in 1.1 for other reasons but if adding jars 
> to the mainfest classpath is broken in 1.1 this is a fairly serious bug.
> 
> Target
> 
> www.targetgroup.net
> 
> **********************************************************************
> 
> DISCLAIMER.
> 
> This message is intended only for the use of the Addressee and may
> 
> contain information that is PRIVILEGED and CONFIDENTIAL.
> 
> If you are not the intended recipient you must not copy,
> 
> distribute or take any action or reliance upon it.
> 
> The content of this message may also contain personal
> 
> views of an employee of this company and does
> 
> not necessarily represent the view of the company.
> 
> **********************************************************************
> 
> This message has been scanned by Norton Anti-Virus.
> 
> It has also been scanned by MAILsweeper to enforce our e-mail
> 
> policy. If you have any concerns or comments about the content
> 
> of this message, please e-mail support@targetgroup.net.
> 
> **********************************************************************
> 
> 
> _____________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com

Re: EAR Classloader

Posted by pa...@targetgroup.net.
>Which G version are you running because in 1.1-rc1 adding the jars to
>the war MANIFEST classpath stopped working for me?

1 not 1.1

I can't get my app to deploy in 1.1 for other reasons but if adding jars 
to the mainfest classpath is broken in 1.1 this is a fairly serious bug.

Target
www.targetgroup.net

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************



_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

Re: EAR Classloader

Posted by Mario Rübsam <mr...@coderesearch.com>.
Markus Wolf wrote:
> 
>> Is this a Geronimo specific problem i.e. does it work ok in something
>> else eg WAS ?
>>
> I'm not sure, because we only use Geronimo currently and have no other
> app server installed.
> 
>> Have you got them as jar dependencies (mainfest classpath) as well on
>> the build path ? Check MANIFEST.MF in  META_INF
>>
> I've added the jar files to the WARs MANIFEST.MF classpath and then it
> does work.
> I wasn't aware that adding files to the WAR classpath is supported.
> Maybe this could be added to the documentation for the deployment on
> geronimo.
> 
> Thanks for your great help.

Which G version are you running because in 1.1-rc1 adding the jars to
the war MANIFEST classpath stopped working for me?

Thanks,
Mario

Re: EAR Classloader

Posted by pa...@targetgroup.net.
What you had to do isn't geronimo specific, just part of J2EE. If you use 
WSAD or RAD when you right click on a Web project and do properties, the 
manifest classpath is set via the Java Jar dependencies tab. What you had 
was a terribly common problem, as there is a difference between the 
classpath you need to compile, and the one you need to run an app, hence 
the two different classpaths.

Target
www.targetgroup.net

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************



_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

Re: EAR Classloader

Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hmm, my answer email must have been gone to /dev/null.... :(
Here it is once again:

> Is this a Geronimo specific problem i.e. does it work ok in something
> else eg WAS ?
> 
I'm not sure, because we only use Geronimo currently and have no other
app server installed.

> Have you got them as jar dependencies (mainfest classpath) as well on
> the build path ? Check MANIFEST.MF in  META_INF
> 
I've added the jar files to the WARs MANIFEST.MF classpath and then it
does work.
I wasn't aware that adding files to the WAR classpath is supported.
Maybe this could be added to the documentation for the deployment on
geronimo.

Thanks for your great help.
- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjVmAeyJE91ndMG4RAhGRAJ9xK1CDLvkpWTEuLMAPw0HiiAgL1ACeOpar
1dlogejbIuOQ6QtwhtjgGQc=
=XL/b
-----END PGP SIGNATURE-----

Re: EAR Classloader

Posted by Markus Wolf <ma...@markus-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Is this a Geronimo specific problem i.e. does it work ok in something
> else eg WAS ?
> 
I'm not sure, because we only use Geronimo currently and have no other
app server installed.

> Have you got them as jar dependencies (mainfest classpath) as well on
> the build path ? Check MANIFEST.MF in  META_INF
> 
Did you mean define them as manifest dependencies for the EAR archive,
or for the WAR archive?
Currently I have not defined them as dependencies which may cause the
problems, but I thought from the docs that all jars in an EAR are added
to the classloader hierarchy.

- --
______________________________

web: http://www.matrixweb.de
icq: #109622365
pgp: http://wwwkeys.de.pgp.net
______________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjToYYuGbqyQxpHcRAtlkAJ4kiDKQxQP9LQIHsvbk5BS37GSAnwCfUNEY
YTduhEGhM+frJiAXFwms44M=
=LA3+
-----END PGP SIGNATURE-----

Re: EAR Classloader

Posted by pa...@targetgroup.net.
Is this a Geronimo specific problem i.e. does it work ok in something else 
eg WAS ?

Have you got them as jar dependencies (mainfest classpath) as well on the 
build path ? Check MANIFEST.MF in  META_INF



Target
www.targetgroup.net

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************



_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

Re: EAR Classloader

Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>     Where these jars are deployed?, do they reside under the
>     <WEB_APP_DIR>/WEB-INF/lib directory or what?, generally for a web
>     application, referenced jars should reside under this dir or more
>     common lib dir, the one of the web container for example.
> 
The jars are in the root of the EAR archive, because they are common
libraries which are not only used in the WAR application.
If I put them also in the WEB-INF/lib directory it does work, but I
think there will be classloading issues at a later time and also this is
a duplication of the compiled code inside the EAR file.
I would deploy the JAR libraries as EJB archives, but there are no EJBs
inside, and I do need a descriptor which needs at least one EJB...

> what classloader hierarchy does geronimo implement for EAR archives?
> I have an EAR archive I want to deploy. It contains some JAR libraries
> and a WAR archive. But when the WAR archive is loaded and the
> application is started than I get some CNF exceptions for classes which
> reside in the JAR libraries. Note that the jar files are no EJB
> modules.
> 

- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEjTYfeyJE91ndMG4RAgIYAKCBgdR9p449BqthaNoff63h/UPnEACfSc79
ppwpWP6MdayTM9SkZNq//Mg=
=FjY6
-----END PGP SIGNATURE-----

Re: EAR Classloader

Posted by Mohammed Nour <no...@gmail.com>.
Hi Markus...

Where these jars are deployed?, do they reside under the
<WEB_APP_DIR>/WEB-INF/lib directory or what?, generally for a web
application, referenced jars should reside under this dir or more common lib
dir, the one of the web container for example.



On 6/12/06, Markus Wolf <ma...@emedia-solutions-wolf.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> what classloader hierarchy does geronimo implement for EAR archives?
> I have an EAR archive I want to deploy. It contains some JAR libraries
> and a WAR archive. But when the WAR archive is loaded and the
> application is started than I get some CNF exceptions for classes which
> reside in the JAR libraries. Note that the jar files are no EJB modules.
>
> Thanks
> Markus Wolf
> - --
> >
> > emedia-solutions wolf
> > Wedeler Landstrasse 63
> > 22559 Hamburg
> > (040) 550 083 70
> >
> >>  web: http://www.emedia-solutions-wolf.de
> >> mail: markus@emedia-solutions-wolf.de
> >>  pgp: http://wwwkeys.de.pgp.net
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFEjS43eyJE91ndMG4RAgUoAJ4gZkuCclcuvEG9qVFW8twzct/sWwCfXJ64
> D0FOc4KcOb4YzkX5zP+bKFE=
> =4KLa
> -----END PGP SIGNATURE-----
>