5 Replies Latest reply on Jan 21, 2003 1:30 PM by dummyjim

    IIOP BUG

    dummyjim

      Well I think so... :-(

      I use "com.sun.jndi.cosnaming.CNCtxFactory"
      to access to EJBs thru RMI/IIOP.

      All OK untill I have 2 overwritten methods.

      i.e.

      getData(String name)
      getData(int age)

      Sometimes (often) it returns "CORBA.BAD_OPERATION"

      As far as I understand there is a list with methods somethere and if parameter doesn't match it returns a error insted of looking for another one...

      The code works perfectly with RI.

      Thank you very much,

        • 1. Re: IIOP BUG

          This works for me,
          I just added a specific test for this to the
          jboss testsuite.
          http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosstest/src/main/org/jboss/test/helloiiop/ejb/HelloBean.java?annotate=1.1.2.1

          Perhaps you can post an example that doesn't work
          as a bug at
          www.sf.net/projects/jboss

          Regards,
          Adrian

          • 2. Re: IIOP BUG
            dummyjim

            Well, you are rigth.

            I made a simple test and it works...
            I have no idea what is wrong with my program :-(((

            Thank you.

            • 3. Re: IIOP BUG
              dummyjim

              Hi there,

              I have no idea what's happen with forum. Some posts just has been removed... :-(

              Well, The question is:

              Am I Dummy? ;-)

              if I have two overridden business methods thich starts with "get" prefix a program doesn't work. I get an exception:

              ***********************************
              java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
              org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
              at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:134)
              at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
              at test._SimpleSession_Stub.getMyList(Unknown Source)
              at test.JBossTest.(JBossTest.java:37)
              at test.JBossTest.main(JBossTest.java:48)
              Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
              at java.lang.Class.newInstance0(Class.java:306)
              at java.lang.Class.newInstance(Class.java:259)
              at com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:90)
              at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:105)
              at com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:309)
              at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
              at test._SimpleSession_Stub.getMyList(Unknown Source)
              ... 2 more
              *********************************************
              Here is my example:

              *********************************************
              package test;

              import javax.ejb.*;

              public interface FacadeHome extends EJBHome
              {
              Object create() throws java.rmi.RemoteException, CreateException;
              }
              *********************************************
              package test;

              public interface SimpleSessionHome extends FacadeHome
              {
              }
              *********************************************
              package test;

              import java.util.ArrayList;

              import javax.ejb.*;
              import java.rmi.RemoteException;

              public interface SimpleSession extends EJBObject
              {
              public ArrayList getMyList() throws RemoteException;
              public ArrayList getMyList(int id) throws RemoteException;
              }
              *********************************************
              package test;

              import java.util.*;

              import javax.ejb.*;
              import javax.naming.*;
              import java.rmi.RemoteException;

              public class SimpleSessionBean implements SessionBean
              {

              public ArrayList getMyList()
              {
              System.out.println("[SimpleSessionBean].getList() method started...");

              return new ArrayList();
              }

              public ArrayList getMyList(int id)
              {
              System.out.println("[SimpleSessionBean].getList() method started...");

              return new ArrayList();
              }

              public void ejbCreate() throws CreateException {}
              public void ejbRemove() {}
              public void ejbActivate() {}
              public void ejbPassivate() {}
              public void setSessionContext(SessionContext ctx) {}
              }
              *********************************************
              package test;

              import org.omg.CORBA.*;
              import org.omg.PortableServer.*;

              import javax.rmi.PortableRemoteObject;

              import java.rmi.RemoteException;

              import java.util.Properties;

              import javax.ejb.*;

              import javax.naming.Context;
              import javax.naming.InitialContext;
              import javax.naming.NamingException;

              public class JBossTest
              {
              private final static String factory = "com.sun.jndi.cosnaming.CNCtxFactory";
              private final static String provider = "IOR:...";

              public JBossTest()
              {
              Properties env = new Properties();

              env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
              env.put(Context.PROVIDER_URL, provider);

              try
              {
              InitialContext ctx = new InitialContext(env);
              java.lang.Object obj = ctx.lookup("SimpleSession");
              SimpleSessionHome home = (SimpleSessionHome)PortableRemoteObject.narrow(obj, SimpleSessionHome.class);
              SimpleSession simple = (SimpleSession)home.create();

              System.out.println(simple.getMyList());
              System.out.println(simple.getMyList(123));
              }
              catch (Exception ex)
              {
              ex.printStackTrace(System.err);
              }

              }
              public static void main(String[] args)
              {
              new JBossTest();
              }
              }
              *********************************************
              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>


              <display-name>JBossIIOPTest</display-name>
              Application description

              SimpleSession.jar



              *********************************************
              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>

              <ejb-jar>
              <display-name>SimpleSession</display-name>
              <enterprise-beans>

              <display-name>SimpleSessionBean</display-name>
              <ejb-name>SimpleSessionBean</ejb-name>
              test.SimpleSessionHome
              test.SimpleSession
              <ejb-class>test.SimpleSessionBean</ejb-class>
              <session-type>Stateless</session-type>
              <transaction-type>Bean</transaction-type>
              <security-identity>

              <use-caller-identity></use-caller-identity>
              </security-identity>

              </enterprise-beans>
              <assembly-descriptor>
              <method-permission>


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Home</method-intf>
              <method-name>remove</method-name>
              <method-params>
              <method-param>javax.ejb.Handle</method-param>
              </method-params>


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Home</method-intf>
              <method-name>getHomeHandle</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>isIdentical</method-name>
              <method-params>
              <method-param>javax.ejb.EJBObject</method-param>
              </method-params>


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Home</method-intf>
              <method-name>remove</method-name>
              <method-params>
              <method-param>java.lang.Object</method-param>
              </method-params>


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Home</method-intf>
              <method-name>create</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>getHandle</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Home</method-intf>
              <method-name>getEJBMetaData</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>getPrimaryKey</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>remove</method-name>
              <method-params />


              <ejb-name>SimpleSessionBean</ejb-name>
              <method-intf>Remote</method-intf>
              <method-name>getEJBHome</method-name>
              <method-params />

              </method-permission>
              </assembly-descriptor>
              </ejb-jar>

              *********************************************
              <?xml version="1.0" encoding="UTF-8"?>

              <enterprise-beans>

              <ejb-name>SimpleSessionBean</ejb-name>
              <jndi-name>SimpleSession</jndi-name>
              <configuration-name>IIOP Stateless SessionBean</configuration-name>

              </enterprise-beans>

              *********************************************

              I understand that it could work on SUN RI by error :-),

              but why it works also if I change methods name to gedMyList (for example)?

              Sincerely Yours,

              • 4. Re: IIOP BUG
                dummyjim

                Hello Adrian!

                I have seen iiophellotest and I didn't understand which context factory it uses. I mean is it "com.sun.jndi.cosnaming.CNCtxFactory"?

                If you can change the test files can you rename

                public String hello(String name)
                throws RemoteException;

                public String hello(int number)
                throws RemoteException;

                to "getHello"??? to try it on.

                Sincerely Yours,

                D.

                • 5. Re: IIOP BUG
                  dummyjim

                  It's me again...

                  Here is a JBoss log...
                  ******************************************
                  2003-01-21 18:39:13,757 INFO [STDOUT] [SimpleSessionBean].getList() method started...
                  2003-01-21 18:39:13,757 INFO [STDOUT] [ POA SimpleSession - rid: 8 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] [ POA SimpleSession - rid: 9 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] [ POA SimpleSession - rid: 9 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] [ POA SimpleSession - rid: 9 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] [ POA SimpleSession - rid: 9 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] [ POA SimpleSession - rid: 9 oid: ¼?
                  2003-01-21 18:39:13,773 INFO [STDOUT] ############################ StackTrace ############################
                  2003-01-21 18:39:13,773 INFO [STDOUT] org.omg.CORBA.BAD_OPERATION: getMyList vmcid: 0x0 minor code: 0 completed: No
                  2003-01-21 18:39:13,773 INFO [STDOUT] at org.jboss.ejb.plugins.iiop.server.IIOPContainerInvoker._invoke(IIOPContainerInvoker.java:747)
                  2003-01-21 18:39:13,773 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:247)
                  2003-01-21 18:39:13,773 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:477)
                  2003-01-21 18:39:13,773 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:604)
                  2003-01-21 18:39:13,773 INFO [STDOUT] ####################################################################

                  Regards,

                  D.