So, in ejb 3.0, we still only support pass by value (serialization), we do
not support pass by proxy; which mean there is no way a parameter can be out
or inout.
Am I right here? If not, please provide a sample of out or inout parameters
for ejb using remote interface.
Thanks,
Ning
-----Original Message-----
From: Ken.Cavanaugh_at_Sun.COM [mailto:Ken.Cavanaugh_at_Sun.COM]
Sent: Thursday, June 22, 2006 5:57 PM
To: Ning Zhu
Cc: Kenneth.Saks_at_Sun.COM; corba-dev_at_Sun.COM; ejb_at_glassfish.dev.java.net
Subject: Re: Holder Class Error
Ning Zhu wrote:
> Here is the stack tracing:
>
> java.lang.ClassCastException: org.omg.CORBA.BooleanHolder
> at
>
com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(
> DynamicMethodMarshallerImpl.java:338)
> at
>
com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArgu
> ments(DynamicMethodMarshallerImpl.java:407)
> at
>
com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvo
> ke(StubInvocationHandlerImpl.java:157)
> at
>
com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(Stub
> InvocationHandlerImpl.java:119)
> at
>
com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase
> .java:197)
> at
>
asp.dorp.__Content_Remote_DynamicStub.getContentbyID(__Content_Remote_Dynami
> cStub.java)
> at
> asp.dorp._Content_Wrapper.getContentbyID(asp.dorp._Content_Wrapper.java)
> at test.Main.main(Main.java:33)
>
>
Do NOT use BooleanHolder here. BooleanHolder is not Serializable, and so
it is not
an RMI-IIOP value type. BooleanHolder (and all of the other
org.omg.*Holder classes)
are present for handling IDL out parameters, and cannot be used with
RMI-IIOP.
The ClassCastException occurs because the ORB code must cast the value to
Serializable.
To return a boolean result, you should either use a boolean[], or a
simple Serializable
wrapper class.
Ken.