Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call CORBA API inside Servlet?

 
ye zhang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to call CORBA API inside a Servlet:
ORB orb = ORB.init();
FileInputStream fis = new FileInputStream(iorFile);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String ior = br.readLine();
org.omg.CORBA.Object objRef = orb.string_to_object(ior);
server = ISpmServerHelper.narrow(objRef);
fis.close();
which gives me runtime error as:
500 Internal Server Error
The servlet named MyProj.Proj1 at the requested URL http://127.0.0.1/servlet/MyProj.Proj1
reported this exception: Unable to find class org.omg.CORBA.ORB. Please report this to the administrator of the web server.
java.lang.ClassNotFoundException: Unable to find class org.omg.CORBA.ORB at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at java.lang.ClassNotFoundException.(Compiled Code) at com.sun.server.loader.DirectoryClassLoader.getClassFromLocalDir(Compiled Code) at com.sun.server.loader.DirectoryClassLoader.loadRequestedClass(Compiled Code) at com.sun.server.loader.URLClassLoader.loadRequestedClass(Compiled Code) at com.sun.server.loader.JarClassLoader.loadRequestedClass(Compiled Code) at com.sun.server.loader.ServletClassLoader.loadClass(Compiled Code) at com.sun.server.loader.ServletClassLoader.loadClass(Compiled Code) at com.sun.server.loader.JarClassLoader.loadClass(Compiled Code) at
If you have CORBA experience in Servlet, please help.
Thanks,
ye
 
Prasad Charasala
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Check your code, do you have import statements
import org.omg.corba.*; like that???

------------------
Prasad
 
ye zhang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I do have imported all the needed package, otherwise, the code will not compile.
This is a runtime exception.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your servlet container will have a separate classpath mechanism from your compiler (they don't even have to be on the same machine!). If you let us know what servlet container you are using, and where your CORBA class files are located we should be able to help you.
 
ye zhang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank, thanks for your information.
I have JavaWebServer2.0 installed on my Unix box: /opt/SUNJws/JavaWebServer2.0/. The classes I used are under lib/*.jar; The CORBA class file I used is /local/server/SPMCorba.jar. Plus, I use the file /local/IOR/spm.ior to init the CORBA environment.

ye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic