• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ClassCast Exception while invoking EJB

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are in process of upgrading our MQ version from 6 to 7. Our weblogic version is 10.3.6.

When we are processing a MQ response we are getting a class cast exception while looking up and invoking an EJB.

Here is the code snippet for exception :

try
{
Object obj = ctx.lookup(getSJBName());
obj.toString();


EJBHome home =
(EJBHome)javax.rmi.PortableRemoteObject.narrow(obj.getClass(), EJBHome.class);

Method create = home.getClass().getDeclaredMethod("create", new Class[0]);
genericRemote = (SessionRemote)create.invoke(home, new Object[0]);

remoteMap.put(this.getClass().getName(), genericRemote);
}
catch (Exception e)
{
Log.caught("Exception:"+e, this);
Log.thrown("LokException:"+e, this);
throw new LokException(e);
}


From log I can see :

Mon Aug 12 02:31:25 MDT 2013:null: Getting the SJB namecom.nest.lok.session.primitive.absErrSJBHomeMon Aug 12 02:31:25 MDT 2013:null: Got the Object for SJB lookup
Mon Aug 12 02:31:25 MDT 2013:null: Created Object : ClusterableRemoteRef(-5212375303722029986S::lok_app:admin_lok [-5212375303722029986S::lok_app:admin_lok/353])/353
Mon Aug 12 02:31:25 MDT 2013:null:Created EJB home for object = ClusterableRemoteRef(-5212375303722029986S::lok_app:admin_lok [-5212375303722029986S::lok_app:admin_lok/353])/353
Mon Aug 12 02:31:25 MDT 2013:null: Created EJB home for object
Mon Aug 12 02:31:25 MDT 2013:null: Created Create method
Mon Aug 12 02:31:25 MDT 2013:lokApp:<Exception Caught>Exception:java.lang.ClassCastException: com.nest.lok.session.primitive.absErrSJB_oncb4y_EOImpl_1036_WLStub cannot be cast to com.nest.lok.session.SessionRemote
Mon Aug 12 02:31:25 MDT 2013:lokApp:<Exception Thrown>LokException:java.lang.ClassCastException: com.nest.lok.session.primitive.absErrSJB_oncb4y_EOImpl_1036_WLStub cannot be cast to com.nest.lok.session.SessionRemote
Mon Aug 12 02:31:25 MDT 2013:null:Exception: com.nest.lok.session.primitive.absErrSJB_oncb4y_EOImpl_1036_WLStub cannot be cast to com.nest.lok.session.SessionRemote
com.nest.lok.exception.LokException: com.nest.lok.session.primitive.absErrSJB_oncb4y_EOImpl_1036_WLStub cannot be cast to com.nest.lok.session.SessionRemote
at com.nest.lok.message.GenericMessage.createSessionRemote(GenericMessage.java:138)
at com.nest.lok.message.GenericMessage.query(GenericMessage.java:505)
at com.nest.lok.abs.ABSPacketInfo.getIdForErrorMessage(ABSPacketInfo.java:696)
at com.nest.lok.abs.ABSPacketInfo.mapConfirmationDetail(ABSPacketInfo.java:1083)
at com.nest.lok.abs.ABSPacketInfo.storeConfirmation(ABSPacketInfo.java:1181)

Please help me.
 
Lokeswar Reddy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I found that the new mq jars (related to version 7) are causing the issue. But not sure how to fix it. Please help me.
 
Ranch Hand
Posts: 376
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This issue is more related to WebLogic Server than generic EJB question.
Anyway, are you using mq 7 for all your created components ?
(server and client side?).
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic