Bugs item #465671, was opened at 2001-09-27 07:20
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=465671&group_id=22866
Category: JBossServer
Group: v2.4 (stable)
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Scott M Stark (starksm)
Summary: Wrong ClassLoader being used?
Initial Comment:
This following code causes exceptions in jboss that
seems incorrect.
This code is in TCaseSessionBean
return
((TModelSessionHome)HomeCache.singleton
().lookup(
TModelSessionHome.LOOKUP_JNDI,
TModelSessionHome.class)
).create();
The deployment scenario is as follows:
TCaseSessionBean deployed in jar 1 and uses
TModelSessionBean (via JNDI lookup) deployed in jar 2.
TNodeInfo (a pass-by-value-object) is present in jar 2
but not in jar 1. This should be OK as far as
I can see as TCaseSessionBean doesn't need to use
TNodeInfo. TModelSessionBean
doesn't cause an exception when called from a normal
Client [non-ejb].
I suspect that the ClassLoader from jar 1 is being
used inside code in jar 2.
Maybe if the ContextClassLoader is being used it has
not been switched between beans when in the same
thread. Is this the case?
This will prevent modular incremental EJB backend
rollouts and so is quite serious in a production
situation. Not every installation can be deployed as a
single jar.
[TCaseSession] TRANSACTION ROLLBACK
EXCEPTION:com/katalyzt/toolbox/model/ejb/TNodeInfo;
nested exception is:
java.lang.NoClassDefFoundError:
com/katalyzt/toolbox/model/ejb/TNodeInfo
[TCaseSession] java.lang.NoClassDefFoundError:
com/katalyzt/toolbox/model/ejb/TNodeInfo
[TCaseSession] at java.lang.Class.getMethods0(Native
Method)
[TCaseSession] at java.lang.Class.getMethods
(Class.java:742)
[TCaseSession] at
sun.misc.ProxyGenerator.generateClassFile
(ProxyGenerator.java:176)
[TCaseSession] at
sun.misc.ProxyGenerator.generateProxyClass
(ProxyGenerator.java:77)
[TCaseSession] at
java.lang.reflect.Proxy.getProxyClass(Proxy.java:475)
[TCaseSession] at
sun.rmi.server.MarshalInputStream.resolveProxyClass
(MarshalInputStream.java:185)
[TCaseSession] at
java.io.ObjectInputStream.inputProxyClassDescriptor
(ObjectInputStream.java:982)
[TCaseSession] at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:370)
[TCaseSession] at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
[TCaseSession] at
java.io.ObjectInputStream.inputObject
(ObjectInputStream.java:1186)
[TCaseSession] at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:386)
[TCaseSession] at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
[TCaseSession] at java.rmi.MarshalledObject.get
(MarshalledObject.java:138)
[TCaseSession] at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.
invokeHome(JRMPContainerInvoker.java:424)
[TCaseSession] at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeH
ome(HomeProxy.java:237)
[TCaseSession] at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke
(HomeProxy.java:182)
[TCaseSession] at $Proxy6.create(Unknown Source)
[TCaseSession] at
com.katalyzt.toolbox.ext.cm.ejb.TCaseSessionBean$1.reso
lve(TCaseSessionBean.java:62)
[TCaseSession] at
com.katalyzt.toolbox.util.ejb.SessionPool.get
(SessionPool.java:30)
[TCaseSession] at
com.katalyzt.toolbox.ext.cm.ejb.TCaseSessionBean.getCas
e(TCaseSessionBean.java:364)
[TCaseSession] at java.lang.reflect.Method.invoke
(Native Method)
[TCaseSession] at
org.jboss.ejb.StatelessSessionContainer$ContainerInterc
eptor.invoke(StatelessSessionContainer.java:543)
[TCaseSession] at
org.jboss.ejb.plugins.StatelessSessionInstanceIntercept
or.invoke(StatelessSessionInstanceInterceptor.java:87)
[TCaseSession] at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext
(TxInterceptorCMT.java:133)
[TCaseSession] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:307)
[TCaseSession] at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:99)
[TCaseSession] at
org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:128)
[TCaseSession] at
org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:195)
[TCaseSession] at
org.jboss.ejb.StatelessSessionContainer.invoke
(StatelessSessionContainer.java:286)
[TCaseSession] at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.
invoke(JRMPContainerInvoker.java:393)
[TCaseSession] at java.lang.reflect.Method.invoke
(Native Method)
[TCaseSession] at
sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:241)
[TCaseSession] at sun.rmi.transport.Transport$1.run
(Transport.java:152)
[TCaseSession] at
java.security.AccessController.doPrivileged(Native
Method)
[TCaseSession] at
sun.rmi.transport.Transport.serviceCall
(Transport.java:148)
[TCaseSession] at
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:465)
[TCaseSession] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.ru
n(TCPTransport.java:706)
[TCaseSession] at java.lang.Thread.run
(Thread.java:484)
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-10 07:34
Message:
Logged In: NO
It seems that the XADataSource connection pool is running
out of connections after a while. Is there something that
could offend Jboss and prevent it returning them to the
pool? I am connecting to Oracle. The Oracle config is a
copy and paste from the jboss manual. Eventually a null
pointer arises which I assume is what the pool returns when
there are no connections left... Ow!!... This is pretty
urgent... I will look for references to this problem now in
other jboss areas/forums as it's not really relevant here
anymore. Thanks.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-09 07:17
Message:
Logged In: NO
Infact it's worse in that the server just stops responding.
If I shut down the client it hangs still on the next
attempt to connect. After a while this appears:
[TModelSession] Transaction XidImpl [FormatId=257,
GlobalId=roadrunner//12, BranchQual=] timed out.
status=STATUS_ACTIVE
[TModelSession] Transaction XidImpl [FormatId=257,
GlobalId=roadrunner//14, BranchQual=] timed out.
status=STATUS_ACTIVE
Is there anyway I can trace the point at which the server
is hanging? Some very verbose mode?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-09 06:57
Message:
Logged In: NO
I have manually created custom client jars to be used as
includes for each layer and this seems to stop the
NoClassDefFoundException but has a worrying side effect
that I am investigating today: Sometimes the method call
just never returns! Could this be a known RMI problem that
has an easy solution?
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-08 13:43
Message:
Logged In: NO
The Remote interface of TModelSession does infact contain a
reference to TNodePermInfo but the client (the TCaseSession
EJB) doesn't ever use it or need it so Jbuilder never
includes it as a dependency in the output jar files! This
is what freaked me out and just didn't occur until I
decided to port to Jboss using RMI as opposed to RMI-IIOP
previously (which must be more forgiving by not loading a
class until actually required).
Would this also be the cause of similar class problems when
I try to deploy all sessions in separate jars? Currently I
have only been able to get them to work together deployed
in a single jar which is not ideal.
Does this mean that each jar must contain many classes that
are never used with RMI to avoid problems? Unfortunately,
there doesn't seem to be a way to force jbuilder to count
these as dependencies! Bummer. I will check tommorrow to
see if this really is the case.
----------------------------------------------------------------------
Comment By: Scott M Stark (starksm)
Date: 2001-10-08 12:44
Message:
Logged In: YES
user_id=175228
Show the home and remote interfaces for the TModelSession
bean. If either references the TNodeInfo class this is the
expected behavior.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-08 01:49
Message:
Logged In: NO
Oops I forgot... For anyone requiring a workaround
immediately add all the EJB jars deployed to the client
programs classpath before calling java. This will give the
system classloader access to all classes involved in
serialization. This is obviously a ridiculous deployment
scenario (for security and modularity reasons) but does
allow continuation of development for the time being. Hope
this helps. JB.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-08 01:41
Message:
Logged In: NO
PS Oops I forgot to add this above. Any people needing a
workaround immediately can just add the deployed EJB jars
to the client classpath in the batch file that runs it.
This is obviously a ridiculous deployment scenario (for
security and modularity reasons) but does allow
continuation of development.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2001-10-08 01:35
Message:
Logged In: NO
Actually I do now get a similar error from a client program
aswell. Now I have redeployed it outside the IDE (with all
required libraries not now being accessible to
SystemClassLoader) it has started producing the same
problem. I suspect that the RMI delegation code is not
providing necessary access to required JBoss generated
classloaders. Another similar client problem I have managed
to get around by doing Thread.currentThread
().setContextClassLoader(getClass().getClassLoader());
before using new InitialContext();. This prevented the
exception only under some circumstances. I'm not sure if
this has any bearing on matters. Hope this helps.
Exception in thread "main" java.lang.NoClassDefFoundError:
[Lcom/katalyzt/toolbox/model/ejb/TNodePermInfo;
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getMethods(Unknown Source)
at sun.misc.ProxyGenerator.generateClassFile
(Unknown Source)
at sun.misc.ProxyGenerator.generateProxyClass
(Unknown Source)
at java.lang.reflect.Proxy.getProxyClass(Unknown
Source)
at
sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown
Source)
at
java.io.ObjectInputStream.inputProxyClassDescriptor(Unknown
Source)
at java.io.ObjectInputStream.readObject(Unknown
Source)
at java.io.ObjectInputStream.readObject(Unknown
Source)
at java.io.ObjectInputStream.inputObject(Unknown
Source)
at java.io.ObjectInputStream.readObject(Unknown
Source)
at java.io.ObjectInputStream.readObject(Unknown
Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome
(HomeProxy.java:258)
at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke
(HomeProxy.java:182)
at $Proxy0.create(Unknown Source)
at
com.katalyzt.toolbox.model.ejb.TModelSessionProxy.getSession
(TModelSessionProxy.java:55)
at
com.katalyzt.toolbox.model.ejb.TModelSessionProxy.getAllRegi
onsForUser(TModelSessionProxy.java:121)
at
com.katalyzt.toolbox.gui.ToolboxSessionPanel.switchRegion
(ToolboxSessionPanel.java:88)
at
com.katalyzt.toolbox.gui.ToolboxSessionPanel.postInitialize
(ToolboxSessionPanel.java:80)
at com.katalyzt.toolbox.gui.Launcher.init
(Launcher.java:84)
at com.katalyzt.toolbox.gui.Launcher.<init>
(Launcher.java:43)
at com.katalyzt.toolbox.gui.Launcher.main
(Launcher.java:173)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=465671&group_id=22866
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development