Hi Joerg,

I did not understand the second exception below (the one you got using
the Sun ORB). The testAny() method does not appear in the stack trace.
Are you sure it was thrown within testAny()?

The first exception (the one you got using JacORB) made sense to me. 
It is not related to the usage of org.omg.CORBA.Any. The rmic-generated 
stub calls javax.rmi.CORBA.Util.isLocal(), which attempts to cast the 
stub delegate to a com.sun.corba class. The cast fails, as the delegate 
is a JacORB delegate (an instance of org.jacorb.orb.Delegate). I have 
seen this problem before. This is a bug in Sun JDK 1.4's implementation 
of javax.rmi.CORBA.Util.isLocal(). (By the way, it appears that this
exception was thrown under JDK 1.4. The stack trace references the
class com.sun.corba.se.internal.iiop.ShutdownUtilDelegate, which I
could not find in JDK 1.3.)

I believe this problem will go away if you run your client under JDK
1.3. A better solution would be to use the IIOP stubs dynamically 
generated by the JBoss server. The JBoss-generated stubs do not call 
the buggy isLocal() method, so they work even with JDK 1.4. (They call
org.omg.CORBA.portable.ObjectImpl._is_local() instead.) Please see a
message with subject "Re: [JBoss-user] IIOP problems with JBoss 3.0.x"
which I have sent to the jboss-user list today. It explains how you
can make your clients use IIOP stubs dynamically downloaded from the 
JBoss server.

Either way (with JDK 1.3 or JBoss-generated stubs) you should be able
to pass the home.create() call and reach the stratserv.testAny(testarg)
call, using JacORB at the client side. I expect testAny() will then 
succeed. Please let me know if this does not happen.

Regards,

Francisco


On Fri, 12 Jul 2002, Pensel, Joerg wrote:

