InitialContext and javax.rmi.PortableRemoteObject

I've been trying to locate a very annoying problem that I get when I try to bind remote objects in JNDI. I have now located the problem but I have no idea why this causes a problem or how to fix it. It seems that creating an InitialContext has different effects depending whether I create an instance of javax.rmi.PortableRemoteObject before.
Here's what I am doing...
1:Context ctx = new InitialContext(); //Create Initial context
2://Instantiate remote object (extends PortableRemoteObject and stubs gen with rmic with -iiop flag)
3:Hello hello = new HelloImpl();
4:ctx.rebind("hello", hello); //Bind to JNDI
5:System.out.println("Object bound!!!!!");
This code works fine. The problem occurs when I try to instantiate the remote object before creating the InitialContext for the first time (I.e. I move line 3 to the top) I then get the following exception:
2007-aug-13 09:32:26 com.sun.corba.ee.impl.util.Utility autoConnect
VARNING: "IOP00511403: (INV_OBJREF) Class rmi.HelloImpl not exported, or else is actually a JRMP stub"
org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 1403 completed: No
at com.sun.corba.ee.impl.logging.UtilSystemException.objectNotExported(UtilSystemException.java:569)
at com.sun.corba.ee.impl.logging.UtilSystemException.objectNotExported(UtilSystemException.java:592)
at com.sun.corba.ee.impl.util.Utility.autoConnect(Utility.java:147)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.writeAny(Util.java:323)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$10.write(DynamicMethodMarshallerImpl.java:256)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeArguments(DynamicMethodMarshallerImpl.java:407)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:157)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:119)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:197)
at com.sun.enterprise.naming._SerialContextProvider_DynamicStub.rebind(_SerialContextProvider_DynamicStub.java)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:403)
at javax.naming.InitialContext.rebind(Unknown Source)
at parlayxws.usecases.ejb.px_spec_v2_1.RunEjb.main(RunEjb.java:43)
Exception in thread "main" javax.naming.CommunicationException: java.rmi.NoSuchObjectException: CORBA INV_OBJREF 1398080891 No; nested exception is:
org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 1403 completed: No
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:405)
at javax.naming.InitialContext.rebind(Unknown Source)
at parlayxws.usecases.ejb.px_spec_v2_1.RunEjb.main(RunEjb.java:43)
I assume the problem is in the javax.rmi.PortableRemoteObject's (HelloImpl's) constructor since that is the only code that's beeing executed. But how could that effect the instantiation of the InitialContext? I should also say that it seems that it is only the first time that an InitialContext is created that is critical. If I create on instance of it before instantiating the first PortableRemoteObject, all subsequently created instances of InitialContext succeed in binding remote (RMI-IIOP) objects.
Can someone help me understand why this happens and how to avoid it? I don't want to have to create an InitialContext the first thing I do in the code. It seems the PortableRemoteObject constructor somehow changes the configuration in a way that makes the bindings fail... How? Why? Can I prevent it from happening?
Any input appreciated!
Kristofer

my bean is running in my EJBServer, and I have it in the classpath of the RmiRegistry (which runs as part of my server). The RmiRegistry is an actual ".bat" file that starts an RMI Registry (I assume).
The client is not a bean and is run like this:
java com.titan.cabin.Client_1
All it does is create a cabin and then read it back. It works, it not only gets the context, but also creates, persists and reads that cabin bean.
Is it because java automatically finds all RmiRegistries running on the computer? This makes sense, but I read on java.sun.com that you need a stub class for your clients. And if it is true, then how does it get the context and remote/home interface of a bean on another server?

