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)
Thanks,
Ning
-----Original Message-----
From: Kenneth.Saks_at_Sun.COM [mailto:Kenneth.Saks_at_Sun.COM]
Sent: Thursday, June 22, 2006 4:25 PM
To: Ning Zhu; corba-dev_at_Sun.COM
Cc: ejb_at_glassfish.dev.java.net
Subject: Re: Holder Class Error
Ning Zhu wrote:
>Hi,
>
Hi Ning,
I'm forwarding the note to the corba team to see if they know why
org.omg.CORBA.BooleanHolder is causing that exception. Please also post
the full stack trace. You can also just send the boolean as a return
value or write a simple struct class that holds your in/out parameters.
--ken
>
>We are running into a new problem, which is about "Holder" class. When we
>trying to do output and in/out parameters for ejb, we just start from a
very
>simple test and here is the code:
>
>// asp.dorp.Content
>
>package asp.dorp;
>import javax.ejb.Remote;
>@Remote
>public interface Content {
> void getContentbyID(org.omg.CORBA.BooleanHolder rights);
>}
>
>//asp.dorp.ContentBean
>
>package asp.dorp;
>import javax.ejb.Stateless;
>@Stateless
>public class ContentBean implements asp.dorp.Content {
> public ContentBean() {
> }
>
> public void getContentbyID(org.omg.CORBA.BooleanHolder rights) {
> rights.value = true;
> }
>}
>
>// Test client, standalone client from same app server, not enterprise
>client
>
>package test;
>
>public class Main {
> public Main() {
> }
>
> public statis void main(String[] args) {
> org.omg.CORBA.BooleanHolder rights = new
>org.omg.CORBA.BooleanHolder(false);
> try {
> javax.naming.InitialContent ic = new javax.naming.InitialContent();
> asp.dorp.Content local = (asp.dorp.Content)
>ic.lookup("asp.dorp.Content");
> local.getContentbyID(rights);
> // this is where we always getting an error of
>java.lang.ClassCastException: org.omg.CORBA.BooleanHolder
> }
> catch(Exception e){}
> }
>}
>
>We have no clue how to use this holder class now. Could you help us?
>
>Ning
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>
>
>