Problem in JNDI Lookup of Deployable Proxy inside logon.par

Hi,
I have customized the Logon par file and have a functionality to call a webservice when the Password Reset happens.
<b>from the ResetPassword.jsp , SAPMLogonLogic.java is getting called ,and there is a method called performResetPassword().</b>
I am calling a Deployable Proxy in that method by using the below code,
<b>Gateway objGateway=(SMSGateway)ctx.lookup("java:comp/env/MailProxy");
MailGatewayViDocument objSMSGatewayViDocument=(MailGatewayViDocument )objGateway.getLogicalPort("wsPort_Document",MailGatewayViDocument.class);</b>
objMailGatewayViDocument.sendMail(...);
I am getting the Exception,
<b>com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MailProxy.</b>
I have deployed the Deployable Proxy in the J2EE Engine and add this API Jar as the External Library (Project >Properties>Java Build Path ---> Add External jars...Added the .jar file generated in the Proxy Project).
Please let me know the possible solutions where i can call a deployable proxy inside the logon par file.
Thanks and Regards,
Sekar

Hi Sekar!
  Try this:
MailGateway objMailGateway=(MailGateway)ctx.lookup
("wsclients/proxies/sap.com/MailProxy/com.ms.sap.sms.MailProxy/wsPort_Document");
  I have understood you're deploying a par file... if you are doing this way, don't forget to put a reference to the webservice in portalApp.xml:
  <property name="PrivateSharingReference" value="SAPJ2EE::sap.com/com.ms.sap.sms.MailProxy"/>
  Hope this can work.
  Are you sure this destination is the one you are looking for?
sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document
  It seems to be anther app. If this is the correct app then the JNDI should be:
   MailGateway objMailGateway=(MailGateway)ctx.lookup
("wsclients/proxies/sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document");
  If this fails and if you have have source code of the proxy app, check out the application.xml file, and look for Display name. Also look for the application-j2ee-engine.xml file, and look for the 'Vendor name', and post them please.
  Eneko
Message was edited by:
        Eneko Rodriguez

