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
          >
          

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

  • 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

  • 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?

  • 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.

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • TS3103 All of a sudden can't receive email on Mail client.  Sessions with service provider (Att/yahoo) and Apple have yielded no results!

    All of a sudden can't receive email on Mail client.  Sessions with service provider (att/yahoo) and Apple have yielded no results!  Recently upgraded to Lion, but have received email since.  Anyone having the same problem.  Apple says service provider problem, service provider say it's the mail client.  Anyone had this problem???

    No.  My frustration with the problem just led me to begin the process convert all my email to a gmail client.  However, after some time all my mail with att/yahoo has been coming through as before.  Go figure.  Still will convert to gmail.

  • Avoid http sessions with XML request

    Hello,
    We are sending quick complete messages (and other XMLs like resource status change,...) to SAP ME. We see on Wily that it always create sessions and as we are starting more and more machines we are always reaching the sessions limits --> we currently increased it to 3000. With MII webservices, we know that we can avoid to create a session with parameter "session=false" but we don't know if something like this can be done with ME xml message.
    Any idea ?
    Regards,
    Michaël.

    Hi Michaël,
    Session control is done by Netweawer and I'm not aware of a way/setting to make Netweaver not create http/security sessions for requests. What I think could work in your scenario is setting low timeout value for web application responsible for ME web services handling. I'm not sure if suggested re-configuration is valid from WAR archive consistency point of view, but I believe it could be tried in a test system:
    1. Find WAR archive in the following path - drive:\usr\sap\[SID]\[InstanceNo]\j2ee\cluster\apps\sap.com\me~ear\servlet_jsp\manufacturing-services\me.webservices.web-5.2.x.x-Base.war   OR ..\servlet_jsp\manufacturing-xml\me.integration.xml.web-5.2.x.x-Base.war
    2. Open it and edit WEB-INF\web.xml file. Change session-timeout property to 1.
    3. Save the file in the open archive.
    4. Restart engine.
    If such change is catched up by j2ee engine, all sessions for the web app should be invalidated and purged after 1 minute. Off course the same procedure has to be followed each time application is redeployed/upgraded to a newer version as this will deploy default WAR archive with default 60 min timeout config.
    Regards,
    Konstantin

  • How to invalidate the client part of a HTTPS Session with client auth

    Hi to everybody here,
    I'm having an issue with HTTPS and client authentication related with how SSLHandshake works and the behavior of the client browser. I hope you can help.
    I'm setting up a web application that ask for a valid session in order to allow access to the application. If the user has no valid session, he's redirected to the login form, and if the auth process is ok, the user gets a session and is redirected again to the secured pages.
    We are in the way to create a new login service with client certificates, so the user identificates himself with a certificate valid on the application server.
    We have an application server with a secure listener in port 8443. It's configured to request client certificates so we can access to the certificate and validate it and create a session for the user automatically. The user just type his pin code in the browser, no passwords at all. This process is working and sessions are created. The problem comes up when we are trying to log the user out.
    We invalidate the session using a logout.jsp, but if the user goes to the secured pages again, we have observed that the authentication takes place automatically and the user can see the secured pages, so he thinks the logout.jsp doesn't work.
    My questions are: can we access to delete or modify the client browser ssl part in order to reset the https connection established against our application server? Are there any other ways to avoid this behavior?
    Thanks in advance.
    Miss.

    An enduser presents a certificate from a CAC for authentication to our website.
    They pick the Cert off the inserted CAC and submit it. Get logged into the application successfully.
    The user removes the card form the reader and the SSO session times out.
    In the same browser the user clicks log in with CAC and is not prompted for the cert this time the browser just goes ahead and presents the cached cert even though the card is no longer in the reader. The user logs in successfully.
    The desired behavior would be to prompt the user for for a cert again obviously.
    I am wondering how to turn this off as well.

  • Can I expand the RAM of an Equium M50 with 1GB memory module?

    Someone told me that Equium M50 only recognise 512 MB memory module. The Toshiba manual does not specify. It is true?
    Thank you for any help
    Cheers

    Hi Francisco
    No, this is not correct. The guy who told this was not right and I assume he has no Equium A50 experience.
    As far as I know the memory on Equium A50 notebook can be upgraded up to 2048MB.
    So you have to use 2 x 1024MB (1GB) memory modules if you want to upgrade the memory to 2GB.
    For me its clear. The Equium A50 recognizes bigger memory size as 512MB.
    Do you know what modules are compatible and can be used???
    On the Toshiba Options & Accessories website you will find the supported modules:
    PC2700 512MB (PA3312U-2M51)
    PC2700 1024MB (PA3313U-2M1G)
    I hope I was clear enough ;)
    Regards

  • Web Dispatcher - Current HTTP Sessions with decimals?

    Hi,
    looking at the statistics of our CurrentHTTPSessions of our three servers in the Web Dispatcher I was wondering how it is possible to get decimals (for example we have on one server 10,33 CurrentHTTPSessions)? As far as I understood the round-robin algorithm is used with sticky sessions but for my understanding decimals does not make sense.
    I hope you can help me with this question.
    Regards,
    Timo

    Hi Mercedes,
    thank you very much for the quick response.
    I guess for the productive environmentI will install 2 'old fashioned' Web Dispatchers because Note 908097 says that 7.20 is not released with SAP Release 7.00. But in a test environment I will try 7.20!
    Regards
    Martina

  • Http session with no interaction

    Is there an easy way, straight forward way, or a simple hack that would allow one to automate a session bean? Currently I have a series of jsp pages attached to a session bean that collect info and perform a process a the end. Now I want to automate this process. Give it all the info in the beginning and run it a certain times. I need to mimic the session object that this process requires.
    I can do this with lots of cutting and pasting and creating new, somewhat identical classes. However I want to create one new class that creates a session object and populates all of the info with the interaction...............

    You could write a class that makes calls to the sessionbean.
    Or add a function to the sessionbean which contains the logic?
    You could try that?

  • 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.

  • 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                                                                                                                                                                                                                                                                                                                                                                               

  • Can't get the Home interface of a Session bean,please!

    when I run a client of a SessionBean,(use command "java ....";
    the Exception was thrown:
    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 clientTest.ClientTest.main(ClientTest.java:35)
    the mothed main() :
    java.util.Properties jndiProperties = new java.util.Properties();
    jndiProperties.put("java.naming.provider.url","iiop://localhost:3700");
    jndiProperties.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    try {
    javax.naming.directory.DirContext jndiCtx = new javax.naming.directory.InitialDirContext(jndiProperties);
    Object obj = jndiCtx.lookup("ejb/Stock");
    System.out.println(obj);
    StockHome sh = (StockHome)PortableRemoteObject.narrow(obj, StockHome.class); //exception was thrown
    }catch (javax.naming.NamingException ne) {
    ne.printStackTrace();
    } catch (Exception e){
    e.printStackTrace();
    Must I run it in the jar file deployed to appServer?
    it's very inconvenient!
    Thanks!!

    Hello
    Inline there are the answers
    [email protected] (Grand Gana) wrote:
    Hi !
    I want to know how to get the local interface of a session ejb from a
    jsp page ???
    My session ejb is in a jar, and my jsp page is in a war. (they're not
    together in a ear)You cannot call your EJB by a local interface by this way.
    The war and the ejb-jar must be in the same ear.
    This is due to classloading architecture.
    I can have access to a remote interface of an other session ejb from
    a
    jsp page doing :
         InitialContext ctx = new InitialContext();
         Object objref = ctx.lookup("article.ArticleManagerHome");
         ArticleManagerHome home = (ArticleManagerHome)
    PortableRemoteObject.narrow(objref,
    ArticleManagerHome.class);
    But I can't have access to the local interface from the same jsp page
    doing :
         MyManagerLocalHome home = (MyManagerLocalHome)ctx.lookup
    ("article.MyManagerLocalHome");
    I get the following error :
    javax.naming.NameNotFoundException: Unable to
    resolve 'article.ArticleManagerLocalHome' Resolved: 'article'
    Unresolved:'ArticleManagerLocalHome' ; remaining
    name 'ArticleManagerLocalHome' This is another problem.
    Check the jndi name in the ejb-deployment descriptor or check the jndi on your
    server to verify that a local interface implementation has been bound to it.
    >
    What should I do ???
    (I don't want to put them in the same ear)
    An EJB reference in the web.xml of my war ??? How ?
    A lookup with java/comp/... ??? How ?
    I don't understand !!! It's so difficult to do simple things !
    Bloody EJBs !!!Noooooo ;)
    But I can agree with you on local interfaces ....
    The J2EE specs speak about "same virtual machine" ....
    But classloading architecture "speaks about" "same classloader" (same ejb-jar)
    or "related classloaders" (war and ejb in same ear).
    I think something is still missing ....
    >
    TIA
    JCMark

Maybe you are looking for