1 Reply Latest reply on Oct 19, 2004 2:42 PM by euluis

    Invalid invocation EJBException on method invoke for create

    hmj

      I'm using JBoss 3.2.3 and get an EJBException when trying to invoke the create method for a Remote EJB running in the same JBoss region but in a different ear. The same code works if the call to the Remote EJB is from a different JBoss region on the same or a different machine.

      Any ideas anyone???

      The exception happens on the last line of this code extract :-

      ...
      ...
      Object objref = ic.lookup("jnp://myserver:namingport/jndiname");
      Class classType = Class.forName("some.package.IMyClassRemoteHome");
      Object obj = PortableRemoteObject.narrow(objref, classType);
      EJBHome home = (EJBHome) obj;
      Method method = homeObject.getClass().getMethod("create", null);
      EJBObject ejbObject = (EJBObject) method.invoke(homeObject, null);
      ...
      ...


      The classes/interfaces are :-

      public class MyClass implements IMyClass, SessionBean{
      ...
      ...
      }
      
      public interface IMyClass {
       public void myMethod(long a, String b);
      }
      
      public interface IMyClassRemote extends EJBObject, IMyClass {
      }
      
      public interface IMyClassRemoteHome extends EJBHome {
       IMyClassRemote create() throws RemoteException , CreateException;
      }
      


      The first part of the exception is :-
      2004-10-15 10:26:50,198 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException:
      javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract some.package.IMyClassRemote some.package.IMyClassRemoteHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:632)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:205)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:51)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:320)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessSessionContainer.java:319)
      at org.jboss.ejb.Container.invoke(Container.java:720)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy69.create(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at MyClass.locateService(MyClass.java:73)
      ...
      ...