0 Replies Latest reply on Aug 8, 2014 9:11 AM by Pierre-Luc Bélanger

    ClassCastException: com.sun.corba.se.impl.corba.CORBAObjectImpl cannot be cast to org.omg.CORBA.Object

    Pierre-Luc Bélanger Newbie

      Hi,

       

      I'm trying to connect to a WebSphere 6.1 EJB 2.1 from JBoss EAP 6.2 (AS 7.?)..

       

      InitialContext ctx = new InitialContext(props);
      Object obj = ctx.lookup(jndi);
      
      

       

      returns :

       

      (ServerService Thread Pool -- 59) com.sun.corba.se.impl.corba.CORBAObjectImpl -- [] -- IOR:0000000000000055524d493a63612e63726f6978626c6575652e71632e7669726167652e7365727665722e676174657761792e656a622e47617465776179454a4252656d6f7465486f6d653a3030303030303030303030303030303000000000000000010000000000000134000102000000000956315741533031490000238c000000a94a4d4249000000124773e3aa37643062633737336533616166633334000020240000008549454a500200c01c0964077365727665723103454a420000006bacac0002000100290000005f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d6573085669726167652347617465776179454a42436c69656e745669726167652e6a61722356697261676547617465776179454a424265616e000000000000070000000100000014000000000501000100000000000101000000000049424d0a0000000800bd00011500000200000026000000020002000049424d040000000500050201020000000000001f0000000400bd0003000000200000000400bd0001000000250000000400bd0003
      (ServerService Thread Pool -- 59) Superclass org.omg.CORBA_2_3.portable.ObjectImpl -- []
      (ServerService Thread Pool -- 59) Superclass org.omg.CORBA.portable.ObjectImpl -- [interface org.omg.CORBA.Object]
      (ServerService Thread Pool -- 59) Superclass java.lang.Object -- []
      
      

       

       

      EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(obj, MyBean.class)
      
      

       

      Error :

       

      ERROR [my.packagetest.CommandProcessor] (ServerService Thread Pool -- 59) executeInConnectedMode: java.lang.ClassCastException
        at org.jboss.com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:246) [jboss-rmi-api_1.0_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
        at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:158) [jboss-rmi-api_1.0_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
        [...]
        at StartupServlet.init(StartupServlet.java:23) at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3591) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3798) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_51]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.ClassCastException: com.sun.corba.se.impl.corba.CORBAObjectImpl cannot be cast to org.omg.CORBA.Object
        at org.jboss.com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:225) [jboss-rmi-api_1.0_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
        ... 26 more
      
      
      

       

      com.sun.corba.se.impl.corba.CORBAObjectImpl extends org.omg.CORBA_2_3.portable.ObjectImpl which extends org.omg.CORBA.portable.ObjectImpl (this implements org.omg.CORBA.Object) so i don't understand the ClassCastException ! Am i missing something here ?

       

      The exact same .war works on Glassfish 4 without problems... So i am assuming something is not correct with my JBoss.. I'm using the standalone-full.xml

       

      JDK version : 1.7u51

       

      jboss-deployment-structure.xml

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
          <deployment>
              <dependencies>
                  <system export="true">
                      <paths>
                          <path name="com/sun/jndi/cosnaming"/>
                          <path name="com/sun/corba/se/impl/internal"/>
                          <path name="com/sun/corba/se/impl/orb"/>
                          <path name="com/sun/corba/se/impl/logging"/>
                          <path name="com/sun/corba/se/impl/javax/rmi/CORBA"/>
                      </paths>
                  </system>
              </dependencies>
          </deployment>
      </jboss-deployment-structure>
      
      
      

       

       

       

      java.naming.factory.initial = com.sun.jndi.cosnaming.CNCtxFactory