6 Replies Latest reply on Jan 22, 2003 4:33 PM by Danielle

    Is this is bug with JBoss 3.0!!!

    Muraly Newbie

      Hi,
      I am working with JBoss3.0. I am working on the process migration to JBoss. The previous server bein JOnAs. I am facing two problems.

      1. If my bean's remote method is having a return type as Vector, JBoss throws an exception saying 'java.lang.classcastexception:java.util.arraylist'. This code works fine with JOnAs.

      2. If my bean's remote method arguement is of parent class and if I pass the corresponding child class

      OR

      if the bean's remote method is of an interface and if I pass a class which implements this interface

      JBoss says 'IllegatArguementException'.

      Can anyone throw some light on this it will be helpfull

      Cheers
      Muarly

        • 1. Re: Is this is bug with JBoss 3.0!!!
          Juha Lindfors Master

          show your code

          • 2. Re: Is this is bug with JBoss 3.0!!!
            Muraly Newbie

            HI Juha,

            Following is the code snippets for the above scenarios:

            1. Vector Problem
            =================

            Bean Code:
            public Vector ejbFindAllCollectorsByType(int type,String filter, String sort) throws RemoteException, FinderException,ObjectNotFoundException
            {
            /* code*/
            return //Vector;
            }

            Remote code:
            public Vector findAllCollectorsByType(int type,String filter, String sort) throws RemoteException, FinderException,ObjectNotFoundException;

            When a call is meade to this method JBoss says:
            java.lang.ClassCastException:java.util.ArrayList

            But when the return type was changed to ArrayList, the problem got solved. I checked throughly that in the bean implementation not a single ref. is made to ArrayList.

            2. IllegalArguementException
            ============================

            Bean Code:
            public Command localExecute(Command cmd) throws RemoteException
            {
            /* code */
            }

            ClientCode:
            AsynCommand cmd = new AsynCommand();
            <bean_ref>.localExcute(cmd);

            The AsynCommand class directly Implements the Command interface.

            But JBoss says:
            java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.ServerException: wrong number of arguments; nested exception is:
            java.lang.IllegalArgumentException: wrong number of arguments

            Thnkas for your previous help. I cnaged the method signatures to match precisely the home, remote and bean implementation.

            Cheers
            Muraly


            • 3. Re: Is this is bug with JBoss 3.0!!!
              Juha Lindfors Master

              You must use java.util.Collection as your return type from multi-object finders.

              • 4. Re: Is this is bug with JBoss 3.0!!!
                Muraly Newbie

                Hi,
                Fine...
                I'll do that....


                Any Suggetions about the illegal arguement exception.

                Cheers
                Muraly

                • 5. Re: Is this is bug with JBoss 3.0!!!
                  Juha Lindfors Master

                  show the full stack trace

                  • 6. Re: Is this is bug with JBoss 3.0!!!
                    Danielle Newbie

                    Hi,

                    I'm having the same issue on getting the illegal arguement exception when the remote interface has a parent class as one argument while I'm passing a subclass.

                    java.lang.IllegalArgumentException: wrong number of arguments
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                    java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:324)
                    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
                    tatelessSessionContainer.java:660)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
                    ke(CachedConnectionInterceptor.java:186)
                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
                    elessSessionInstanceInterceptor.java:77)
                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
                    rceptor.java:107)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
                    torCMT.java:178)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
                    0)
                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
                    java:130)
                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
                    at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
                    ner.java:313)
                    at org.jboss.ejb.Container.invoke(Container.java:712)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
                    382)
                    at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:324)
                    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                    at sun.rmi.transport.Transport$1.run(Transport.java:148)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
                    60)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
                    .java:701)
                    at java.lang.Thread.run(Thread.java:536)


                    Any suggestions?

                    Thanks in advance!