Problems with Remote EJB as seam component on WebLogic 10.0 MP1/10.3
---------------------------------------------------------------------
Key: JBSEAM-4080
URL:
https://jira.jboss.org/jira/browse/JBSEAM-4080
Project: Seam
Issue Type: Bug
Components: EJB3
Affects Versions: 2.1.1.GA, 2.0.2.SP1
Environment: WebLogic 10.0 MP1/10.3
Reporter: Hiroyuki Wada
There are two problems using Remote EJB as Seam Component on WebLogic 10.0 MP0/10.3.
1) Seam Interceptos(BijectionInterceptro etc.) aren't executed.
Because of SessionBeanInterceptor can't initizalize Remote EJB on WebLogic 10.0/10.3,
seam interceptors aren't executed. so it cause some problems, for example failure of
injection by @In.
2) Cannot access to Unserializable Application Context Component from Remote EJB.
I don't know why, but when access to ServletContext data in EJB Remote Object on
WebLogic, serialize/deserialize is performed.
In my reproduce app, there is NotSerializable application context component which injected
at Remote EJB Component. so it cause NotSerializableException as follows.
--
java.io.NotSerializableException: org.jboss.seam.example.remoteejb.AppData
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at weblogic.common.internal.PassivationUtils.toByteArray(PassivationUtils.java:33)
at weblogic.common.internal.PassivationUtils.toByteArray(PassivationUtils.java:24)
at weblogic.common.internal.PassivationUtils.copy(PassivationUtils.java:64)
at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:100)
at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:52)
at weblogic.servlet.internal.AttributesMap.get(AttributesMap.java:62)
at
weblogic.servlet.internal.WebAppServletContext.getAttribute(WebAppServletContext.java:482)
at org.jboss.seam.servlet.ServletApplicationMap.get(ServletApplicationMap.java:54)
at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:49)
at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:219)
at org.jboss.seam.Component.getInstance(Component.java:1949)
at org.jboss.seam.Component.getInstance(Component.java:1944)
at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2311)
at org.jboss.seam.Component.getValueToInject(Component.java:2263)
at org.jboss.seam.Component.injectAttributes(Component.java:1703)
at org.jboss.seam.Component.inject(Component.java:1521)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.--
I created a patch for fix these problems.
I describe how I fix.
Problem 1)
In weblogic, it seems that EJB Remote class is generated by weblogic ejb compiler, and
InvocationContext#getTarget() return a class which don't have @Name annotation. So
SessionBeanInterceptor can't initizalize this class correctly.
I found the super class of the generated class has @Name annotation.
so I fixed handling target class.
Problem 2)
I don't know why weblogic serialize/deserialize object when access to ServletContext
in EJB Remote Object, it comes from the ContextClassLoader difference.
In EJB Remote Object, the ContextClassLoader is EAR ClassLoader.
In contrast, WAR ClassLoader is used when accessed from JSF,
so I set WAR ClassLoader to ContextClassLoader before calling
InvocationContext#proceed().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira