Ear Sar ClassLoader related Problems
shreedharn Oct 8, 2003 7:32 AMHi guys,
Am in the process of porting my application from JBoss3.0 to JBoss3.2. And no surprise I am having lots of class loader related problem. It wud be gr8 help if somebody could find out where I had gone wrong.
I have ear and a sar for my application. EJB/Web stuffs are packed in the ear and my services are packed in sar. There are few classes that are duplicated in both the archives which gives a lot of ClassLoader related problem.
When deployed as is [myapp.ear and myapp.sar copied to deploy directory], it gives a LinkageError stating that there are duplicate classes.
I tried to define the class loader scope for ear (using <loader-repository> in jboss-app.xml), but when any of service class accesses the ejb, it gives a classcast exception when casting EJB Home. Then I used ByValueInvokerInterceptor to avoid call by reference mode. (courtesy http://www.mail-archive.com/jboss-development@lists.sourceforge.net/msg37149.html//www.mail-archive.com/jboss-development@lists.sourceforge.net/msg37149.html), after which I am able to successfully look up. But calling a finder (on the looked up home) leads to a NullPointerException! (see stack trace at the end of posting)
Then I tried providing same value in <loader-repository> in jboss-app.xml of both ear and sar. Still there was a ClassCastException during Home look up!!
Any clues will be highly helpful.
Thanks,
Shreedhar
java.lang.NullPointerException
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityC
ontainer.java:994)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractIntercep
tor.java:88)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(Ent
itySynchronizationInterceptor.java:188)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
keHome(CachedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractIntercep
tor.java:88)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:91)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:61)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
tionInterceptor.java:28)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:88)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:243)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:74)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:92)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
20)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
actoryFinderInterceptor.java:93)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java
:477)
at org.jboss.ejb.Container.invoke(Container.java:694)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
a:83)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
5)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy106.findByPrimaryKey(Unknown Source)