Bugs item #823636, was opened at 2003-10-14 19:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=823636&group_id=22866

Category: None
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Adrian Price (adrianprice)
Assigned to: Nobody/Anonymous (nobody)
Summary: EAR ClassLoader ignores library jar Class-Path

Initial Comment:
JBoss-3.2.1, j2sdk1.4.0_01, WinXP or Red Hat Linux 9.0.

The JBoss EAR ClassLoader does not appear to honour 
the manifest Class-Path entries in either ejb-jar files 
(declared as <ejb> modules in application.xml) or regular 
library files contained within the EAR archive (packaged 
as peers to ejb-jar files).

According to the J2EE specification and the JBoss 
documentation the arrangement below should work 
correctly, but it doesn't.  By experiment I have 
determined that declaring lib1.jar and lib2.jar as <java> 
modules in application.xml solves the problem, but this is 
clearly not the correct approach (java modules are 
explicitly for client code).

Attached is the following test case that illustrates the 
problem:

my-app.ear
    META-INF/application.xml
    my-ejb.jar
        META-INF/MANIFEST.MF Class-Path: lib1.jar
        tld/domain/MyEJB.class
        tld/domain/MyEJBRemote.class
        tld/domain/MyEJBRemoteHome.class
    lib1.jar
        META-INF/MANIFEST.MF Class-Path: lib2.jar
        tld/domain/A.class
    lib2.jar
        tld/domain/B.class

my-client.jar
    META-INF/MANIFEST.MF Main-Class: 
tld.domain.MyClient
    tld/domain/MyClient.class

Executing the run.cmd script launches MyClient, which 
attempts to create an instance of the MyEJB bean.  The 
server throws the following exception:

17:57:09,089 ERROR [LogInterceptor] Unexpected Error:
java.lang.NoClassDefFoundError: tld/domain/A
        at tld.domain.MyEJB.<clinit>(MyEJB.java:12)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0
(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInsta
nce(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance
(Constructor.java:274)
        at java.lang.Class.newInstance0(Class.java:296)
        at java.lang.Class.newInstance(Class.java:249)
        at 
org.jboss.ejb.Container.createBeanClassInstance
(Container.java:469)
        at org.jboss.ejb.plugins.AbstractInstancePool.get
(AbstractInstancePool.java:146)
        at 
org.jboss.ejb.plugins.StatelessSessionInstanceIntercepto
r.invoke(StatelessSessionInstanceInterceptor.java:58)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:84)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:243)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:104)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:117)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:191)
        at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invok
e(ProxyFactoryFinderInterceptor.java:122)
        at 
org.jboss.ejb.StatelessSessionContainer.internalInvoke
(StatelessSessionContainer.java:322)
        at org.jboss.ejb.Container.invoke
(Container.java:674)
        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:324)
        at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBeanDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:549)
        at 
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke
(JRMPInvoker.java:359)
        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:324)
        at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run
(Transport.java:148)
        at java.security.AccessController.doPrivileged
(Native Method)
        at sun.rmi.transport.Transport.serviceCall
(Transport.java:144)
        at 
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:460)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.r
un(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:536)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=823636&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to