Unable to Call EJB - Websphere

This is a discussion on Unable to Call EJB - Websphere ; Hi, I have created EJB using RAD 6, and tested succesfully using Universal Test Client. But unable to get initialcontext using client Program. Below is the code snippet used to get initialcontext. Properties properties = new Properties(); properties.put(Context.PROVIDER_URL, "iiop://localhost:2809"); properties.put(Context.INITIAL_CONTEXT_FACTORY, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Unable to Call EJB

  1. Unable to Call EJB

    Hi,

    I have created EJB using RAD 6, and tested succesfully using Universal Test Client. But unable to get initialcontext using client Program.

    Below is the code snippet used to get initialcontext.


    Properties properties = new Properties();
    properties.put(Context.PROVIDER_URL, "iiop://localhost:2809");
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    Context initialContext = new InitialContext(properties);
    System.out.println("got context ?" +initialContext);


    Below is the exception trace:

    Jun 21, 2009 5:37:37 PM com.ibm.ws.naming.util.CommonHelpers
    WARNING: jndiproviderProperties
    Jun 21, 2009 5:37:37 PM com.ibm.ws.naming.util.CommonHelpers
    WARNING: jndiproviderProperties
    Jun 21, 2009 5:37:37 PM com.ibm.websphere.naming.WsnInitialContextFactory
    WARNING: noInitCtxFactoryImpl
    javax.naming.ConfigurationException: The property com.ibm.ws.naming.wsn.factory.initial is not set. The most likely cause is that the jar which contains the file com/ibm/websphere/naming/jndiprovider.properties cannot be found by the class loader.
    at com.ibm.websphere.naming.WsnInitialContextFactory. init_implClassCtor(WsnInitialContextFactory.java:1 94)
    at com.ibm.websphere.naming.WsnInitialContextFactory. getInitialContext(WsnInitialContextFactory.java:11 2)
    at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:675)
    at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:257)
    at javax.naming.InitialContext.init(InitialContext.ja va:233)
    at javax.naming.InitialContext.(InitialContext.java:2 09)
    at ejbs.EJBCaller.main(EJBCaller.java:29)

  2. Re: Unable to Call EJB

    The error message implies the problem: WsnInitialContextFactory most likely could not locate its jndiprovider.properties file. What are you using for a class path in the client program? Are you using a recommended thin client environment? For 7.0, that documentation is here:

    http://publib.boulder.ibm.com/infoce...oneclient.html

    For older releases, search the relevant InfoCenter for: thin client

  3. Re: Unable to Call EJB

    Hi,

    I have deployed my code in WAS 6.0.

    I am using Java client program that gets created by itself while developing EJB project in RAD.

  4. Re: Unable to Call EJB

    Hi,

    I have created EJB using RAD 7 and deployed my code in WAS 6.1. I am able to get initialcontext now. but getting "WARNING: WSVR0073W" when i tried doing lookup using context as

    initialContext.lookup("JNDI Name")

    Can anyone help me in fixing this warning.

    Thanks,

+ Reply to Thread