Similar Messages

  • Problem in JNDI Lookup of Deployable Proxy from the logon par file

    Hi,
    I have customized the Logon par file and have a functionality to call a webservice when the Password Reset happens.
    <b>from the ResetPassword.jsp , SAPMLogonLogic.java is getting called ,and  there is a method called performResetPassword().</b>
    I am calling a Deployable Proxy in that method by using the below code,
    <b>Gateway objGateway=(SMSGateway)ctx.lookup("java:comp/env/MailProxy");                    
    MailGatewayViDocument objSMSGatewayViDocument=(MailGatewayViDocument )objGateway.getLogicalPort("wsPort_Document",MailGatewayViDocument.class);
    objMailGatewayViDocument.sendMail(...);</b>
    I am getting the Exception,
    <b>com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MailProxy.</b>
    I have deployed the Deployable Proxy in the J2EE Engine and add this API Jar as the External Library (Project >Properties>Java Build Path ---> Add External jars...Added the .jar file generated in the Proxy Project).
    <b>Please let me know the possible solutions where i can call a deployable proxy inside the logon par file</b>.
    Thanks and Regards,
    Sekar

    Hi,
    I have fixed this error by changing the lookup as follows.
    InitialContext ctx=new InitialContext();
    Gateway objGateway=(Gateway)ctx.lookup("wsclients/proxies/sap.com/GatewayProxy/com.ms.sap..GatewayProxy");
    Just open Visual Administrator and look for the path under wsclients for proper naming.
    Thanks and Regards,
    Sekar
    Edited by: Sekar M on Jan 16, 2008 6:10 PM

  • Jndi lookup of deployable proxy

    Hey All,
    i try to call webservice via a deployable proxy.
    when looking it up i get a naming exception.
    i set up a jndi mapping in the client bean's ejb-j2ee-engine.xml, which reads as follows:
    <server-component-ref>
         <description>
         </description>
         <name>WeatherServiceProxy</name>
         <type>interface</type>
         <jndi-name>/wsclients/proxies/de.sap.coe/WeatherServiceProject/WeatherServiceProxy</jndi-name>
    </server-component-ref>
    i look up the proxy like this:
    ctx.lookup("java:comp/WeatherServiceProxy");
    i guess the mapping is incorrect. the documentation says to do reference the proxy like this:
    /wsclients/proxies/<ProviderName>/<ApplicationName>/<ProxyName>
    i do not understand however, what provider and application name are. i used the proxy's .ear filename as application name. for lack of better ideas i used the package structure as providername... it just seemed semantically similar ;-).
    Any help is well appreciated.
    Cheers, Michael

    Hello!
    i solved the problem: the providerName in my case was "sap.com".
    In order to find out the jndi-location you can go to visual Admin. Services --> JNDI Registry --> wsclients --> proxies ....
    or whatever else you're looking for.
    Cheers, Michael

  • JNDI Lookup code for EntityMananger  inside SessionBean

    Hi ,
    I am using JNDI look up inside my stateless session Bean for Thread Safety issues .
    That is
    @PersistenceContext(Unitname="someunit" name= "somename")
    Context ctx = new InitialContext();
    EntityManager em = (EntityManager)ctx.lookup("somename")Now i am having 4 methods for (CRUD) inside my sessionBean
    Do i need to use this lookup code inside my every method that is in all my 4 methods
    Please tell me this if i am having four methods inside my Session Bean do i need to do lookup inside each of my method.

    Thread safety issues? So you are saying that you actually had them, or you are assuming they will happen?
    Because I have written multiple applications that simply inject an instance of the entity manager into the EJB and I have never had any problems. The whole idea of dependency injection is to minimize the need for manual JNDI lookups; why are you trying to swim against the current?

  • Problem in JNDI lookup with Jdev JDEVADF_MAIN_GENERIC_061111.1900.4245

    I have a JMS topic defined in a standalone oc4j (11g) and I am doing a JNDI lookup on that from an application that runs in embedded oc4j of jdev. Look up fails but if I add the same topic in jms.xml of embedded oc4j, it starts to work fine. My point is topic name shouldn't be needed in jms.xml of embedded oc4j i.e. client side (topic is present in remote oc4j and rightly defined in jms.xml of that oc4j). I verified that by creating a command line java application and that one is able to do lookup on the same topic available in the standalone oc4j.
    I guess this problem is not specific to the label JDEVADF_MAIN_GENERIC_061111.1900.4245, it was there before also.
    Any pointers on what could be wrong when I run in JDev?
    Thanks,
    Vishal

    Please use the internal email distribution list jdev_us for 11 related questions.

  • JNDI lookup using a proxy server

    Hi,
    I'm trying to use a weblogic server as a proxy server for a cluster of
    weblogic servers. The static and dynamic content delivery works fine but
    when I try to do a JNDI lookup from an applet client, I get a name not
    resolved exception. I guess, it happens because the proxy server tries to
    resolve the name from it's JNDI tree, whereas I expect it to forward this
    request to one of the servers in the cluster. Is this possible? If it is, do
    I need to set up some parameters in the proxy server? If not, can I do this
    myself by writing a name resolution class which in turn will forward the
    request to one of the servers in the cluster?
    Any help would be greatly appreciated.
    thanks
    - sanjay

    when u say "cluster of weblogic servers"..u mean the weblogic`s inbuilt
    cluster..
    the reason i ask is weblogic`s cluster do provide JNDI clustering too by using
    cluster-wide naming tree..
    Sanjay Aggarwal wrote:
    Hi,
    I'm trying to use a weblogic server as a proxy server for a cluster of
    weblogic servers. The static and dynamic content delivery works fine but
    when I try to do a JNDI lookup from an applet client, I get a name not
    resolved exception. I guess, it happens because the proxy server tries to
    resolve the name from it's JNDI tree, whereas I expect it to forward this
    request to one of the servers in the cluster. Is this possible? If it is, do
    I need to set up some parameters in the proxy server? If not, can I do this
    myself by writing a name resolution class which in turn will forward the
    request to one of the servers in the cluster?
    Any help would be greatly appreciated.
    thanks
    - sanjay

  • Problem in JNDI lookup.

    Hi,
    I have a JSP running on tomcat. And it accesses an EJB running on weblogic thru a local bean. When the following JNDI lookup code is executed, I get errors. Errors follow the code. Please Help.
    Thanks!
    public InitialContext getInitialContext() throws NamingException
    // Utils.Trace("****** in getInitialContext ******");
    // web logic server and jsp engine NOT weblogic
    if (url != null && url.length() > 0)
    //Hashtable env = new Hashtable();
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    // assumes that JSP and EJB container are on the same box,
    // otherwise EJB hostname should be specified
    //env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    env.put(Context.PROVIDER_URL, url);
    System.out.println("Using t3 services");
    return new InitialContext(env);
    // weblogic server and weblogic jsp, or inprise server (JBuilder's default JSP)
    else
    System.out.println("Not Using t3 services");
    return new InitialContext();
    The ERRORS are
    =====================================================================
    org.apache.jasper.JasperException: weblogic/common/T3Services
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)
    root cause
    javax.servlet.ServletException: weblogic/common/T3Services
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
         at org.apache.jsp.login_jsp._jspService(login_jsp.java:276)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)

    Your JSP trying to load the weblogic context factory to perform the lookup, but can't find it. Your servlet engine must have access to the weblogic.jndi.WLInitialContextFactory class (in weblogic.jar).

  • Problem in Jndi lookup for  ITaskService

    HI,
    I am trying to initiate oracle bpm Human task programatically by using Java remotely.
    for this I am using following JNDI lookup for ITaskService.
    Hashtable ht = new
                  Hashtable<IWorkflowServiceClientConstants.CONNECTION_PROPERTY,java.lang.String>();
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY, 
                     "weblogic.jndi.WLInitialContextFactory");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:7001");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "username"); 
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "password");
              Context ctx  = new InitialContext(ht);
    ITaskService taskService = (ITaskQueryService)ctx.lookup("ejb/bpel/services/workflow/TaskServiceBean");
    taskService.initiateTask(task);
    It the right approach or not.
    Please help.

    To access human workflow api remotely try using the following code :
    Map properties = new HashMap();
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:8001");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "welcome1");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "weblogic");
    IWorkflowServiceClient wfSvcClient =
      WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT, properties, null);
      //Get the task query service
      ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
      //Login as weblogic
      IWorkflowContext ctx = querySvc.authenticate("weblogic","welcome1".toCharArray(),null);
    after getting the workflow context, you can call any method like query task list. perform actions etc. just see the api doc.
    Regards,
    Anshul

  • Problems with JNDI lookup for java:comp/env/ejb

    Hi all,
    I'm using OC4J 9.0.3 and I have problems when looking up for the local
    EJB context.
    I have a SLSB which refers to another SLSB via a JNDI mapping like
    shown below. Both services are deployed within one EAR file.
    (snippets of ejb-jar.xml and orion-ejb-jar.xml)
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>ServiceABean</ejb-name>
    <home>com.coi.ServiceAHome</home>
    <remote>com.coi.ServiceA</remote>
    <ejb-class>com.coi.ServiceABean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-ref>
    <ejb-ref-name>ejb/some/sub/packages/ServiceB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.coi.ServiceBHome</home>
    <remote>com.coi.ServiceB</remote>
    </ejb-ref>
    </session>
    </enterprise-beans>
    </ejb-jar>
    <orion-ejb-jar>
    <enterprise-beans>
    <session-deployment location="global/some/sub/packages/ServiceA" name="ServiceABean">
    <ejb-ref-mapping name="ejb/some/sub/packages/ServiceB" location="global/some/sub/packages/ServiceB" />
    </session-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    The ApplicationInitialContextFactory will be used (prepared by the container),
    so the lookup for ServiceB within a method of ServiceA should work as follows:
    public class ServiceABean implements SessionBean
    public void someMethod()
    InitialContext con = new InitialContext(); // will be of class ApplicationContext
    Context localEjbContext = (Context)con.lookup( "java:comp/env/ejb" );
    ServiceBHome serviceBHome = (ServiceBHome) PortableRemoteObject.narrow(
    localEjbContext.lookup( "some/sub/packages/ServiceB" ),
    ServiceBHome.class );
    The problem is now, that the lookup for "java:comp/env/ejb" doesn't work
    and throws a NameNotFoundException.
    To figure out what's actually happening during lookup I debugged a little bit and
    tried a few things:
    1. A lookup for "java:comp" works fine. It returns an instance of class FlatMapContext
    which consists of a hash map which itself contains an entry for "env".
    2. So a lookup for "env" on that FlatMapContext also works and returns an instance of SubContext.
    3. A lookup for "ejb" using this SubContext causes a NameNotFoundException
    with message "java:comp/env/ejb not found".
    4. A lookup like con.lookup( "java:comp/env" ) throws also a NameNotFoundException
    with message "java:comp/env not found (not inside a J2EE module, for instance a Web-App,
    EJB, or Application-Client)".
    Does anyone know something about this?
    Regards
    --thomas

    Hi Debu,
    Great! 9.0.4 will be released in june/july this year, right? Sorry for my ironical reaction, but does that mean, that I don't have any chance to get my whole stuff running in 9.0.3? I cannot believe that. Isn't there a wordaround I could apply? A setting or whatever to substitute the daft FlatCtx by something else that is implemented according to the spec?
    Regards
    --thomas

  • Problem with JNDI lookup

    hi,
    i created my own Queue and QueueConnectionFactory using the j2eeadmin tool. both objects show up just fine when i run j2eeadmin -listXXX
    however when i try to lookup either one of these with the runtime api, i get javax.naming.NameAlreadyBoundException
    my client code may not be correct, but here's what i have:
    InitialContext jndiContext = new InitialContext();
    jndiContext.lookup( name );
    where name is the name that object is bound to.
    if anyone has any idea what i'm doing wrong, please let me know.
    thanks,
    mark.

    u can set jndi name during u deploy the EJB ,for example ,after u start the deploytool ,u have built a group of ejb classes such as sessionbean, remote interface ,home interface ,then deploy them as a ejb,after this u can get the menu about alias ,so set the name when u write ur script to call the ejb ,just give the same name as u wrote just now

  • 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

  • Deployable proxy lookup problem

    Hello SAP Community, here is my issue:
    I need to access a web service in my web dynpro application, so I generated a deployable proxy from the wsdl file and deployed it to the server. I added the proxy's ClientAPI.jar to my web dynpro build path and tried to get its interface via jndi lookup, but I get a ClassCastException.
    The problem here is that when I look for my proxy in Visual Administrator's JNDI Registry, the class name is different from the one in Client API, as follows:
    JNDI Registry: ConsultaPadronServiceImpl
    Client API: ConsultaPadronService
    Debugging the code I can see that I get ConsultaPadronServiceImpl in my lookup, but when I try to do the casting to ConsultaPadronService I get the exception.
    Here is my code:
    try{
              InitialContext ctx = new InitialContext();
              Object obj = ctx.lookup("wsclients/proxies/sap.com/FonhapoWS/mx.gob.conavi.sap.ws.fonhapo.FonhapoProxy");
              ConsultaPadronService ser = (ConsultaPadronService)PortableRemoteObject.narrow(obj, ConsultaPadronService.class);
              port = (WsConsultaPadron)ser.getLogicalPort("WsConsultaPadronSoapHttpPort");
         }catch (Exception ex){
              IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
              msgMgr.reportException(ex.getMessage(), true);
    I really hope someone can help me out with this, I have already added the sharing reference to the proxy in my Web Dynpro project like <provider>/<EAR name> and still not working.
    Regards.

    Same issue here. did you resolve it?

  • Deployable proxy -JNDI lookup

    Hi All,
    I've created a Deployable proxy for my webservice and deployed the EAR. I can see JNDI registry in the visual administrator.
    I am now writing a simple  java client to call the proxy.
    1.
    try {
       Hashtable env = new Hashtable();
       env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              env.put(Context.PROVIDER_URL, "localhost:50104");
            Context ctx = new InitialContext(env);
            Object  obj = ctx.lookup("/wsclients/proxies/sap.com/flight");
              FlightListService  ser=(FlightListService)obj;
    Lookup went fine…but I am getting classcastexception at the stsetment "FlightListService  ser=(FlightListService)obj;"
    2.
    try {
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              env.put(Context.PROVIDER_URL, "localhost:50104");
            Context ctx = new InitialContext(env);
            Object  obj = ctx.lookup("/wsclients/proxies/sap.com/flight/com.sap.flight");
              FlightListService  ser=(FlightListService)obj;
    In the above case Lookup itself failed.
    Please let me knowthe solution.
    Regards,Anilkumar

    AnilKumar,
    I have consumed similar Deployable WebService from an EJB and I remeber that I gave the Deployed Webservice EAR (Deployed WebService Proxy EAR) as a Application level reference in the application-j2ee-engine XML of the EAR surrounding the consuming EJB (Application EAR).
    How have you defined reference in your case.
    Also I had a lookup as below
    InitialContext ctx = new InitialContext();
    ZPointtoPointServiceService zpserv = (ZPointtoPointServiceService) ctx.lookup("wsclients/proxies/sap.com/DeployableWebServices/com.web.comp.RFCWebService");
    ZPointtoPointService zpp =(ZPointtoPointService) zpserv.getLogicalPort();
    Regards,
    Sudharshan N A

  • JNDI lookup problem in WAS 5.1

    Hello all,
    I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
    javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
         at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
         at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
         at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
         at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
         at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
         at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
         at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
         at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
         at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
         at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
         at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
         at javax.rmi.CORBA.Util.copyObject(Util.java:333)
         at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
         at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
         at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
    I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
    Thanks
    -ybh6336

    Hello all,
    I'm still stuck on this issue. Following are the entries related to my
    application when I do a 'dumpNameSpace':
       28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
       28
    com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
       29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
       29
    com.wdc.tedi.interfaces._DSValueLookupHome_Stub
       30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
       30
    com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
    - I only see the namespace entries for my Session beans. There's one
    entity bean also which does not show up.
    - I don't see anything for the Local Home interfaces, it shows only the
    Home interfaces.
    As additional information, I'm looking up 'TEDIObjectManagerLocal'
    using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
    'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
    either.
    Also, the XDoclet tags that I use to generate the interfaces for
    TEDIObjectManager bean are as follows:
    /* @ejb.bean name="TEDIObjectManager"
    *           display-name="TEDIObjectManager"
    *           description="TEDIObjectManager"
    *           jndi-name="ejb/tedi/TEDIObjectManager"
    *           local-jndi-name="ejb/TEDIObjectManagerLocal"
    *           type="Stateless"
    *           view-type="both"
    * @ejb.util generate="physical"
    * @ejb.ejb-ref ejb-name="TEDIObject"
    * view-type = "local"
    * ref-name = "ejb/TEDIObjectLocal"
    * @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
    */My ejb-jar.xml looks like following for that bean:
    <session >
             <description><![CDATA[TEDIObjectManager]]></description>
             <display-name>TEDIObjectManager</display-name>
             <ejb-name>TEDIObjectManager</ejb-name>
             <home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
             <remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
             <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
                <local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
                <ejb-link>TEDIObject</ejb-link>
             </ejb-local-ref>
          </session>AND following for the bean that is referencing it:
    <session >
             <description><![CDATA[TransformationEngine]]></description>
             <display-name>TransformationEngine</display-name>
             <ejb-name>TransformationEngine</ejb-name>
             <home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
             <remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
    <local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
                <ejb-link>TEDIObjectManager</ejb-link>
             </ejb-local-ref>
          </session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
    follows for the two beans:
    <ejbBindings
             xmi:id="Session_bnd_1"
             jndiName="ejb/tedi/TransformationEngine">
             <ejbRefBindings xmi:id="EJBRefBnd_1"
    jndiName="ejb/TEDIObjectManagerLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
          </ejbBindings>
    <ejbBindings
             xmi:id="Session_bnd_3"
             jndiName="ejb/tedi/TEDIObjectManager">
             <ejbRefBindings xmi:id="EJBRefBnd_2"
    jndiName="ejb/TEDIObjectLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
          </ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
    NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
    Reference binding: ejb/TEDIObjectManagerLocal
    JNDI Name: ejb/tedi/TEDIObjectManager
    There's one other similar binding that works for 'TEDIObjectManager'
    bean:
    Reference binding: ejb/TEDIObjectLocal
    JNDI Name: ejb/TEDIObject
    Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
    Really appreciate your time.
    Thanks
    -yogesh

Maybe you are looking for

  • Can we create purchase order through report programming?

    hi experts..... can we create purchase order through report programming?If yes plz give me the thread details?

  • Error : complete allocation structure while doing Ko88 settlement.

    Message no. KD503 Diagnosis During settlement, the system puts the sender debits into groups (assignments), which are settled using the same settlement cost element. The settlement assignment is made in the allocation structure, which is stored in th

  • Movies/videos causing iTunes to shut down

    My laptop recently crashed and the hard drive replaced. Fortunately all my music; movies; videos; and tv shows were on my Ipod classic. I reloaded itunes. Now the movies cause itunes to stop stating it cannot find the movie. The icon is there but no

  • Avi file at preview state is no sound

    after install M Lion, I tape the spacebar  to view the avi file and no sound. only avi. mp4 is ok. mkv cant see the video. how can it be fix?

  • Navigate to another iview

    Hi I have an EP project where I put two jsp's. When user presses link I would like to navigate to the other jsp. I put each jsp in a different iview. When user presses a link in the first iview he is supposed to be redirected to the second view. as a