-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
EJB 3.0 RC9 - Patch 1
-
None
-
Workaround Exists
-
Note that this issue occurs only if the EARDeployer's attribute Isolated in ear-deployer.xml is set to true.
We have a deployment schema similar to the example from EJB 3.0 specification (chapter 19.6 Example):
ear1:
FirstReferencer.jar Class-Path:FirstReferencer-client.jar SecondReferencer-client.jar
FirstReferencer-client.jar
SecondReferencer-client.jar
ear2:
SecondReferencer.jar Class-Path:SecondReferencer-client.jar
SecondReferencer-client.jar
deployment descriptor contains:
<ejb-client-jar>SecondReferencer-client.jar</ejb-client-jar>
There are two session beans FirstReferencer and SecondReferencer. FirstReferencer references SecondReferencer over the dependency injection. After deployment if we call the business method on the FirstReferencer, which in turn calls SecondReferencer we get exception like this:
16:22:12,155 ERROR [STDERR] java.lang.RuntimeException: Non matching type for inject of field: SecondReferencer FirstReferencerEjb.secondReferencer for type: $Proxy79 of jndiName env/FirstReferencerEjb/secondReferencer
intfs: , SecondReferencer, org.jboss.ejb3.JBossProxy, javax.ejb.EJBObject
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:135)
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:104)
16:22:12,155 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:61)
16:22:12,155 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:92)
16:22:12,155 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
16:22:12,165 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:209)
16:22:12,165 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:303)
16:22:12,165 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
16:22:12,165 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
16:22:12,175 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
16:22:12,185 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException
16:22:12,185 ERROR [STDERR] at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
16:22:12,185 ERROR [STDERR] at java.lang.reflect.Field.set(Field.java:656)
16:22:12,185 ERROR [STDERR] at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:119)
16:22:12,185 ERROR [STDERR] ... 13 more
On debuging and from the stacktrace of the exception we can see that the lookup for refernced EJB works fine but the assigning over reflaction fails. It seems to be a ClassLoading issue there.