The behaviour for CallByValue is described in
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
as:
Call By Value
1. caller does ejb.someMethod()
2. invocation is marshalled - the parameters are turned into ObjectStream?
(a byte[])
3. container with a different classloader unmarshalls - byte[] -> java
Objects - including classloading
4. invocation is passed through ejb container
5. container does bean.someMethod()
6. result is marshalled - the return value is turned into ObjectStream?
7. result is unmarshalled using the caller's classloader - byte[] -> java
Object
8. result is return to the caller
If a call "proxy.f(myType)" is done via Call By Value in step 2. the parameter
myType should be serialized.
I modified MyType to debug de-/serialization:
public class MyType implements Serializable {
| public String str;
| private void writeObject(ObjectOutputStream out) throws IOException
| {
| // debug
| out.defaultWriteObject();
| }
|
| private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException
| {
| in.defaultReadObject();
| // debug
| }
| }
If a call via remote interface is made from a client-java-app the writeObject()
and readObject() methods get called.
If a call is made from inside a SLSB (local interface) neither method gets
called.
So the step 2. (marshall parameters) is missing.
Did I miss something in the configurations?
conf/jboss-service.xml:
...
| <mbean code="org.jboss.naming.NamingService" name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
| <attribute name="CallByValue">true</attribute>
| <attribute name="Port">1099</attribute>
| <attribute name="BindAddress">${jboss.bind.address}</attribute>
| <attribute name="RmiPort">1098</attribute>
| <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
| <depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool</depends>
| </mbean>
| ...
deploy/ear-deployer.xml:
<server>
| <mbean code="org.jboss.deployment.EARDeployer"
name="jboss.j2ee:service=EARDeployer">
| <attribute name="Isolated">true</attribute>
| <attribute name="CallByValue">true</attribute>
| </mbean>
| </server>
EAR1: META-INF/jboss-app.xml:
<jboss-app>
| <loader-repository>mydomain:loader=mycomponent1</loader-repository>
| </jboss-app>
EAR2: META-INF/jboss-app.xml:
<jboss-app>
| <loader-repository>mydomain:loader=mycomponent2</loader-repository>
| </jboss-app>
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969648#3969648
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969648
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user