about jacob and jdk's corba implmentation

D

david wolf

Hi All,

I am using java to connect to a CORBA Service. I used to use jdk's
corba implementation to connect to the service. Now I swithed to
Jacorb. Since Jacor and JDK both have corba implementation, when I use
ant to compile my code, how to make sure my code actually use JACORB's
implementation instead of JDK's (I checked, the classes related to
corba in both implementation has the same fully qualified class names).

I quoted a piece of code from my ant build.xml. I put jacorb's lib in
the front, while java's lib (that is, ${myjava.home}/lib) later. Will
this do what I want?

<path id="compile.classpath">
<fileset dir ="${jacorb.home}/lib">
<include name="*.jar"/>
</fileset>

<fileset dir ="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>

<fileset dir ="${myjava.home}/lib">
<include name="*.jar"/>
</fileset>
</path>

Thanks,

David
 
A

Andreas Wollschlaeger

david said:
Hi All,

I am using java to connect to a CORBA Service. I used to use jdk's
corba implementation to connect to the service. Now I swithed to
Jacorb. Since Jacor and JDK both have corba implementation, when I use
ant to compile my code, how to make sure my code actually use JACORB's
implementation instead of JDK's (I checked, the classes related to
corba in both implementation has the same fully qualified class names).

I quoted a piece of code from my ant build.xml. I put jacorb's lib in
the front, while java's lib (that is, ${myjava.home}/lib) later. Will
this do what I want?

Usually, your code would use the classes under org.OMG.... , coming with
the SDK. The actual ORB implementation is then chosen at *runtime*,
defined by the java properties org.omg.CORBA.ORBClass and
org.omg.CORBA.ORBSingletonClass (see docs for org.omg.CORBA.ORB)
If jacorb really comes with the org.OMG.** classes packed inside, i'd
consider this as a misfeature :-(

You might verify the correct use of jacorb by issuing some

System.out.println(myOrb.getClass().getName())

on your ORB instance, just to sure...

HTH
Andreas
 
D

david wolf

Hi Andreas,

Thanks for your reply. JDK and Jacorb do have the same qualified class
names starting with org.omg. See following for details.

C:\jdk1.5\jre\lib>jar tvf rt.jar|grep "org/omg/CORBA/ORB"|more
439 Wed May 03 02:00:12 CDT 2006
com/sun/corba/se/org/omg/CORBA/ORB.class
582 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB$1.class
1469 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB$2.class
8226 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB.class
336 Wed May 03 01:29:06 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
e.class
318 Wed May 03 01:29:06 CDT 2006
org/omg/CORBA/ORBPackage/InvalidName.class

C:\JacORB_2.3.0_beta2\lib>jar tvf jacorb.jar|grep "org/omg/CORBA/ORB"
0 Sat Oct 14 21:45:40 CDT 2006 org/omg/CORBA/ORBPackage/
6024 Sat Oct 14 21:47:34 CDT 2006 org/omg/CORBA/ORB.class
424 Sat Oct 14 21:45:38 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
e.class
2006 Sat Oct 14 21:45:38 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
eHelper.class
397 Sat Oct 14 21:47:34 CDT 2006
org/omg/CORBA/ORBPackage/InvalidName.class
1925 Sat Oct 14 21:45:30 CDT 2006
org/omg/CORBA/ORBPackage/InvalidNameHelper.c
lass

I use what you suggested
"System.out.println(myOrb.getClass().getName())", I printed following
info:

11:03:07,978 INFO [STDOUT] com.sun.corba.se.impl.orb.ORBImpl

So I guess I am using sun's implementation. How to switch to Jacorb's
library ? Like I tried before in ant's setting, I am not sure how to
use jacorb's lib since both JDK and jacorb have the same fully
qualified class name.

Thanks,

David
 
D

david wolf

I found the answer for my own problem.

Here is the answer link I found on the web:
http://www.theaceorb.com/faq/index.html#070

David


david said:
Hi Andreas,

Thanks for your reply. JDK and Jacorb do have the same qualified class
names starting with org.omg. See following for details.

C:\jdk1.5\jre\lib>jar tvf rt.jar|grep "org/omg/CORBA/ORB"|more
439 Wed May 03 02:00:12 CDT 2006
com/sun/corba/se/org/omg/CORBA/ORB.class
582 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB$1.class
1469 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB$2.class
8226 Wed May 03 01:29:06 CDT 2006 org/omg/CORBA/ORB.class
336 Wed May 03 01:29:06 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
e.class
318 Wed May 03 01:29:06 CDT 2006
org/omg/CORBA/ORBPackage/InvalidName.class

C:\JacORB_2.3.0_beta2\lib>jar tvf jacorb.jar|grep "org/omg/CORBA/ORB"
0 Sat Oct 14 21:45:40 CDT 2006 org/omg/CORBA/ORBPackage/
6024 Sat Oct 14 21:47:34 CDT 2006 org/omg/CORBA/ORB.class
424 Sat Oct 14 21:45:38 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
e.class
2006 Sat Oct 14 21:45:38 CDT 2006
org/omg/CORBA/ORBPackage/InconsistentTypeCod
eHelper.class
397 Sat Oct 14 21:47:34 CDT 2006
org/omg/CORBA/ORBPackage/InvalidName.class
1925 Sat Oct 14 21:45:30 CDT 2006
org/omg/CORBA/ORBPackage/InvalidNameHelper.c
lass

I use what you suggested
"System.out.println(myOrb.getClass().getName())", I printed following
info:

11:03:07,978 INFO [STDOUT] com.sun.corba.se.impl.orb.ORBImpl

So I guess I am using sun's implementation. How to switch to Jacorb's
library ? Like I tried before in ant's setting, I am not sure how to
use jacorb's lib since both JDK and jacorb have the same fully
qualified class name.

Thanks,

David

Andreas said:
Usually, your code would use the classes under org.OMG.... , coming with
the SDK. The actual ORB implementation is then chosen at *runtime*,
defined by the java properties org.omg.CORBA.ORBClass and
org.omg.CORBA.ORBSingletonClass (see docs for org.omg.CORBA.ORB)
If jacorb really comes with the org.OMG.** classes packed inside, i'd
consider this as a misfeature :-(

You might verify the correct use of jacorb by issuing some

System.out.println(myOrb.getClass().getName())

on your ORB instance, just to sure...

HTH
Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top