Specifying RMI Port in JNDI Lookup

Hi,
I am using Silverstream 3.7.4 server for my J2EE development.
The host machine having multiple machine uses different RMI ports.
So I have 54893 as RMI port instead of default 54890. I cannot
create a InitialContext due to this Reason. Can anybody help me how to resolve this problem. The Code is
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sssw.rt.jndi.AgInitCtxFactory");
p.put(Context.PROVIDER_URL,"iiop://cds:15003");
Object sbobj = context.lookup("/RMI/ejb/ODRSessionFacade");
odrEJBHome = (ODRSessionFacadeHome)PortableRemoteObject.narrow(sbobj,ODRSessionFacadeHome.class);
odrEJB = odrEJBHome.create();
The Exception is:
javax.naming.ConfigurationException: Error finding 'RMI/ejb/ODRSessionFacade'. Resolution name is 'iiop://localhost:54890'.
javax.naming.ConfigurationException: Error finding 'RMI/ejb/ODRSessionFacade'. Resolution name is 'iiop://localhost:54890'.
     at com.sssw.rt.jndi.AgInitCtx.checkFederatedContext(AgInitCtx.java:436)
     at com.sssw.rt.jndi.AgInitCtx.checkFederatedName(AgInitCtx.java:98)
     at com.sssw.rt.ejb.AgInitClientCtx.lookup(AgInitClientCtx.java:66)
     at com.sssw.rt.jndi.AgBaseCtx.lookup(AgBaseCtx.java:218)
     at com.sssw.rt.jndi.AgInitCtx.lookup(AgInitCtx.java:492)
     at com.sssw.rt.ejb.AgInitClientCtx.lookup(AgInitClientCtx.java:70)
     at com.sssw.rt.jndi.AgBaseCtx.lookup(AgBaseCtx.java:241)
     at javax.naming.InitialContext.lookup(Unknown Source)
     at com.sdm.pdr.ODR.ServerObject.<init>(ServerObject.java:39)
     at com.sdm.pdr.ODR.ODRMain.<init>(ODRMain.java:16)
     at com.sdm.pdr.ODR.ODRMain.main(ODRMain.java:48)

YOUR SYSTEM MAYBE HAS SOMETHING WRONG WITH THE FIREWALL
AND THE PORT CANNOT BE USED!YOU BE SURE:)

