Hi Krishnan Ramaswamy,

First thank you very much!

and the following is my "steps:-)", and if you have time, please help me to
find where is the problem:

1.  I start "J2SE ORB nameservice" with :   tnameserv -ORBInitialPort 15555
2. run a simple corba server:  java csServer -ORBInitialPort 15555
3. run a simple corba client to test the corba server:  java csClient
-ORBInitialPort 15555. and it is successful
  (the client "invoke a method of corba server" getInfo(),  and return a String
"Hello")
4. start the "server" of jsdk2.1 with  "startserver", and copy my servlet
class(it is also a corba client) to the "servlets folder" of jsdk2.1
5. "invoke " this servlet, and "invoke" corba server, and get "Hello"
6. set JAVA_HOME to my J2SE folder, start Java WEB Server 2.0 with
"httpd.nojre", copy my servlet to the "servlets folder" of JWS2.0
7. invoke this servlet , but I still get the same error(in my last email)
8. if this servlet doesn't "invoke" my corba server, it works well. But if it
"invoke" corba, it doesn't work
9. it seems that in my servlet( in JWS2.0),  the following work well(because
I didn't find any Exception):
  ...
  try{
      String [] argsxxx=new String[2];
      argsxxx[0]="-ORBInitialPort";
      argsxxx[1]="15555";
      ORB orb = ORB.init(argsxxx, null);

      // Get the root naming context
      org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
      NamingContext ncRef = NamingContextHelper.narrow(objRef);

      // Resolve the object reference in naming
      NameComponent nc = new NameComponent("cs", " ");
      NameComponent path[] = {nc};
      csRef = csHelper.narrow(ncRef.resolve(path));
    } catch(Exception e) {
        System.out.println("ERROR in init: \n" + e);
        e.printStackTrace(System.out);
      }
      ...

But the following does not work(because I find error listed in my last email):
 ...
  try{
  System.out.println("begin to call corba");
       s_in=csRef.getInfo();   //"getInfo " should return a String "Hello"
  System.out.println("end to call corba");
    } catch(Exception e) {
        System.out.println("ERROR in service: \n" + e);
        e.printStackTrace(System.out);
      }
  ...


So:
why my servlet woks well with jsdk2.1, but doesn't work with JWS2.0?  because
I use "httpd.nojre" to start JWS2.0, and I set JAVA_HOME, and in my CLASSPATH,
I "set my.jar", my.jar "include" all the classes
in the "folder csApp", csAPP is made by idltojava, cs.idl is:
module csApp
{
  interface cs
  {
    string getInfo();
  };
};

so I think JWS2.0 works in the same "enviroment" with j2sdk2.1, but it doesn't
work if my servlet "invoke corba server".


Thanks in advance for your help!




Bo
May 09,2000









Krishnan Ramaswamy wrote:

> Hi ,
> There can be two reasons for this ,
> 1 ) When u compile u'r java files make sure to use the bootclasspath option
> , i.e u need to give the J2 ORB's classpath along with the .jar file name,
> so that while compiling ,u'r ORB's classes gets loaded first and then u'r
> JDK's classes gets loaded
> 2) In case of Visigenic , u need to give some options in the command line to
> run the client .These options can be given only if u use JSWDK . In case of
> JavaWebserver , i don't think there are any options that can be given from
> the command line .
>
> -----Original Message-----
> From: Bo Xu [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 09, 2000 12:44 AM
> To: [EMAIL PROTECTED]
> Subject: about servlet and corba
>
> Hi,
>
> I want to use a servlet to "invoke a  corba(J2 ORB) server".  My
> enviroment is: solaris+Java WEB Server2.0",    and I  use "httpd.nojre" to
> use
> J2SE.  But  I find the following error:
>
> javawebserver: ERROR : org.omg.CORBA.COMM_FAILURE:   minor code: 1
> completed:
> No
> javawebserver: org.omg.CORBA.COMM_FAILURE:   minor code: 1  completed: No
> javawebserver:  at java.lang.Throwable.fillInStackTrace(Native Method)
> javawebserver:  at java.lang.Throwable.fillInStackTrace(Compiled Code)
> javawebserver:  at java.lang.Throwable.<init>(Compiled Code)
> javawebserver:  at java.lang.Exception.<init>(Compiled Code)
> javawebserver:  at
> java.lang.RuntimeException.<init>(RuntimeException.java:47)
> javawebserver:  at
> org.omg.CORBA.SystemException.<init>(SystemException.java:49)
>
> javawebserver:  at org.omg.CORBA.COMM_FAILURE.<init>(COMM_FAILURE.java:77)
> javawebserver:  at org.omg.CORBA.COMM_FAILURE.<init>(COMM_FAILURE.java:63)
> javawebserver:  at com.sun.CORBA.iiop.ConnectionTable.get(Compiled Code)
> javawebserver:  at
> com.sun.CORBA.iiop.GIOPImpl.createRequest(GIOPImpl.java:78)
> javawebserver:  at
> com.sun.CORBA.iiop.GIOPImpl.createRequest(GIOPImpl.java:62)
> javawebserver:  at
> com.sun.CORBA.idl.GenericCORBAClientSC.createRequest(GenericCORBAClientSC.ja
> va:138)
>
> javawebserver:  at com.sun.CORBA.idl.RequestImpl.doInvocation(Compiled Code)
> javawebserver:  at
> com.sun.CORBA.idl.RequestImpl.invoke(RequestImpl.java:219)
>
> ********************
> javawebserver:  at csApp._csStub.getInfo(_csStub.java:30)
> javawebserver:  at cs_servlet.service(cs_servlet.java:58)
> (Line 58 of cs_servlet.java is:  s_in=csRef.getInfo();    and getInfo()
> return
> a String "Hello" from the "corba server"
> ********************
>
> javawebserver:  at javax.servlet.http.HttpServlet.service(Compiled Code)
> javawebserver:  at com.sun.server.ServletState.callService(Compiled Code)
> javawebserver:  at com.sun.server.ServletManager.callServletService(Compiled
> Code)
> javawebserver:  at
> com.sun.server.http.servlet.InvokerServlet.service(InvokerServlet.java:137)
> javawebserver:  at javax.servlet.http.HttpServlet.service(Compiled Code)
> javawebserver:  at com.sun.server.ServletState.callService(Compiled Code)
> javawebserver:  at com.sun.server.ServletManager.callServletService(Compiled
> Code)
> javawebserver:  at
> com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423)
> javawebserver:  at
> com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79)
> javawebserver:  at com.sun.server.http.stages.Runner.process(Compiled Code)
> javawebserver:  at com.sun.server.ProcessingSupport.process(Compiled Code)
> javawebserver:  at com.sun.server.Service.process(Compiled Code)
> javawebserver:  at
> com.sun.server.http.HttpServiceHandler.handleRequest(Compiled
> Code)
> javawebserver:  at
> com.sun.server.http.HttpServiceHandler.handleRequest(Compiled
> Code)
> javawebserver:  at com.sun.server.HandlerThread.run(Compiled Code)
>
> So has anybody used "servlet-corba(J2 ORB) ? or could you tell me where is
> the
> problem?
>
> Thanks in advance!
>
> Bo
> May 08,2000
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to