Similar Messages

  • JNDI in ActiveX : javax.rmi.PortableRemoteObject.narrow() can't work ?

    Hi All,
    I got a big head ache of this problem for several days, much appreciated if
    I can get help from you.
    The problem is, I wrote an EJB and already deployed it into Weblogic5.1. I
    also wrote a java EJB client to access this EJB. Everything seemed ok at
    this moment.
    The problem occured after i convert this EJB client to ActiveX and test it
    with Microsoft ActiveX Control Test Container. I log each step in the
    ActiveX, and find the problem is caused by
    javax.rmi.PortableRemoteObject.narrow(). Below is my source code and log
    information. My environment is Server side(weblogic5.1),Client side(java
    run-time3.1 with plug-in).
    Source code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFacto
    ry");
    env.put(Context.PROVIDER_URL,"t3://"+ip+":"+port);
    try{
    Log("Init jndi ");
    InitialContext ctx = new InitialContext(env);
    Log("Search Home ");
    Object obj = ctx.lookup("ServiceManagerHome");
    Log("home is "+obj);
    Log("narrow from "+obj.getClass().getName());
    Log("narrow to "+ServiceManagerHome.class.getName());
    obj = PortableRemoteObject.narrow(obj,ServiceManagerHome.class);
    Log("narrow home is "+obj);
    serviceHome = (ServiceManagerHome)obj;
    Log("cast home"+serviceHome);
    serviceManager = serviceHome.create();
    Log("Create EJB bean "+serviceManager);
    } catch (Exception e){
    Log("Err-"+e);
    Log("Err-"+e.getLocalizedMessage());
    Log("Err-"+e.getMessage());
    Log information for ActiveX:
    Init jndi
    Search Home
    home is ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    narrow from rm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    Err-java.lang.ClassCastException
    Err-null
    Err-null
    Log information for java EJB Client:
    Init jndi
    Search Home
    home is
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    narrow from crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    narrow home
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    cast
    homecrm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-461190079431
    9518045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    Create serviceManager
    crm.service.ejbimpl.ServiceManagerBeanEOImpl_ServiceStub@-461190079431951804
    5S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome_EO [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/258

    Contact support.
    Yuan Ming Lei wrote:
    Hi All,
    I got a big head ache of this problem for several days, much appreciated if
    I can get help from you.
    The problem is, I wrote an EJB and already deployed it into Weblogic5.1. I
    also wrote a java EJB client to access this EJB. Everything seemed ok at
    this moment.
    The problem occured after i convert this EJB client to ActiveX and test it
    with Microsoft ActiveX Control Test Container. I log each step in the
    ActiveX, and find the problem is caused by
    javax.rmi.PortableRemoteObject.narrow(). Below is my source code and log
    information. My environment is Server side(weblogic5.1),Client side(java
    run-time3.1 with plug-in).
    Source code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFacto
    ry");
    env.put(Context.PROVIDER_URL,"t3://"+ip+":"+port);
    try{
    Log("Init jndi ");
    InitialContext ctx = new InitialContext(env);
    Log("Search Home ");
    Object obj = ctx.lookup("ServiceManagerHome");
    Log("home is "+obj);
    Log("narrow from "+obj.getClass().getName());
    Log("narrow to "+ServiceManagerHome.class.getName());
    obj = PortableRemoteObject.narrow(obj,ServiceManagerHome.class);
    Log("narrow home is "+obj);
    serviceHome = (ServiceManagerHome)obj;
    Log("cast home"+serviceHome);
    serviceManager = serviceHome.create();
    Log("Create EJB bean "+serviceManager);
    } catch (Exception e){
    Log("Err-"+e);
    Log("Err-"+e.getLocalizedMessage());
    Log("Err-"+e.getMessage());
    Log information for ActiveX:
    Init jndi
    Search Home
    home is ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    narrow from rm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    Err-java.lang.ClassCastException
    Err-null
    Err-null
    Log information for java EJB Client:
    Init jndi
    Search Home
    home is
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    narrow from crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub
    narrow to crm.service.ejbimpl.ServiceManagerHome
    narrow home
    crm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-4611900794319518
    045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259]
    cast
    homecrm.service.ejbimpl.ServiceManagerBeanHomeImpl_ServiceStub@-461190079431
    9518045S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/259
    Create serviceManager
    crm.service.ejbimpl.ServiceManagerBeanEOImpl_ServiceStub@-461190079431951804
    5S155.161.96.26:[7001,7001,7002,7002,7001,-1] ServiceManagerHome_EO [
    -4611900794319518045S155.161.96.26:[7001,7001,7002,7002,7001,-1]/258

  • Javax.rmi.portableRemoteObject.narrow

    Hi
    Pls tell me why we narrow the instance of the object we looked up,
    before type casting it to a home referance by using javax.rmi.portableRemoteObject.narrow(Object,Home.class)

    In the early days of EJB this call was required to ensure portability due to some intracacies of how
    RMI-IIOP and CORBA ORBs are implemented. Some implementations are able to directly return
    the correctly typed object from the lookup, but in others the extra PortableRemoteObject.narrow
    call is necessary, so always using it ensures portability.
    Starting in Java EE 5, PortableRemoteObject.narrow is not needed if the code is either accessing
    a Remote 3.0 Business Interface or if the code is accessing a 2.x style Home object using
    @EJB or the new EJBContext.lookup method.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • A error from javax.rmi.PortableRemoteObject.narrow

    --run envrionment: jdk1.4.2_01 / oc4j9.0.4
    --source code
    import java.util.*;
    import java.io.IOException;
    import java.rmi.RemoteException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.sql.*;
    public class ProductServlet extends HttpServlet
    server.ProductHome myProductHome;
    public void init() throws ServletException {
    try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost/JDBCEJB");
    env.put(Context.SECURITY_PRINCIPAL, "store_user");
    env.put(Context.SECURITY_CREDENTIALS, "store_password");
    Context myInitialContext = new InitialContext(env);
    Object homeObject = myInitialContext.lookup("ProductBean");
    myProductHome = (server.ProductHome)PortableRemoteObject.narrow(homeObject,server.ProductHome.class);
    } catch(NamingException e) {
    throw new ServletException("Error looking up home", e);
    public void doGet(
    HttpServletRequest request, HttpServletResponse response
    ) throws ServletException, IOException {
    response.setContentType("text/html;charset=BIG5");
    ServletOutputStream out = response.getOutputStream();
    out.println("<html>");
    out.println("<head><title>Product</title></head>");
    out.println("<body>");
    out.println("<table width=100% border=1>");
    out.println("<tr>");
    out.println("<th>Id</th>");
    out.println("<th>Name</th>");
    out.println("<th>Address</th>");
    out.println("<th>Bdate</th>");
    out.println("</tr>");
    try {
    server.ProductRemote myProductRemote = myProductHome.create();
    server.Product myProduct = myProductRemote.query(request.getParameter("guess"));
    if (myProduct != null) {
    out.println("<tr>");
    out.println("<td>" + myProduct.id + "</td>");
    out.println("<td>" + myProduct.name + "</td>");
    out.println("<td>" + myProduct.ads + "</td>");
    out.println("<td>" + myProduct.bdate + "</td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</body></html>");
    } catch(RemoteException e) {
    out.println("Error communicating with EJB-server: " +
    e.getMessage());
    } catch(CreateException e) {
    out.println("Error creating EJB: " + e.getMessage());
    } catch(SQLException e) {
    out.println("SQL Exception: " + e.getMessage());
    --My application client can run correctly, but my servlet code can't run.
    --If I start oc4j by follow statement:
    java -jar oc4j.jar
    --the error display:
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at ProductServlet.init(ProductServlet.java:39)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.loadServlet(HttpApplication.java:2091)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.findServlet(HttpApplication.java:4507)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2410)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:629)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    --If I start oc4j by follow statement:
    java -jar -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject -Djavax.rmi.CORBA.UtilClass=com.sum.corba.se.internal.POA.ShutdownUtilDelegate oc4j.jar
    --the error is:
    java.lang.ExceptionInInitializerError
         at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(PortableRemoteObject.java:179)
         at javax.rmi.PortableRemoteObject.<clinit>(PortableRemoteObject.java:58)
         at ProductServlet.init(ProductServlet.java:39)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.loadServlet(HttpApplication.java:2091)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.findServlet(HttpApplication.java:4507)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2410)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:629)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: org.omg.CORBA.INITIALIZE: cannot instantiate com.sum.corba.se.internal.POA.ShutdownUtilDelegate vmcid: 0x0 minor code: 0 completed: No
         at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:341)
         at javax.rmi.CORBA.Util.<clinit>(Util.java:51)
         ... 12 more

    --run envrionment: jdk1.4.2_01 / oc4j9.0.4
    --source code
    import java.util.*;
    import java.io.IOException;
    import java.rmi.RemoteException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.sql.*;
    public class ProductServlet extends HttpServlet
    server.ProductHome myProductHome;
    public void init() throws ServletException {
    try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost/JDBCEJB");
    env.put(Context.SECURITY_PRINCIPAL, "store_user");
    env.put(Context.SECURITY_CREDENTIALS, "store_password");
    Context myInitialContext = new InitialContext(env);
    Object homeObject = myInitialContext.lookup("ProductBean");
    myProductHome = (server.ProductHome)PortableRemoteObject.narrow(homeObject,server.ProductHome.class);
    } catch(NamingException e) {
    throw new ServletException("Error looking up home", e);
    public void doGet(
    HttpServletRequest request, HttpServletResponse response
    ) throws ServletException, IOException {
    response.setContentType("text/html;charset=BIG5");
    ServletOutputStream out = response.getOutputStream();
    out.println("<html>");
    out.println("<head><title>Product</title></head>");
    out.println("<body>");
    out.println("<table width=100% border=1>");
    out.println("<tr>");
    out.println("<th>Id</th>");
    out.println("<th>Name</th>");
    out.println("<th>Address</th>");
    out.println("<th>Bdate</th>");
    out.println("</tr>");
    try {
    server.ProductRemote myProductRemote = myProductHome.create();
    server.Product myProduct = myProductRemote.query(request.getParameter("guess"));
    if (myProduct != null) {
    out.println("<tr>");
    out.println("<td>" + myProduct.id + "</td>");
    out.println("<td>" + myProduct.name + "</td>");
    out.println("<td>" + myProduct.ads + "</td>");
    out.println("<td>" + myProduct.bdate + "</td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</body></html>");
    } catch(RemoteException e) {
    out.println("Error communicating with EJB-server: " +
    e.getMessage());
    } catch(CreateException e) {
    out.println("Error creating EJB: " + e.getMessage());
    } catch(SQLException e) {
    out.println("SQL Exception: " + e.getMessage());
    --My application client can run correctly, but my servlet code can't run.
    --If I start oc4j by follow statement:
    java -jar oc4j.jar
    --the error display:
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at ProductServlet.init(ProductServlet.java:39)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.loadServlet(HttpApplication.java:2091)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.findServlet(HttpApplication.java:4507)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2410)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:629)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    --If I start oc4j by follow statement:
    java -jar -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject -Djavax.rmi.CORBA.UtilClass=com.sum.corba.se.internal.POA.ShutdownUtilDelegate oc4j.jar
    --the error is:
    java.lang.ExceptionInInitializerError
         at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(PortableRemoteObject.java:179)
         at javax.rmi.PortableRemoteObject.<clinit>(PortableRemoteObject.java:58)
         at ProductServlet.init(ProductServlet.java:39)
         at javax.servlet.GenericServlet.init(GenericServlet.java:258)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.loadServlet(HttpApplication.java:2091)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.findServlet(HttpApplication.java:4507)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2410)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:629)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
         at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: org.omg.CORBA.INITIALIZE: cannot instantiate com.sum.corba.se.internal.POA.ShutdownUtilDelegate vmcid: 0x0 minor code: 0 completed: No
         at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:341)
         at javax.rmi.CORBA.Util.<clinit>(Util.java:51)
         ... 12 more

  • Class javax.rmi.PortableRemoteObject not found in import

    I have successfully tested test1.jsp calling stateful ejb test1ejb under JDEV9032. On deploying to standalone OC4J903, the following error occurred on accessing the jsp:
    500 Internal Server Error
    OracleJSP: oracle.jsp.provider.JspCompileException:
    Errors compiling:D:\O9IAS\j2ee\home\application-deployments\test\testWEB\persistence\_pages\\_test1.java
    Line # Error 10
    Class javax.rmi.PortableRemoteObject not found in import. import javax.rmi.PortableRemoteObject;
    Appreciate some pointers on how to troubleshoot this problem. Thanks. William Chew.

    This error is due to the c:\windows\system32\java.exe being first on the path instead of the d:\jdev9i\jdk\bin\java.exe being picked up.

  • Can javax.rmi.PortableRemoteObject be attribute of http session with in-memory replication?

    Hi:
              When the servlet server try to do the in memory replication, a Stub class
              not found exception throwed out.
              The rmi object is compiled with -iiop option, should I compile it without
              iiop option?
              Please help
              thanks
              andrew
              

    Hi don:
              Thanks for you reply.
              I can't get the stack trace right, I am not working today. but I'll get it
              later.
              All the machine has the IIOP tie and stub class.
              The jar file works fine on weblogic6.1 cluster.
              thanks again
              andrew
              "Don Ferguson" <[email protected]> wrote in message
              news:[email protected]..
              > What's the exact stack trace? Is the stub present on all machines in the
              > cluster?
              >
              > -Don
              >
              > Andrew wrote:
              >
              > > Hi:
              > > When the servlet server try to do the in memory replication, a Stub
              class
              > > not found exception throwed out.
              > > The rmi object is compiled with -iiop option, should I compile it
              without
              > > iiop option?
              > >
              > > Please help
              > > thanks
              > > andrew
              >
              

  • ClassCastException ; javax.rmi.Portable.Remote.Object. narrow(Unknown Sour

    Hi Guys,
    This is my First post, I am in a deep trouble with the following exception. Initially I was getting
    javax.naming.NoInitialContextException:
    Need to specify class name in
    environment or system property, or as an applet parameter
    I added few lines of code in the .java file. and set the classpath to j2ee.jar
    Hashtable env = new Hashtable();
    env.putContext.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
    Context initctx = new InitialContext(env);
    I was able to get through that error. But then now i am stuck up with the new runtime error .
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
    at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
    at AdviceClient.go(AdviceClient.java:24)
    at AdviceClient.main(AdviceClient.java:11)
    I have tried to figure out myself but with little vain. I am using
    Sun One App Server( j2sdkee 1.4 ) with Windows XP.
    I am waiting for a positive response.
    I am pasting the code of my Client
    AdviceClient.java
    import javax.naming.* ;
    import java.rmi.* ;
    import javax.rmi.* ;
    import HeadFirst.* ;
    import javax.ejb.* ;
    public class AdviceClient {
    public static void main( String[] args ) {
    new AdviceClient( ).go( ) ;
    public void go( ) {
    try {
    Hashtable env = new Hashtable();
    env.putContext.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
    Context initctx = new InitialContext(env);
    Object o = ic.lookup("Advisor") ;
    AdviceHome home = ( AdviceHome ) javax.rmi.PortableRemoteObject.narrow( o, HeadFirst.AdviceHome.class ) ;
    Advice advisor = (Advice )home.create( ) ;
         System.out.println(advisor.getTheMessage( ) ) ;
    } catch( Exception ex ) {
         ex.printStackTrace( );
    I am starting the default server and deploying the session Stateless beans.

    Hi Shivakanth,
    Please follow the guidelines in our EJB FAQ for writing a stand-alone java cilent that accesses ejbs :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    --ken                                                                                                                                                                                                                                                                                                                                                                               

  • Javax.rmi.*;

    Hai...,
    I have a problem of API javax.rmi.PortableRemoteObject;
    when I compile a class using java 1.3, it can't find the API,where I should find this API?
    if in java.sun.com where is it?
    Thank,
    ciou, sudarto

    Hi,
    javax.rmi.* is contained in J2EE. Please use docs like http://java.sun.com/j2se/1.3/docs/api/index.html and http://java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html to find any such packages.
    So, as EJBs are part of the J2EE you should not be surprised to additionally download the j2ee.
    Regards,
    hedtfeld.

  • SOS!! : I can't find javax.rmi.*

    After i install j2sdkee1.2.1,
    I can't find javax.rmi.* in the dictory D:\j2sdkee1.2.1\lib
    Where will i find it and download it into my computer

    Add j2ee.jar to your classpath.
    Jesper

  • Orion primer: javax.rmi.CORBA.Util not found

    Hi,
    I have been trying to run the orion primer (hello-planet) on the most recent release (9.0.3.0.0), but I am getting this error when trying to access the app:
    java.lang.NoClassDefFoundError: javax/rmi/CORBA/Util
    I have followed the directions on the orion web site. I am running on jdk1.2 so I had to add jndi.jar as an extension so I am wondering if I need to do something similar for this class, but I can't find info on where this class may be stored (which jar). I have manually looked through the different jars that came with oc4j, but can't find this class (it is possible that I overlooked...so many jars).
    ***While writing this I decided to run on previous release (9.0.2.0.0) and it worked.......
    but why does the default-web-site.xml work on this release, and the http-web-site.xml work on (9.0.3.0.0)?
    so I guess my question is now, Why doesn't this app work on newest release, and should I continue to test apps on 9.0.3.0.0, or go back to previous?

    Linda,
    I just tested this app with 9.0.3.0.0 and it works fine. Please try with JDK 1.3.1 and above. From 9.0.2.0.0 we decided to have http-web-site
    as the default web site instead of default-web-site. In the prior versions i.e. 1.0.2.2 and 1.0.2.2.1 we had default web-site. However if you
    want to create more websites e.g. default-web-site then you can do so.
    regards
    Debu Panda
    Oracle

  • Help to find javax.rmi

    hi
    i am very new to j2ee . and facing some problem in finding javax.rmi.* package. can someone tell where can i find the javax.rmi.* package to download.
    thanks

    Hi javax.rmi is part of J2SE, so you should already have it.

  • Javax.rmi.CORBA.Util.getLocal(Stub) problem

    Hi guys,
    I 've experienced this problem:
    In javax.rmi.CORBA.Util.getLocal(Stub) Sun implements getting the Delegation class and casting to their own Delegate class.
    We have our stubs and our ORB and our delegate class with this situation we lose opportunity to use isLocal functionality,becouse we will get ClassCast when getting our Delegate class and cast it to Sun's class.
    Did someone else have the same problem and did someone knows what is the solution or opinion from Sun's developers.
    Regards Vladislav

    I've report this situation to Sun
    my solution is ot invoke ObjectImpl._is_local() in isLocal(Stub) method,which is equivalent according to API DOCS ....
    But their implementation is not very customized .... I'm wondering how the things are up to in IBM

  • Org and javax packages

    hello,
    where should I look for documentation on org and javax packages?
    I mean, if I see a function from the java package, I can google it and find out which are it's constructors, methods, what it implements or extends etc.
    But if I see for instance import org.jdesktop.application.ResourceMap where can I find out anything about this one? Just try to google it, nothing useful comes up. Or try FrameView, which is quite important- the same problem.
    Are this packages documented somewhere, like java package is?

    Javax packages are standard Java eXtensions (y'see?) and the docs tend to be in the standard Sun documentation. As for "org", you need to look a bit further. For instance if you're talking about packages starting with org.apache, that points you to apache.org. So for org.jdesktop, guess where you go? It's the recommended way to name your packages, from your domain name that way.

  • X509Certificate in java and javax - whats the difference?

    Hi,
    I wonder about the two same named classes X509Certificate in
    java.security.cert and javax.security.cert .
    Is there any difference?
    Olek

    The javadocs for javax.security.cert.X509Certificate say that it is deprecated and that you should use java.security.cert.X509Certificate instead.

  • Wanna download javax.mail.* and javax.mail.internet.*

    Hi all;
    i'm a beginner in JSP and want help in downloading api classes for javax.mail.* and javax.mail.internet.*...would any1 like to tell me the URL for it and also after downloading, wat sequence would i follow to make these files run properly with my code.
    would b waiting desperately for immediate response.
    Regards.

    Go to
    http://java.sun.com
    There are 5 drop List. Under the 2nd Drop List Search for JavaMail(TM) API 1.3. Now continue to download. U will download a file names javamail-1_3.zip. There are some jar files which u need to extract and add to ur classpath settings.
    Not use the following code to send a simple SMTP Mail.
    //Java specific imports
    import javax.activation.FileDataSource;
    import javax.activation.DataHandler;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class SendMail
    Session session = null;
    public SendMail() throws Exception
    Properties props = new Properties();
    String strMailIPServer = "Your SMTP Server IP";
    props.put("mail.smtp.host", strMailIPServer);
    session = Session.getDefaultInstance(props, null);
    public void sendMail(String strToAddress, String strFromAddress, String strSubject, String strMessage) throws Exception
    try
    long intTimeForTenMinutes = 60;
         MimeMessage objMimeMsg = new MimeMessage(session);
    //Address objFromAddr = new InternetAddress(strFromAddress);
    javax.mail.internet.InternetAddress objFromAddr = new javax.mail.internet.InternetAddress (strFromAddress);
    Address[] objToAddr = InternetAddress.parse(strToAddress);
    objMimeMsg.setFrom(objFromAddr);
    objMimeMsg.setRecipients(Message.RecipientType.TO, objToAddr);
    objMimeMsg.setSubject(strSubject);
    objMimeMsg.setContent(strMessage, "text/html");
    Transport.send(objMimeMsg);
    catch (Exception mex)
    throw mex;
    All the Best!
    Thanks and regards,
    Pazhanikanthan. P

Maybe you are looking for

  • Vendor payments release workflow!!!

    Hi all Can somebody explain to me how we setup standard workflow so that all vendor invoices greater than 100.000 can be blocked for payment automatically & released by some other user? I tried to give the document type "KR" to the workflow variant &

  • Specific model not picking up advertisements

    The other week I went to add the Powershell module to our Boot Images We encountered an error trying to do that, so we gave up, and built new boot images just to be safe. After doing so, and triple checking everything was exactly as had been previous

  • Mobiliser startup error:Bundle did not start up in time

    Hi Anil, I am trying to install mobiliser  platform 5.1 SP 03 on cloud. I am following this guide. http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01871.0513/pdf/Mobiliser_Platform_Installation_Guide_5.1 when I execute the startup scr

  • Executing independent Forte processes

    Ed, You can create a very lightweight client object that has no windows and launch it via an OS ftexec call. Using -fnw in the ftexec will indicate that there are no windows. You can also include custom environment variables that the client can picku

  • SWF to FLA converter

    Hi there guys. I've got a problem. I lost my .fla for a customer, and now I need to do some work on it. I see you get swf to fla software for mx2005 and plenty for Mac. Could anybody please point me in the direction of how to get software for swf to