Similar Messages

  • Specifying RMI port for 9iAS

    Hello,
    I can't seem to find how to explicitly declare the RMI port to use for an OC4J instance in 9iAS. There is a range of ports specified in "server properties", but how do I tell it which one to use? Through trial and error I found it listening at 3105, but for the life of me can't figure out why it chose that port.
    Thanks,
    Patrick

    The ports are dynamically assigned. If you want a specific port to be assigned please set the change to one number e.g. 3101-3101
    http://download-west.oracle.com/docs/cd/B12314_01/web.904/b10326/ormi.htm#1006423
    regards
    Debu

  • RMI-IIOP JNDI lookup returns com.sun.corba.se.internal.iiop.CDRInputStream

    I have two different RMI-IIOP java clients, one is working fine and the other is not. Both are using weblogic.jndi.WLInitialContextFactory from wlclient.jar in WLS 8.1sp5 and JDK 1.4.2_6.
    One java client is a straight-forward java main. JNDI lookup is returning EJBHome_Stub correctly loaded by sun.rmi.server.LoaderHandler$Loader
    The other java client is a complex java program with multiple threads and many jars. A thread does the same JNDI lookup as the simple java client, but the object returned is of type com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1 which has NULL classloader (bootstrap classloader).
    What condition triggered the WebLogic InitialContext to default to com.sun.corba.se.internal.iiop.CDRInputStream?

    Kevin Fung <> writes:
    This is usally symptomatic of an IOR without the corresponding stub
    being loaded, usually because the correct security manager is not
    set. However the client jar bypasses the security manager to try and
    avoid this problem, so I am confused as to why you are seeing this. Do
    you know which object it is accessing? Can you try putting IIOP stubs
    for it in the client?
    andy
    I have two different RMI-IIOP java clients, one is working fine and the other is not. Both are using weblogic.jndi.WLInitialContextFactory from wlclient.jar in WLS 8.1sp5 and JDK 1.4.2_6.
    One java client is a straight-forward java main. JNDI lookup is returning EJBHome_Stub correctly loaded by sun.rmi.server.LoaderHandler$Loader
    The other java client is a complex java program with multiple threads and many jars. A thread does the same JNDI lookup as the simple java client, but the object returned is of type com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1 which has NULL classloader (bootstrap classloader).
    What condition triggered the WebLogic InitialContext to default to com.sun.corba.se.internal.iiop.CDRInputStream?

  • RMI JNDI Lookup in ServletContextListener

    Hi,
    I am attempting to do a JNDI lookup (using the RMIInitialContextFactory) of a session EJB inside a ServletContextListener. But when I do I get an exception saying it cannot find the name I lookup. If I set rmi.debug to true I can see that a 'SocketException: Socket closed' is caught internally. I can also see from the RMI debug that the attempt to load the EJB interface class fails because it is trying to use the application server's classloader and not the web applications classloader. If I put the JAR containing the interface class into the applib directory none of the above occurs.
    Should I be able to do the JNDI lookup within the SerlvetContextListener? Is this a bug?
    Cheers,
    Rich.

    This exception only appears once I turn rmi.debug on. Like I said previously if I put the EJB interfaces JAR into applib it does not occur.
    05/03/14 09:03:56 java.net.SocketException: socket closed
    05/03/14 09:03:56 at java.net.SocketInputStream.socketRead0(Native Method)
    05/03/14 09:03:56 at java.net.SocketInputStream.read(SocketInputStream.java:129)
    05/03/14 09:03:56 at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    05/03/14 09:03:56 05/03/14 09:03:56 Exception raised when creating initial context:
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    05/03/14 09:03:56 at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
    05/03/14 09:03:56 at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313)
    05/03/14 09:03:56 at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380)
    05/03/14 09:03:56 at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452)
    05/03/14 09:03:56 at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601)
    05/03/14 09:03:56 at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
    05/03/14 09:03:56 at com.evermind.server.rmi.RMIConnection.readCommand(RMIConnection.java:3455)
    05/03/14 09:03:56 at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:380)
    05/03/14 09:03:56 at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:333)
    05/03/14 09:03:56 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecu
    tor.java:186)
    05/03/14 09:03:56 at java.lang.Thread.run(Thread.java:534)

  • RMI JNDI Lookup on remote iAS causing "Not Authorised"

    Hi all
    I'm running through an OJMS example using AQ and all is looking good until I try and Update my plan from Design Studio..
    I get:
    IMessageSourceReceiver->messageReceive: javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Not authorized; nested exception is:
         javax.naming.AuthenticationException: Not authorized. Root exception is javax.naming.AuthenticationException: Not authorized
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2523)
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2339)
         at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1781)
         at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:721)
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:149)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at iteration.enterpriselink.sources.JMSConsumer.start(JMSConsumer.java:85)
         at iteration.enterpriselink.sources.JMSMessageSourceReceiverImpl.jmsConsumerStart(JMSMessageSourceReceiverImpl.java:1001)
    This appears to be because iAS is using JAZN security and is not allowing an anonymous lookup from BAM.
    I can't see anywhere in Architect or Administrator where I can configure a username/password for authentication with my iAS install...
    Has anyone any advice?
    Cheers
    Chris

    Hi, Chriseb2
    even i also have the same problem
    I am getting one Error while Creating Enterprise Link Plan in Design Studio of BAM and Failed to Create the Plan.
    i.e.(IMessageSourceReceiver>messageReceive:javax.NameNotFoundException: java:comp/resource/BAMTTT/TopicConnectionFactories/bam_ttq_tab not found)
    Setup:
    Integration between Oracle EBS 11.5.10 and Oracle BAM 10.1.3.
    I am trying to get the Raw Data and sending over to the Enterprise Link Plan.
    1. Created bam_ttq AQ and bam_ttq_tab.
    2. Configured all of the startup parameters required for Enterprise Message Source Type (Oracle (AS JMS and OJMS)) in the Administrator of BAM.
    3. Configured the Oracle (AS JMS and OJMS) with the following values in the Enterprise Message Sources in the Architect of BAM.
    Initial Context Factory : com.evermind.server.rmi.RMIInitialContextFactory.
    JNDI Service Provider URL : opmn:ormi://inaportal.inatech.com:6004:home.
    TopicConnectionFactory Name : java:comp/resource/BAMTTT/TopicConnectionFactories/bam_ttq_tab.
    Topic Name : java:comp/resource/BAMTTT/Topics/bam_ttq.
    JMS Message Type : Text Message.
    Durable Subscriber Name (Optional) : Bamclient.
    Message Selector (Optional) :
    Client ID (Optional) : ClientId.
    4. Also configured the data-sources.xml and applications.xml in OC4J (10.1.2) to reference the database schema where the BAM_TTQ queue is created.
    5. Modified the jndi.properties file with required properties.
    java.naming.security.principal = ias_admin
    java.naming.security.credentials = inaportal321
    java.naming.provider.url = opmn:ormi://inaportal.inatech.com:6004:home
    java.naming.factory.initial = com.evermind.server.rmi.RMIInitialContextFactory
    6. In the Design Studio I have a Plan with Oracle BAM Enterprise Message Receiver and Grid.
    And when I am updating the plan I am getting the following error.
    IMessageSourceReceiver->messageReceive: javax.naming.NameNotFoundException: java:comp/resource/BAMTTT/TopicConnectionFactories/bam_ttq_tab not found
    at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at iteration.enterpriselink.sources.JMSConsumer.start(JMSConsumer.java:85)
    at iteration.enterpriselink.sources.JMSMessageSourceReceiverImpl.jmsConsumerStart(JMSMessageSourceReceiverImpl.java:1001)
    at iteration.enterpriselink.sources.JMSMessageSourceReceiverImpl.messageReceive(JMSMessageSourceReceiverImpl.java:326)
    [Oracle BAM Enterprise Link error code: 0x75 -- 0x1, 0x75 -- 0x3A]
    Error during Message Receive operation.
    [Oracle BAM Enterprise Link error code: 0x75 -- 0x1, 0x75 -- 0x3B]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code: DC -- 0x1, DC -- 0x83]
    Error while processing the data for the step 'Oracle BAM Enterprise Message Receiver'
    [Oracle BAM Enterprise Link error code: DC -- 0x1, DC -- 0x83]
    Update of Plan "EBS_Example" failed.
    [Oracle BAM Enterprise Link error code: PlanMgr -- 0x1, PlanMgr -- 0xD5]
    Can U pls help me out with this? Its Urgent for Me
    Thx
    Renuka.

  • EJB JNDI lookup port

    Hi,
    If my AS Java's port is 50000, then the ejb port is 50004. Is it possible to change the default EJB JNDI lookup port to eg, 55555?
    Thanks.
    Any help will be highly appreciated.
    - julius

    hi,
    in addition to above context
    this may be help full to u
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/content.htm
    bvr

  • JNDI Lookup in loca JVM

    I am using the following properties to get an InitialContext to lookup an EJB:
    INITIAL_CONTEXT_FACTORY: com.sun.jndi.cosnaming.CNCtxFactory
    PROVIDER_URL: iiop://localhost:3700
    The EJBs are hosted on Sun AS8.1. If I use these properties from an external client, Tomcat webapp, then everything works fine. However, if I deploy the webapp as part of the ear along with the ejbs and try to access the webapp on the Sun Server then I get the following error when trying to get the InitialContext.
    If I don't include the two properties when getting the InitialContext then everything works fine on the Sun AS server as well.
    Does anyone have any idea why the first configiraton would fail??
    Thanks,
    Pete Giesin
    [#|2005-12-05T11:08:03.000-0500|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=14;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2681)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:167)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:207)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:224)
         at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:104)
         at com.sun.corba.ee.impl.oa.toa.TOAImpl.<init>(TOAImpl.java:78)
         at com.sun.corba.ee.impl.oa.toa.TOAFactory.getTOA(TOAFactory.java:65)
         at com.sun.corba.ee.impl.orb.ORBImpl.connect(ORBImpl.java:1536)
         at com.sun.corba.ee.spi.presentation.rmi.StubAdapter.connect(StubAdapter.java:164)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.connectAndGetIOR(ORBUtility.java:825)
         at com.sun.corba.ee.impl.orb.ORBImpl.getFVDCodeBaseIOR(ORBImpl.java:901)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.addServiceContexts(CorbaClientRequestDispatcherImpl.java:737)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:227)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:127)
         at com.sun.corba.ee.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:77)
         at com.sun.corba.ee.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:110)
         at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
         at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
         at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
         at com.sun.corba.ee.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1221)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
         at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
         at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
         at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
         at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at dstb.servicelocator.InitialContextCreator.getInitialContext(InitialContextCreator.java:77)
         at dstb.servicelocator.ExaminedServiceLocator.getRemoteEJBHome(ExaminedServiceLocator.java:213)
         at dstb.servicelocator.ExaminedServiceLocator.getRemoteEJB(ExaminedServiceLocator.java:114)
         at dstb.common.EJBShare.getEJB(EJBShare.java:675)
         at dstb.servletapi.stbprovision.StbStatusSelectorObj.getStatus(StbStatusSelectorObj.java:35)
         at cvnet.servlet.Home_cab.doGet(Home_cab.java:63)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Caused by: java.lang.Error: Untranslated exception
         at sun.nio.ch.Net.translateToSocketException(Net.java:63)
         at sun.nio.ch.Net.translateException(Net.java:79)
         at sun.nio.ch.Net.translateException(Net.java:85)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:61)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:258)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:231)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createServerSocket(IIOPSSLSocketFactory.java:289)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:160)
         ... 64 more
    Caused by: java.net.SocketException: Already bound
         at sun.nio.ch.Net.translateToSocketException(Net.java:49)
         ... 71 more
    Caused by: sun.nio.ch.AlreadyBoundException
         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:114)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
         ... 68 more
    |#]

    To answer my own question, a fairly straight-forward way of achieving this is to use two configurations for the application module: one for testing locally (the supplied configuration), and another one for deployment that is a copy of the first except for the JNDI name. I can switch between the configurations via the Databindings depending on whether I want to test locally or deploy to Tomcat.
    This is certainly a useable solution, but I'm bothered by the fact that I need to reference the JNDI name in two different ways. Shouldn't this be container-independent?
    -Matt

  • JNDI lookup fails - No such domain/application

    Hi,
    I tried to perform a JNDI lookup from a stand alone Java client towards Oracle 9iAS version 9.0.3 and failed with the following error:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: mindejb; nested exception is:
         javax.naming.AuthenticationException: No such domain/application: mindejb
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:345
         void Samplecom.mind.ejb.stubs.AccountComplexStubClient.main(java.lang.String[])
              AccountComplexStubClient.java:21
    Below, are the JNDI settings I am using. The application by the name mindejb was deployed and is accessible using server side JSP or servlets. When I use a stand alone OC4J, the same settings (different port) work fine!
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=ormi://localhost:3101/mindejb
    java.naming.security.principal=admin
    java.naming.security.credentials=admin
    Thanks,
    Avi

    When you are running within an Oracle Application Server managed OC4J environment, then you should use the OPMN protocol loader we have that will insulate you from the specified ORMI port being used by OC4J.
    The OPMN port is fixed so you can always rely on it, whereas the specific ORMI port used by an OC4J instance changes depending on the startup sequence, the number of procs configured, etc.
    Here's a piece from the EJB documentation
    http://download-west.oracle.com/docs/cd/B14099_19/web.1012/b15505/access.htm#i1019709
    Location
    All ports, including the RMI port, are dynamically set by OPMN when each OC4J instance starts. When you specify the following URL in the client JNDI properties, the client-side OC4J retrieves the dynamic ports for the instance, and chooses one from the list for communication.
    java.naming.provider.url= opmn:ormi://<opmn_host>:<opmn_port>:<oc4j_instance>/<application-name>
    The OPMN host name and port number is retrieved from the opmn.xml file. In most cases, OPMN is located on the same machine as the OC4J instance. However, you must specify the host name in case it is located on another machine. The OPMN port number is optional; if excluded, the default is port 6003. The OPMN port is specified in opmn.xml.
    cheers
    -steve-

  • Weblogic JNDI lookup in Applet

    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

    It looks like the object that you have placed into the JNDO tree is not serializable or doesnt implement exernalizable!
    java.io.NotSerializableException
    0rrc
    On 26 Jul 2001 16:10:35 -0700, [email protected] (Mohan Raj) wrote:
    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

  • Stand-alone JNDI lookup of an EJB in an Enterprise Application (EAR) build

    Hi All,
    I am having some difficulty doing JNDI look up an EJB 3.0 Bean that is part of an Enterprise Application (EAR) build. Below are all the related codes:
    package ejb;
    import javax.ejb.Local;
    @Local
    public interface Hello1Local {
        public String getHello1();
    package ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class Hello1Bean implements Hello1Local {
        public String getHello1() {
            return "I am Hello1 Bean!";
    package ejb;
    import javax.ejb.Remote;
    @Remote
    public interface Hello2Remote {
        public String getHello2();
    package ejb;
    import javax.ejb.Stateless;
    import javax.ejb.EJB;
    @Stateless
    @EJB(name="ejb/Hello1",
         beanInterface=Hello1Local.class,
         beanName="Hello1Bean")
    public class Hello2Bean implements Hello2Remote {
        @EJB private Hello1Local hello1bean;
        public String getHello2() {
            return hello1bean.getHello1();
    There is no problem looking up Hello2 Bean using an Application Client such as the following:
    public class LocalHelloApplicationClient {
        @EJB(name="Hello2")
        private static Hello2Remote hello2Bean;
        public static void main(String[] args) {
            System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
    }There is also no problem doing JNDI lookup (from a Stand-Alone Client the same bean if both Hello1 and Hello2 were created by themselves. ie not part of an Enterprise Application (EAR) build. However, I am wondering whether it is possible to do JNDI lookup of the same bean (Hello2) that is part of an Enterprise Application (EAR) built. Below are the type of JNDI lookup entries that I have tried without success:
    public class StandalonePojoCallHelloWorld {
        public static void main(String [] args)
            try
                InitialContext jndiContext = new InitialContext();
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("ejb.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2.remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.ejb.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.Hello2Remote");
                                                                     or
                Hello2Remote hello2Bean =  (Hello2Remote) jndiContext.lookup("LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote");
                System.out.println("hello2Bean.getHello2(): " + hello2Bean.getHello2());
            catch (javax.naming.NamingException ne)
             ne.printStackTrace();
    They all came up with the same error message:
    javax.naming.NameNotFoundException: LocalHelloEnterpriseApplication.LocalHelloEnterpriseApplication-ejb.Hello2Remote not found
            at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
            at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)Any suggestion would be appreciated.
    Thanks,
    Jack

    Hello
    I've somme problems to get access to ejb interface from remote stand-alone client.
    Here is my EJB code :
    package stateless;
    import javax.ejb.Stateless;
    @Stateless(name = "TestSB", mappedName = "ejb/stateless/TestSB")
    public class TestEJBBean implements TestEJBRemote {
        public String getMessage() {
           return "Hello EJB World";
    }And the remote interface :
    package stateless;
    import javax.ejb.Remote;
    @Remote
    public interface TestEJBRemote {
        String getMessage();
    } In client side, i just edit main.java like this :
    package testclient;
    import java.io.FileInputStream;
    import java.util.Properties;
    import javax.naming.InitialContext;
    import stateless.TestEJBRemote;
    public class Main {
        public static void main(String[] args) throws Exception {
            Properties props = new Properties();
            props.load(new FileInputStream("jndi.properties"));
            InitialContext ctx = new InitialContext(props);
            TestEJBRemote testEJB = (TestEJBRemote) ctx.lookup("ejb/stateless/TestSB");
            System.out.println(testEJB.getMessage());
    }here is my jndi.properties file (my glassfish server IP is 192.168.0.10) :
    java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
    java.naming.factory.url.pkgs = com.sun.enterprise.naming
    java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
    org.omg.CORBA.ORBInitialHost = 192.168.0.10
    org.omg.CORBA.ORBInitialPort = 3918when i run client on the same machine than the glassfish app server, it works fine.
    But i run it on the different machine than the glassfish app server (on the same LAN without firewall), it fails with this error message :
    eclan@eclan-laptop:~/NetBeansProjects/TestClient$ java -jar dist/TestClient.jar
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 3918"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4038"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    24 ao&ucirc;t 2008 09:53:05 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    ATTENTION: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.1.1; port: 4138"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
         at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:131)
         at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
         at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at testclient.Main.main(Main.java:14)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
         ... 13 more
    Caused by: java.net.ConnectException: Connection refused
         at sun.nio.ch.Net.connect(Native Method)
         at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
         ... 14 more
    eclan@eclan-laptop:~/NetBeansProjects/TestClient$ THANKS YOU FOR YOUR HELP
    Justin

  • Doing a jndi lookup() for an EJB deployed on Glassfish v3

    Hello.
    I have deployed a Stateful Sesion EJB on a Glassfish v3 AppServer.
    It is running under 'localhost' on my laptop pc.
    I am also running a stand-alone java application on the same pc... it attempts to get a remote connection from the client-app to the Glassfish Server and then do a jndi lookup() to get a reference to my EJB.
    here is the client source code:
    public class LookupTest {
    static Properties props = null;
    public static void main(String[] args) {
    try {
    props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
         props.put(Context.PROVIDER_URL, "iiop://localhost:3700");
         Context ctx = new InitialContext(props);
         System.out.println( "the context is: " + ctx);
         System.out.println( "the environment contains: " + ctx.getEnvironment() );
         System.out.println( " ");
         // do a lookup.
         Object elementObj = ctx.lookup("SerialContextProvider");
         System.out.println(elementObj);
    } catch (NamingException e) {
    e.printStackTrace();
    When I run this app, there are no Errors or Exceptions. It appears that the connection succeeds. But there are no EJB references in the context that is created. The only item that seems to be present in the context is an item named "SerialContextProvider", as noted in the return value from a list("") method invocation. Why can i not see the EJB within the context? Is my code wrong ??
    Thanks,
    Andy Jerpe
    Edited by: user1169567 on Nov 28, 2010 12:12 PM

    Ok, but the communication seems to be OK over the wire because if I use netstat -a I can see the ESTABLISHED connection with the server in the right RMI port.
    TCP PORTAL35:1581 caapiranga:12405 ESTABLISHED
    and then when I stop the instance in the OAS, the client shows an exception telling that the connection was lost.
    An curious thing is that the ons.log doesn't log this connection ;/

  • JNDI lookup problem (II)

    after reading the reply from Michael Lehmann and changed to 3101. It did connect to the JNDI! now. the problem turn to the domain/application name in the provider_url:
    env.put(Context.PROVIDER_URL, "ormi://10.6.208.6:3101/XXX");
    my question is how you guys define the domain/application name? and how the app server knows which OC4J containing this domain/application for i have several OC4J installed on my appserver?
    Thanks.

    how you guys define the domain/application name? and
    how the app server knows which OC4J containing this >domain/application for i have several OC4J installed on >my appserver?The application name is part of the deployment. On Oracle9iAS for example, I deploy the ear file with a command like this:
    dcmctl redeployApplication -file myEJB.ear -application myEJB
    and myEJB becomes the application part of the provider URL.
    On a stand alone OC4J the command looks like:
    java -jar <oc4j_home>\j2ee\home\admin.jar ormi://127.0.0.1/ admin **** -deploy -file myEJB.ear -deploymentName myEJB
    As for deploying across clusters, this is the magic of DCM or Oracle Enterprise Manager. If you have configured a cluster the DCM infrastructure takes care of the heavy lifting for you. For more information on DCM and related administrative operations, see:
    http://download-west.oracle.com/docs/cd/A97688_08/generic.903/a97681/dcm2.htm#620714
    Where it gets tricky is having a remote client lookup as in your initial example versus working in a client colocated with the EJB. Right now in 9.0.3 colocated lookups work automatically whereas remote lookups require the workaround of identifying the RMI port number or using jndi.properties file to hide the range of ports your client might try.
    In 9iAS 9.0.4, as per this note:
    9.0.3 / EJB / RMI-Ports / Islands-Configuration??
    the process manager gets a new API that lets the client inquire over which ports should be used.
    Mike.

  • Websphere jndi Lookup error

    Hi all,
    I have 3 ear projects and 1 utility project.
    1- utility jar
    1- EJB
    1- Web UI client for ejb
    1 - MDB client for ejb
    i am able to compile with out errors and started the server successfully.
    As i go through the application and when i look up for the ejb bean i am getting the following error.
    [10/12/07 16:41:27:035 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_0.txt
    [10/12/07 16:41:27:051 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_0.txt
    [10/12/07 16:41:27:066 CDT] 00000021 BeanMetaData  E   CNTR0075E: The user-provided class "com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_fcba446f" needed by the EnterpriseBean could not be found or loaded.
    [10/12/07 16:41:27:332 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_1.txt
    [10/12/07 16:41:27:379 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_1.txt
    [10/12/07 16:41:27:691 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_2.txt
    [10/12/07 16:41:27:707 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_2.txt
    [10/12/07 16:41:27:723 CDT] 00000021 EJBContainerI E   WSVR0068E: Attempt to start EnterpriseBean PerConfinementEARProject#PerConfinementEJBProject.jar#PerConfinementService failed with exception: com.ibm.ejs.container.ContainerException: Failed to initialize BeanMetaData instance; nested exception is:
         java.lang.ClassNotFoundException: com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_c3c0b315
         at com.ibm.ejs.container.BeanMetaData.<init>(BeanMetaData.java:1433)
         at com.ibm.ws.runtime.component.EJBContainerImpl.createBeanMetaData(EJBContainerImpl.java:1956)
         at com.ibm.ws.runtime.component.EJBContainerImpl.createDeferredBeanMetaData(EJBContainerImpl.java:4600)
         at com.ibm.ws.runtime.component.EJBContainerImpl.access$000(EJBContainerImpl.java:435)
         at com.ibm.ws.runtime.component.EJBContainerImpl$3.run(EJBContainerImpl.java:4399)
         at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
         at com.ibm.ws.runtime.component.EJBContainerImpl.initializeDeferredEJB(EJBContainerImpl.java:4396)
         at com.ibm.ejs.container.HomeOfHomes.getHome(HomeOfHomes.java:345)
         at com.ibm.ejs.container.HomeOfHomes.internalCreateWrapper(HomeOfHomes.java:481)
         at com.ibm.ejs.container.EJSContainer.createWrapper(EJSContainer.java:4278)
         at com.ibm.ejs.container.WrapperManager.faultOnKey(WrapperManager.java:528)
         at com.ibm.ejs.util.cache.Cache.findAndFault(Cache.java:496)
         at com.ibm.ejs.container.WrapperManager.keyToObject(WrapperManager.java:481)
         at com.ibm.ejs.oa.EJSOAImpl.keyToObject(EJSOAImpl.java:553)
         at com.ibm.ejs.oa.EJSRootOAImpl.keyToObject(EJSRootOAImpl.java:271)
         at com.ibm.rmi.corba.ObjectManager.lookupServant(ObjectManager.java:104)
         at com.ibm.CORBA.iiop.ServerDelegate.getServant(ServerDelegate.java:302)
         at com.ibm.rmi.iiop.ORB.lookupLocalObject(ORB.java:591)
         at com.ibm.CORBA.iiop.ORB.lookupLocalObject(ORB.java:1446)
         at com.ibm.rmi.iiop.CDRInputStream.newObjRef(CDRInputStream.java:1298)
         at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1275)
         at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1239)
         at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:107)
         at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:95)
         at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3677)
         at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3227)
         at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3578)
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:2154)
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1895)
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:599)
         at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2215)
         at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:536)
         at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
         at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
         at javax.naming.InitialContext.lookup(InitialContext.java:363)
         at com.bcbsmn.claims.perconf.managedbean.SearchBean.search(SearchBean.java:315)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:615)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:127)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Caused by: java.lang.ClassNotFoundException: com.bcbsmn.claims.perconf.ejb.EJSStatelessPerConfinementServiceHomeBean_c3c0b315
         at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:472)
         at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:373)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:561)
         at com.ibm.ejs.container.BeanMetaData.loadExistedClass(BeanMetaData.java:3763)
         at com.ibm.ejs.container.BeanMetaData.<init>(BeanMetaData.java:1329)
         ... 71 more
    [10/12/07 16:41:27:973 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_3.txt
    [10/12/07 16:41:27:988 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.27_3.txt
    [10/12/07 16:41:28:238 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_0.txt
    [10/12/07 16:41:28:254 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_0.txt
    [10/12/07 16:41:28:504 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_1.txt
    [10/12/07 16:41:28:519 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_1.txt
    [10/12/07 16:41:28:754 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_2.txt
    [10/12/07 16:41:28:848 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.28_2.txt
    [10/12/07 16:41:29:066 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.29_0.txt
    [10/12/07 16:41:29:113 CDT] 00000021 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\ibm\SDP70\runtimes\base_v61\profiles\AppSrv02\logs\ffdc\server1_7dc27dc2_07.10.12_16.41.29_0.txt
    [10/12/07 16:41:29:113 CDT] 00000021 Helpers       W   NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
    Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
    Context method: lookupExt
    Context name: BCBSMN79477Node02Cell/nodes/BCBSMN79477Node02/servers/server1
    Target name: com/bcbsmn/claims/perconf/PerConfinementService
    Other data: ""
    Exception stack trace: javax.naming.NamingException: Error during resolve [Root exception is org.omg.CORBA.portable.UnknownException:   vmcid: 0x0  minor code: 0 completed: Maybe]
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1939)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
         at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
         at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
         at javax.naming.InitialContext.lookup(InitialContext.java:363)
         at com.bcbsmn.claims.perconf.managedbean.SearchBean.search(SearchBean.java:315)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:615)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:127)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Caused by: org.omg.CORBA.portable.UnknownException:   vmcid: 0x0  minor code: 0 completed: Maybe
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:2193)
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1895)
         at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:599)
         at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2215)
         at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:536)
         at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4351)
         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1901)
         ... 38 moreCan any body tell me what's wrong with it? i have seen all the stubs generated it is looking for but not able to load/recognize it? And also i need to mention other problem is that everytime i compile, deploy and start the server i am getting open failure exception and server not recognizing the ejb jar and if i close and restart the RSA server starts well.
    Pls help me in solving this issue.

    Hi All
    Two separate webapps, have different names for
    Datasources, on the same host and port. Both
    application work fine independently.
    When we deploy both applications on the same app
    server(websphere), whichever we executes first gets
    its datasource from JNDI lookup and works fine, but
    when we try second application it have problem in
    finding its data source from JNDI lookup. If we start
    this second application first, it will work fine, but
    now another will have the same problem in its JNDI
    lookup.
    Any idea why.
    Thanks
    ....RanvirHi Ranvir,
    Do you mean you try to reach the same datasource with different names or do you try to reach different datasources over the same port?
    If you try the first issue you shouldn't get any trouble. At least it works fine with JBOSS for example.
    But if you try to do the latter in my oppinion you don't have a JNDI problem but a problem with socket binding: the two different databases must be contacted over different ports.
    What do WebSphere's logs tell?
    Best regards
    Andy

  • Default RMI port 1099

    Hello,
    Does anybody know how to change the default RMI port 1099 for
    WebLogic implementation of RMI. Is there some config parameter
    which will do it. I happened to have two RMI registry running
    on one computer and I would like to run them on two different
    ports (one of them is not WebLogic and not our application).
    So I have control anly of one of them and do not want to connect
    to the existing rmi registry.
    Thanks, Lev

    1099 is the port the java.rmi registry runs on. The WLS registry is a specialized namespace in the WLS JNDI name tree, so it is bound to the same port as the WLS instance. For example, a WLS instance started with
    java.exe .... -Dweblogic.system.listenPort=7701 -Dweblogic.system.SSLListenPort=7702 weblogic.Server
    will respond to
    weblogic.rmi.Naming.lookup("rmi://localhost:7701/foo");
    or
    weblogic.rmi.Naming.lookup("rmi://localhost:7702/foo");
    but not
    weblogic.rmi.Naming.lookup("rmi://localhost:1099/foo");
    Lev wrote:
    Hello,
    Does anybody know how to change the default RMI port 1099 for
    WebLogic implementation of RMI. Is there some config parameter
    which will do it. I happened to have two RMI registry running
    on one computer and I would like to run them on two different
    ports (one of them is not WebLogic and not our application).
    So I have control anly of one of them and do not want to connect
    to the existing rmi registry.
    Thanks, Lev

  • Clarification for client JNDI lookups needed

    Hello,
    While analyzing j2eeguide directory samples under iAS 6.0 SP3 I could see that this code is used on the client side for JNDI lookups (from warehouse example):
    Properties env = new Properties();
    env.put("java.naming.factory.initial",
    "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", "iiop://" + host + ":"+port);
    Context initial = new InitialContext(env);
    Object objref = initial.lookup("ejb/MyWarehouse");
    In runtime deployment descriptor for this sample we have these lines:
    <ias-ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>MyWarehouse</ejb-name>
    <guid>{a430b5c0-673f-11d4-a025-0010a4e78552}</guid>
    Does it mean that iAS automatically places beans under java:comp/env/ejb directory? This is recommended (but not required) place by J2EE 1.3 spec. For other AppServers I need explicitly specify through <jndi-name> clause (in form <jndi-name>ejb/MyWarehouse</jndi-name>) in which place my bean should be placed and thus could put them under for example java:comp/env/testejb/MyWarehouse. Any comments on this?
    Thank you,
    Andrejus

    I'm using a Singleton class to cache HomeInterfaces. The first time a
    HomeInterface is requested, the JNDI lookup is done, after that, all
    requests to that HomeInterface are handled by the cache. Works great, no
    problems. AFAIK there are no problems with storing the HomeInterface
    reference and reusing it.
    Hope that helps,
    Nils
    Tiffany wrote:
    >
    JNDI lookups are expensive timewise. Our question is ... would it be
    pratical to lookup all our EJB Home interfaces once at startup and store
    these references in a global class accessible to all clients? These home
    interfaces then become readily available factories for acquiring instances
    of remote interfaces. Is there anything wrong with this picture? Is this a
    problem because these home stubs are not reentrant and may be accessed
    concurrently by more than one client? Is there a problem with have one home
    reference create multiple remote references of an ejb?
    Any light that can be shed on this question wouls be appreciated.
    Thanks.
    tiffany
    San Diego--
    ============================
    [email protected]

Maybe you are looking for

  • Excise Report For Materials

    Hi, I am creating Excise Report for Materails . My requirement i am creating 3 radio buttons in selection screen. Functionality of 1 radio button It displays all the excise details . This is i am getting from Mseg and Mkpf and j_1iexdtl and j_1iexdth

  • Whats a good movie making app or program??

    looking for a good movie making program for my mac book pro, the Imovie thats already on here is too basic....

  • Amount right aligned

    Hi, Could you please advise what is the user setting to make the amount column showing in standard report right aligned? Regards, Junior

  • I lost an .msi file and cannot do updates, how do i fix the file?

    I lost an .msi file and cannot do updates to my Itunes system, Apple has not been abe to help, where do i find the .msi file or how do i repair the system?  All prior updates to the system have worked, but the latest 10.5.2 will not update due to thi

  • Error code-9006 iTunes wont finish my download

    I was trying to download Monk Season 3 and as it was downloading it keeps coming up with the error message 9006. I have checked all connections on my end and have not had problems downloading before. I am checking to see if anyone else has had proble