I have seen a stack trace like this before. Aren't you using an older 
JacORB version at the client side by any chance?

JBoss requires JacORB 1.4. Neither JacORB 1.3.X or 1.4.betaX will work.

JacORB 1.4 was not yet publicly available when we released JBoss 3.0,
which went out with an unofficial "sneak preview" of JacORB 1.4's
library (jacorb.jar). 

Please use at the client side the jacorb.jar file in the JBoss 3.0
distribution. Or else get JacORB 1.4, which was just released. 
(I didn't test the official JacORB 1.4 GA release with JBoss yet. 
This is the first thing in my todo list. It should work, unless 
there is some last minute surprise.)

Another thing: you should not need any CORBA code in your RMI/IIOP 
clients. Unless you are doing more CORBA stuff, you can remove the
ORB.init() call from your RMI/IIOP clients. There is no need to set the 
"java.naming.corba.orb" property before you construct an InitialContext.
The initial context factory and the provider URL are enough.

Let me know if the problem persists. I was away from this list for a 
few days, but should be able to respond quicker now.

Best,

Francisco

On Mon, 3 Jun 2002, Gerard BUNEL wrote:

> Helo,
> 
> Still trying to use RMI/IIOP with JBoss, and still not working.
> 
> I've forced my client app to use jacorb by setting properties this way:
> 
>     Properties p = new Properties();
>     p.put ("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
>     p.put( "org.omg.CORBA.ORBSingletonClass",
> "org.jacorb.orb.ORBSingleton");
>     _orb = ORB.init( new String[0], p);
> 
> Then, when I try to bind to JNDI with the folowing code:
> 
>   public void run () {
>     InitialContext ic = null;
>     java.util.Hashtable p = new java.util.Hashtable();
>     p.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.cosnaming.CNCtxFactory");
>     p.put(Context.PROVIDER_URL,  _config.getRootContext()); // IOR from
> JBoss
>     p.put("java.naming.corba.orb", _orb);
>     while (true) {
>       Runtime.getRuntime().gc();
>       try {
>         synchronized (this) {
>           this.wait(5000);
>         }
>         if (ic == null) {
>           ic = new InitialContext(p);
>         }
>         ic.rebind( _name, _publisher);
>       } catch (InterruptedException e) {
>         if (ic != null) {
>           try { ic.close(); } catch (Exception ex) {}
>         }
>         try { PortableRemoteObject.unexportObject(_publisher); } catch
> (Exception ex) {}
>         return;
>       } catch (Exception e) {
>        e.printStackTrace();
>       }
>     }
> 
>   }
> 
> I do this to this way so that if JBoss server shuts down, I'll register
> again when it will be up.
> But doing this, an exception i thrown:
> 
> java.lang.ClassCastException:
> com.sun.corba.se.internal.corba.TypeCodeImpl
>         at
> org.jacorb.orb.CDROutputStream.write_value(CDROutputStream.java:1465)
> 
>         at org.jacorb.orb.Any.read_value(Any.java:802)
>         at org.omg.CosNaming.NameHelper.insert(NameHelper.java:49)
>         at
> org.omg.CosNaming._NamingContextStub.rebind(_NamingContextStub.java:99)
>         at com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:475)
> 
>         at com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:567)
>         at com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:584)
>         at javax.naming.InitialContext.rebind(InitialContext.java:366)
>         at
> com.ftrd.cti.server.CTIServerImpl.run(CTIServerImpl.java:2495)
>         at java.lang.Thread.run(Thread.java:484)
> 
> Any Idea where the problem is ?
> When I did the same, but without forcing the use of jacorb, I had
> another Exeption
> 
> --
> [EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/
> Technopole Brest Iroise BP 80802 - Site du Vernis - 29608 Brest cedex -
> France
> Tel. : +33 2 98 05 43 21 - Fax. : +33 2 98 05 20 34
> e-mail: [EMAIL PROTECTED]
> Centre Affaires Oberthur - 74D, rue de Paris -  35700 Rennes - France
> Tel. : +33 2 99 84 15 84 - Fax : +33 2 99 84 15 85
> e-mail: [EMAIL PROTECTED]
> 
> 
> 
> _______________________________________________________________
> 
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to