Message msg = queueReceiver.receive();
Object obj = ((ObjectMessage)msg).getObject(); //exception here
The ejb component is deployed as a single jar and the "missing" class, InternalMessage,
is in it. Checked full package etc. In fact, the message was sent internally and
no body complained when it was apparently made up fine.
Any idea what the cause might be?
TIA,
Bill
weblogic.jms.common.JMSException: Error deserializing object
.....
Caused by: java.lang.ClassNotFoundException: com.myco.app.server.msg.InternalMessage
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:305)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:130)
... 4 more
If you could check that the class in question contains a no-argument constructor.
Its required for any kind of deserialisation
thanks
jaz
"Bill" <bi...@nospam.com> wrote:
>
>I'm using WL 8.1. I got the following exceptions when I basically did
>this:
>
>Message msg = queueReceiver.receive();
>Object obj = ((ObjectMessage)msg).getObject(); //exception here
>
>The ejb component is deployed as a single jar and the "missing" class,
>InternalMessage,
>is in it. Checked full package etc. In fact, the message was sent internally
>and
>no body complained when it was apparently made up fine.
>
>Any idea what the cause might be?
>
>TIA,
>Bill
>
>weblogic.jms.common.JMSException: Error deserializing object
>......
(BTW - Tom, if you recall you were helping me in considering intra-cluster messaging.
I decided Distributed Topics would cover most of the needs. This problem started
to happen when we started to try out different configs. But this now happens whether
it's in the clustered env or not.)
10/09 15:03:51 ERROR [Thread-56] weblogic.jms.common.JMSException: Error deserializing
object
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:144)
at myco.myapp.server.communication.internal.InternalPFSListener.convertMessage(InternalPFSListener.java:176)
at myco.myapp.server.communication.internal.InternalPFSListener.doBatch(InternalPFSListener.java:85)
at myco.myapp.server.communication.internal.InternalPFSListener.run(InternalPFSListener.java:73)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: myco.myapp.server.bdt.InternalMessage
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:305)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:130)
... 4 more
//InternalPFSListener::convertMessage
private InternalMessage convertMessage(Message msg) throws Exception
{
//some debugging stuff...
return (InternalMessage)((ObjectMessage)msg).getObject();
}
//Definition of the Queue in config.xml
<JMSServer Name="myJMSServer" Store="myFileStore" Targets="myServer">
//other destinations
<JMSQueue
JNDIName="myco.myapp.server.internal.jms.PFSQueue"
JNDINameReplicated="false" Name="PFSQueue" StoreEnabled="default"/>
</JMSServer>
Is the app running on its own threads on the server? Seems
like it:
myco.myapp.server.communication.internal.InternalPFSListener.run(InternalPFSListener.java:73)
at java.lang.Thread.run(Thread.java:534)
This isn't supported. But, hey, everybody does it.
You will need to tell the thread
about the correct class-loader to use. I'm not sure
how, perhaps by caching it
from a server thread that has invoked one
of your EJBs, and then setting it on
your own thread. (This stretches the limit
of my class-loader knowledge, so I'll rope
a guru in if this advice doesn't suffice.)
Tom
Bill wrote:
> I just noticed an earlier post regarding CR101198 in 8.1 Beta. The issue looked
> so much like what we are having. But everywhere I looked, I didn't see "beta"
> in the installation. What's the definitive way to find out the release version?
java weblogic.version (I think)
or look at the beginning lines of your log file
Note that by calling "getObject()" in another
thread you are technically multi-threading the session.
It should be fine with WL JMS, as long as you
don't attempt to use the message again in the original
thread after passing it off.
The child thread should use the parent's so it really shouldn't be a problem.
And since the session is established in the new thread after it starts, I'd think
we didn't multi-thread the session. Just to test with these issues in mind but
from a different angle, I did a load class from a SLSB (AdminSvcEJB):
try
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
cl.loadClass("InternalMessage");
}catch (Throwable t)
{
t.printStackTrace();
}
It still doesn't find it and gets the following, therefore the problem seems to
be more general.
10/09 21:58:51 DEBUG [ExecuteThread: '49' for queue: 'default'] [AdminSvcEJB::initializeServer]
classloader: weblogic.utils.classloaders.GenericClassLoader@7d811a finder: weblogic.utils.classloaders.MultiClassFinder@1a6fb3e
annotation: myejb@
10/09 21:58:51 ERROR [ExecuteThread: '49' for queue: 'default'] java.lang.ClassNotFoundException:
InternalMessage
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at myco.myapp.server.service.AdminSvcEJB.initializeServer(AdminSvcEJB.java:930)
at myco.myapp.server.service.AdminSvc_760dph_EOImpl.initializeServer(AdminSvc_760dph_EOImpl.java:424)
at myco.myapp.server.service.AdminAdapterEJB.service(AdminAdapterEJB.java:166)
at myco.myapp.server.service.AdminAdapterEJB.service(AdminAdapterEJB.java:43)
at myco.myapp.server.service.AdminAdapter_45f3sz_EOImpl.service(AdminAdapter_45f3sz_EOImpl.java:97)
at myco.myapp.server.service.AdminAdapter_45f3sz_EOImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:407)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:356)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:123)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:351)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
What's still puzzling, however, is that this class has been there and working
for at least months. We started trying out different config settings in the past
few days.
Great help. Thanks again!