> Hi,
> 
> i have a question concerning IIOP and CORBA Any objects.
> I work with JBoss 3.0.0 (JDK 1.3.1, Linux) and managed to work with IIOP in
> general,
> but i have problems, when i use "Any" objects in the remote interface.
> 
> I generate the stubs with 
> 
>       rmic -classpath ... -iiop classname
> 
> and put them into the Bean-Jar-File and into the client classpath.
> 
> This example illustrates the problems (the lines causing the problems
> are marked with an comment):
> 
> =================================
> 
>       java.util.Hashtable corbaEnv = new java.util.Hashtable();
>       corbaEnv.put( Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.cosnaming.CNCtxFactory" );
>       corbaEnv.put( Context.PROVIDER_URL, "IOR:0000...001" );
> 
>       InitialContext locic = new InitialContext( corbaEnv );
> 
>       StrategyServiceHome home = (StrategyServiceHome)
>       PortableRemoteObject.narrow(
>               locic.lookup("XTRENDEJB/xtrend/strategy/StrategyService"),
>               StrategyServiceHome.class);
>       
>       // The next line generates the error when using JacORB
>       strategyService = (StrategyService)home.create( getSessionKey() );
> 
>       org.omg.CORBA.Any testarg = org.omg.CORBA.ORB.init().create_any();
>       testarg.insert_string( "UUUUUUU" );
> 
>       stratserv.testString( "IIIII" );
> 
>       // This next line causes the error when using the SUN ORB of the JDK
> 1.3.1 
>       stratserv.testAny( testarg );
> 
> ======================================
> 
> The problems are different on using JacORB or the Sun ORB.
> 
> Here the jacORB Stack-Trace:
> 
> ======================================
> 
> java.lang.ClassCastException: org.jacorb.orb.Delegate
>         at
> com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.isLocal(ShutdownUtilDele
> gate.java:39)[ Delegate.getReference with POA < empty> ]
> [ ConnectionManager: found conn to target 172.22.2.103:8683 ]
> java.lang.ClassCastException: org.jacorb.orb.Delegate
>         JacORB V 1.4 beta 4, www.jacorb.org
>         (C) Gerald Brose, FU Berlin, March 2002
> [ Build: org.jacorb.orb.standardInterceptors.IORInterceptorInitializer ]
> [ InterceptorManager started with 0 SIs, 0 CIs and 1 IORIs ]
> [ Delegate.getReference with POA < empty> ]
> [ ConnectionManager: created new conn to target 172.22.2.103:8683 ]
> [ (Pool)[0/1] creating new thread ]
> [ Successfully negotiated Codesets. Using ISO8859_1 as TCS and UTF16 as TCSW
> ]
> [ Trying to connect to 172.22.2.103:8683 ]
> [ (Pool)[1/2] added idle thread ]
> [ (Pool)[0/2] removed idle thread (job scheduled) ]
> [ Succeeded to connect to 172.22.2.103:8683 ]
> [ Delegate.getReference with POA < empty> ]
> [ ConnectionManager: found conn to target 172.22.2.103:8683 ]
> java.lang.ClassCastException: org.jacorb.orb.Delegate
> null
> 16:48:46,117 INFO  [StrategyService] StrategyService: null
>         at javax.rmi.CORBA.Util.isLocal(Util.java:262)
>         at
> com.coi.xtrend.ejb.strategy._StrategyServiceHome_Stub.create(Unknown Source)
>         at
> com.coi.xtrend.ejb.testclient.ClientContext.getStrategyService(ClientContext
> .java:2157)
>         at
> com.coi.xtrend.ejb.testclient.actions.StrategyServiceTestActionDoStrategy.pe
> rformAction(StrategyServiceTestActionDoStrategy.java:44)
>         at
> com.coi.xtrend.ejb.testclient.TestAction.start(TestAction.java:64)
>         at
> com.coi.xtrend.ejb.testclient.ClientAction.actionPerformed(ClientAction.java
> :46)
> ... 
> 
> java.lang.ClassCastException: org.jacorb.orb.Delegate
>         at
> com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.isLocal(ShutdownUtilDele
> gate.java:39)
>         at javax.rmi.CORBA.Util.isLocal(Util.java:262)
>         at
> com.coi.xtrend.ejb.strategy._StrategyServiceHome_Stub.create(Unknown Source)
>         at
> com.coi.xtrend.ejb.testclient.ClientContext.getStrategyService(ClientContext
> .java:2157)
>         at
> com.coi.xtrend.ejb.testclient.actions.StrategyServiceTestActionDoStrategy.pe
> rformAction(StrategyServiceTestActionDoStrategy.java:45)
>         at
> com.coi.xtrend.ejb.testclient.TestAction.start(TestAction.java:64)
>         at
> com.coi.xtrend.ejb.testclient.ClientAction.actionPerformed(ClientAction.java
> :46)
> ...
> ======================================
> 
> And here is the SUN ORB stack trace:
> 
> ======================================
> java.rmi.RemoteException: CORBA UNKNOWN 0 Maybe; nested exception is: 
>         org.omg.CORBA.UNKNOWN:   vmcid: 0x0  minor code: 0 completed: Maybe
>         at
> com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(Shutd
> ownUtilDelegate.java:134)
>         at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
>         at
> com.coi.xtrend.ejb.strategy._StrategyService_Stub.getBssAllXml(Unknown
> Source)
>         at
> com.coi.xtrend.ejb.testclient.actions.StrategyServiceTestActionDoStrategy.pe
> rformAction(StrategyServiceTestActionDoStrategy.java:87)
>         at
> com.coi.xtrend.ejb.testclient.TestAction.start(TestAction.java:64)
>         at
> com.coi.xtrend.ejb.testclient.ClientAction.actionPerformed(ClientAction.java
> :46)
>       ...
> 
> Caused by: org.omg.CORBA.UNKNOWN:   vmcid: 0x0  minor code: 0 completed:
> Maybe
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
> sorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
> torAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at java.lang.Class.newInstance0(Class.java:296)
>         at java.lang.Class.newInstance(Class.java:249)
>         at
> com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(
> ReplyMessage_1_2.java:90)
>         at
> com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientR
> esponseImpl.java:105)
>         at
> com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:30
> 3)
>         at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
>         ... 29 more
> java.rmi.RemoteException: CORBA UNKNOWN 0 Maybe; nested exception is: 
>         org.omg.CORBA.UNKNOWN:   vmcid: 0x0  minor code: 0 completed: Maybe
> 16:40:01,668 ERROR [StrategyService] Unable to execute the strategy.
> java.rmi.RemoteException: CORBA UNKNOWN 0 Maybe; nested exception is: 
>         org.omg.CORBA.UNKNOWN:   vmcid: 0x0  minor code: 0 completed: Maybe
>         at
> com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(Shutd
> ownUtilDelegate.java:134)
>         at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
>         at
> com.coi.xtrend.ejb.strategy._StrategyService_Stub.getBssAllXml(Unknown
> Source)
>         at
> com.coi.xtrend.ejb.testclient.actions.StrategyServiceTestActionDoStrategy.pe
> rformAction(StrategyServiceTestActionDoStrategy.java:87)
>         at
> com.coi.xtrend.ejb.testclient.TestAction.start(TestAction.java:64)
>         at
> com.coi.xtrend.ejb.testclient.ClientAction.actionPerformed(ClientAction.java
> :46)
> 
> ...
> 
> Caused by: org.omg.CORBA.UNKNOWN:   vmcid: 0x0  minor code: 0 completed:
> Maybe
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
> sorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
> torAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at java.lang.Class.newInstance0(Class.java:296)
>         at java.lang.Class.newInstance(Class.java:249)
>         at
> com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(
> ReplyMessage_1_2.java:90)
>         at
> com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientR
> esponseImpl.java:105)
>         at
> com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:30
> 3)
>         at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
>         ... 29 more
> ======================================
> 
> Can anybody help me, please?
> 
> By Jörg
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Gadgets, caffeine, t-shirts, fun stuff.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Gadgets, caffeine, t-shirts, fun stuff.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to