2 Replies Latest reply: May 5, 2012 3:54 AM by Vt Ysh RSS

Access EJB on the same server error

Vt Ysh Newbie

Hello Community

 

I am trying to migrate from Jboss AS 5 to Jboss AS 7.1. I have an EAR file which contains EJB. I am able to successfully access Remote EJB interface in the standalone application. But i can't access either local or remote EJB interface successfully in the separate war application run on the same server. In the AS 5 all works fine. But on AS 7 i keep getting this exception when i try to execute EJB method:

 

java.lang.IllegalArgumentException: object is not an instance of declaring class

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_27]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_27]

          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_27]

          at org.jboss.marshalling.reflect.SerializableClass.callReadResolve(SerializableClass.java:325)

          at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:260)

          at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:135)

          at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:225) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:216) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:133) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:179) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

          at $Proxy31.execute(Unknown Source)          at custom.java.jre.command.CommandUtils.execute(CommandUtils.java:15) [Custom Context.jar:]

 

Can this error happen because i use generics in the ejb method declaration? I remind that in AS 5 all works fine however. Also standalone client works fine.

 

Another question. I am using Jboss Tools for debugging applications on the server. Frequently application deployment fails with the random java.lang.ClassNotFoundException from the application dependencies. Full publish solves the problem usually but not always. What is the reason?