ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » when call ejb , return CAST exception(in WMB)

Post new topic  Reply to topic
 when call ejb , return CAST exception(in WMB) « View previous topic :: View next topic » 
Author Message
diaozuxin
PostPosted: Tue Mar 20, 2012 10:40 am    Post subject: when call ejb , return CAST exception(in WMB) Reply with quote

Newbie

Joined: 27 Jun 2010
Posts: 5

Dear all,

I meet a strange and interesting problem, i.e ,when I call an EJB on a Weblogic Server in JavaCompute Node, it returns me

Text:CHARACTER:java.lang.ClassCastException: com.ejb.HelloWorld_evy8hi_HomeImpl_1030_WLStub incompatible with com.interfaces.HelloWorldHome

But I when I call the EJB in a java project. It's OK.

I have put the EJB client jar file into the lib path of the java project referenced by message flow. Also I put the weblogic.jar into a user lib.
In the java project this seems OK. But why it throw exception in javacompute node?
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Tue Mar 20, 2012 11:19 am    Post subject: Re: when call ejb , return CAST exception(in WMB) Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Can you use a WebService-Interface (to call on the Weblogic-AS) (instead of "remote objects")?

Also consider that Broker is not an AppServer:

WAS to WAS EJB-Calls: ok
WAS to WebLogic EJB-Calls: probably ok
Broker: EJB-Calls... probably not ok
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 20, 2012 2:13 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

It looks as though you are picking up a different class when you run within the JavaCompute node. That's probably because the class path is different, or perhaps because a different class loader is being used. I'm pretty sure it's possible to configure the JVM to tell you about every class that it loads. Then you can search the output for your class name and (hopefully) see where it's going wrong.

Others may have better suggestions.
Back to top
View user's profile Send private message
diaozuxin
PostPosted: Tue Mar 20, 2012 7:10 pm    Post subject: Reply with quote

Newbie

Joined: 27 Jun 2010
Posts: 5

Dear Kimbert,

What you think is very similar to mine, I have thought the problem come from the classloader, but how to configure the Message Broker JVM, and trace out all loading classpath?
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Tue Mar 20, 2012 8:52 pm    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Which version (of EJB) do you use? (2.1, 3.0, 3.1)?

With 2.1 you will have a remote&home interface and before the CAST you'll have to do a narrow.
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Mar 21, 2012 12:33 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Use mqsichangeproperties specifying the 'ComIbmJVMManager' resource to set the properties on the JVM. If you don't know the property name, you can use mqsireportproperties to get a list of available properties.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 21, 2012 5:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should use a JavaClassloader Configurable Service and specify the needed locations to ensure that your Java Compute node will get the right classes from the right place.

No need to set specific properties on the ComIBMJVMManager, and no need to put jar files in shared-classes or etc.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Mar 22, 2012 2:08 am    Post subject: Re: when call ejb , return CAST exception(in WMB) Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

diaozuxin wrote:
Text:CHARACTER:java.lang.ClassCastException: com.ejb.HelloWorld_evy8hi_HomeImpl_1030_WLStub incompatible with com.interfaces.HelloWorldHome


This is not a "Class not found exception", but a "Stub doesn't fit to native Class" CAST exception.

The narrow might take care ... and narrow down from an "Object" to the proper (native) Class (not the stub).

From how I understand it, in newer EJB-Versions the narrow is not necessary (any more)... and then the CAST must do that "implicitly/includingly"... which might explain why it works in one place and doesn't in the other: What EJB-versions do you use (in each place)?
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » when call ejb , return CAST exception(in WMB)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.