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.