[jboss-jira] [JBoss JIRA] Closed: (EJBTHREE-862) EJB 3.0 dependencies injection accross EARs
Alexey Loubyansky (JIRA)
jira-events at lists.jboss.org
Mon May 19 06:58:02 EDT 2008
[ http://jira.jboss.com/jira/browse/EJBTHREE-862?page=all ]
Alexey Loubyansky closed EJBTHREE-862.
--------------------------------------
Resolution: Rejected
In my opinion, this is an application and/or server configuration issue but not a bug.
Check out http://wiki.jboss.org/wiki/ClassLoadingConfiguration. Specifically "Accessing EJBs in isolated ears".
You have to serialize JNDI access. Either set CallByValue for NamingService to true (in conf/jboss-service.xml) or specify the full lookup scheme in jboss.xml (see the wiki page) or with annotations:
public class FirstBean implements First
{
@EJB(mappedName="jnp://localhost:1099/externalrefscoped/Second")
private Second second;
I've modified the testcase in ejb3/core to demonstrate this.
> EJB 3.0 dependencies injection accross EARs
> -------------------------------------------
>
> Key: EJBTHREE-862
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-862
> Project: EJB 3.0
> Issue Type: Bug
> Components: EJB3 Extensions
> Affects Versions: EJB 3.0 RC9 - Patch 1
> Environment: Windows, JDK 1.5.0_06-b05, JBoss 4.0.5 GA, EJB-3.0_RC9 Patch 1
> Reporter: Roland Räz
> Assigned To: Alexey Loubyansky
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list