EJB Adaptor - Test Connection fails [1]

I created an Alias from the EJB Adaptor (Admin) page for an EJB running locally on Websphere server. As required, I provided the Initial Context factory and the provider URL. I also selected ‘Websphere 4’ as the JNDI Server Type since I am running Websphere 4.0 test environment on WSAD 4.0.3 .

When I click on Test button, the test connection fails and I get this message - “testConnFail: AliasTestImpl.test - found null or closed connection”.

On Integration Server console, this is what I see:

2002-10-18 14:06:22,473 [B2B HTTP Handler 127.0.0.1] ERROR - [BASEJBA.1000.0014]
MyConnection.open - ‘new InitialContext’ threw this: type(javax.naming.NoInitial
ContextException), msg(Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory)
2002-10-18 14:06:22,483 [B2B HTTP Handler 127.0.0.1] ERROR - [BASEJBA.1000.0015]
MyConnection.open - previous exception wrapped: msg(java.lang.ClassNotFoundExcep
tion), rootCause com.ibm.websphere.naming.WsnInitialContextFactory)
2002-10-18 14:06:22,483 [B2B HTTP Handler 127.0.0.1] ERROR - AliasTestImpl.test - found null or closed connection.

On the error log, it says: 2002-10-18 14:08:40 EDT com.wm.pkg.imdk.alias.AliasTestFailException:testConnFail: AliasTestImpl.test - found null or closed connection

Any ideas?

I am getting this same exact error. Has anyone found a resolution to this problem? I am trying to connect to websphere 4.0.5.

I too am getting this exact same error, though when running WebLogic 7.

I’ve found that the alias succeeds when running on the same machine as the WebLogic instance, but a different host on the same subnet fails. I don’t know why this is happening. The configurations on both machines are exactly the same. I have the client EJB jars and weblogic.jar in the IS/lib/system directory, and IS is directed to use the jvm included with the weblogic install via setting the JAVA_DIR in the server.bat file.

What’s the reason it would work on localhost but not remotely?

Hi everyone. I have figured out the problem I was having when trying to connect to the v4.0.1 EJB Server from my IS version 6. It turns out that if I do not install the service pack 2, I am able to establish a connection to the EJB Server following the installation directions from the pdf file. When I do install the service pack 2, I get connection errors. Does anyone know why this is the case? In the meantime, I will have to work without the service pack.

adios,
-Gurpreet

I am having the same problem after I upgraded the IS 6.0.1 to SP2. I have a custom adapter connecting to EJB on WAS 4.0.5. It works fine with SP1. Any solution/resolution/advice from webMethods? Here is the stack trace.

javax.naming.ConfigurationException: Could not create an instance of the class null. . Root exception is java.lang.NullPointerException
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:123)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:76)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.init(InitialContext.java:231)
at javax.naming.InitialContext.(InitialContext.java:207)
at com.ams.adapter.advantage.connection.AdvantageConnection.getInitialContext(AdvantageConnection.java:514)

I have got the same problem as palachandra got
2002-10-18 14:06:22,473 [B2B HTTP Handler 127.0.0.1] ERROR - [BASEJBA.1000.0014]
MyConnection.open - ‘new InitialContext’ threw this: type(javax.naming.NoInitial
ContextException), msg(Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory)
2002-10-18 14:06:22,483 [B2B HTTP Handler 127.0.0.1] ERROR - [BASEJBA.1000.0015]

Gurpeet are you talking about IS SP2 or EJB Adapter SP2 ?

-sathish

Guys, Hope this solves your problems:

To connect to a version 4.0.1 (and supposable any version 4):

  1. copy from the <WebSphere_install_directory>\AppServer\java\jre someplace locally

  2. remove <local_copy>\jre\lib\ext\ibmjcefw.jar

  3. copy to following jar files from <WebSphere_install_directory>\AppServer\lib to <IS_DIR>\packages\imdk\code\jars
    bootstrap.jar
    csicpi.jar
    ejbcontainer.jar
    iwsorb.jar
    j2ee.jar
    jts.jar
    ns.jar
    ras.jar
    ujc.jar
    utils.jar
    websphere.jar

  4. Copy the beans from <WebSphere_install_directory>\AppServer\installedApps<whatever>.ear to <IS_DIR>\packages\imdk\code\jars

  5. Update <IS_DIR>\bin\server.bat to set JAVA_DIR=<local_copy>\jre

  6. make sure ejb.jar is in <IS_DIR>\lib\jars

To connect to a version 5:

  1. copy from the <WebSphere_install_directory>\AppServer\java\jre someplace locally

  2. remove <local_copy>\jre\lib\ext\ibmjcefw.jar

  3. copy to following jar files from
    <WebSphere_install_directory>\AppServer\lib to <IS_DIR>\packages\imdk\code\jars
    ecutils.jar
    ejbcontainer.jar
    ejbportable.jar
    ffdc.jar
    idl.jar
    iwsorb.jar
    j2ee.jar
    lmproxy.jar
    naming.jar
    namingclient.jar
    ras.jar
    sas.jar
    tx.jar
    txPrivate.jar
    utils.jar
    wsexception.jar
    wssec.jar

  4. Copy from <WebSphere_install_directory>\AppServer\properties to <IS_dir>\packages\WmEJB\code\classes\
    implfactory.properties
    jndi.properties
    jndiprovider.properties

  5. Copy the beans from <WebSphere_install_directory>\AppServer\installedApps<whatever>.ear to <IS_DIR>\packages\imdk\code\jars

  6. Update <IS_DIR>\bin\server.bat to set JAVA_DIR=<local_copy>\jre

  7. delete the ejb.jar from <IS_DIR>\lib\jars

Hi Siva,

we have followed your instructions but am still getting the same error, which I have explained in the EJB 1.2 error post.
One thing I have observed in the above instructions for WebSphere 5.0 is
step 4. I could not find jndi.properties and jndiprovider.properties files.
Should I be having in any of the .jar files ?

Any clues on this.

Thanks in advance.
Naveen

I am trying to configure with websphere 5.0.

I followed the steps specified by Siva. I was able to test the connection and see the bean that has been deployed using the Service Browser.

I created a service, using Service Generation. When I run this service, it fails at the point of invoking the method with the following error. Does anybody have an idea regarding the same.

The Context.class is present in client.jar in IntegrationServer/lib directory.

EJBServices.invokeEJBMethod - beanWrap.invokeMethod threw this: type(com.wm.pkg.ejb.EJBException), msg(RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException:

Trace from server: 1198777258 at host BRDT86075 >>

java.rmi.RemoteException: ; nested exception is:
java.lang.NoClassDefFoundError: com/wm/app/b2b/client/Context

java.lang.NoClassDefFoundError: com/wm/app/b2b/client/Context

at com.wm.ejb.samples.hello.HelloBean.getMessage(HelloBean.java:119)

at com.wm.ejb.samples.hello.EJSRemoteStatelessHello_404ee3b2.getMessage(EJSRemoteStatelessHello_404ee3b2.java:32)

at com.wm.ejb.samples.hello._EJSRemoteStatelessHello_404ee3b2_Tie._get_message(_EJSRemoteStatelessHello_404ee3b2_Tie.java:152)

at com.wm.ejb.samples.hello._EJSRemoteStatelessHello_404ee3b2_Tie._invoke(_EJSRemoteStatelessHello_404ee3b2_Tie.java:88)

at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:582)

at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:437)

at com.ibm.rmi.iiop.ORB.process(ORB.java:320)

at com.ibm.CORBA.iiop.ORB.process(ORB.java:1544)

at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2063)

at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:63)

at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)

<< END server: 1198777258 at host BRDT86075

; nested exception is:
java.lang.NoClassDefFoundError: com/wm/app/b2b/client/Context)

Thanks
Srinidhi

you will find the jndi & jndiprovider properties files in namingclient.jar.

Srinidhi,

Where did you get “com.wm.ejb.samples.hello.HelloBean.getMessage”? Is it your own service or a webMethods supplied service?

Siva.

Hi Siva,

Did the following steps as suggested by Siva and from the Install guide

  1. copied implfactory.properties to WmWJB/code/classes
  2. copied IBMJDK to local directory
  3. set IS to point to this JDK in the server.bat
  4. removed sun_micr.rsa and sun_micr.sf from activation.jar
  5. removed the following jars from IBMJDKLOCALCOPY/lib/ext
    ibmjcefw.jar
    ibmjceprovider.jar
    ibmpkcs.jar
    ibmpkcs11.jar
    local_policy.jar
    US_export_policy.jar
  6. copied the following jars from websphere/Appserver/lib to imdk/code/jars
    ecutils.jar
    ejbcontainer.jar
    ejbportable.jar
    ffdc.jar
    idl.jar
    iwsorb.jar
    j2ee.jar
    lmproxy.jar
    naming.jar
    namingclient.jar
    ras.jar
    sas.jar
    tx.jar
    txPrivate.jar
    utils.jar
    wsexception.jar
    wssec.jar
  7. extracted jndi.properties and jndiprovider.properties from naming.jar and extracted them to WmEJB/code/classes

when i try to test the alias i get an error saying

2003-11-12 11:50:01,658 [HTTP Handler 172.16.140.69] ERROR - [BASEJBA.1000.0014]
MyConnection.open - ‘new InitialContext’ threw this: type(javax.naming.NoInitial
ContextException), msg(Cannot instantiate class: com.ibm.websphere.naming.WsnIni
tialContextFactory)
2003-11-12 11:50:01,658 [HTTP Handler 172.16.140.69] ERROR - [BASEJBA.1000.0015]
MyConnection.open - previous exception wrapped: msg(java.lang.ClassNotFoundExcep
tion), rootCause(com.ibm.websphere.naming.WsnInitialContextFactory)
2003-11-12 11:50:01,658 [HTTP Handler 172.16.140.69] ERROR - AliasTestImpl.test

  • found null or closed connection

The class com.ibm.websphere.naming.WsnInitialContextFactory is present in naming.jar and this is present in imdk/code/jars

Not sure what the problem is. Checked the EJB server also … that is also running

Let me know what else i can try. I have tried by putting the jars in lib/jars , lib/system etc … but to no avail

Regards
Gaurav

Hi Gaurav,
You just missed one file “websphere.jar” . Copy from websphere/Appserver/lib to imdk/code/jars

There is no websphere.jar in websphere5.0

Hi Siva,

com.wm.ejb.samples.hello.HelloBean.getMessage is my own EJB bean which has been deployed. In the flow service, when an invoke is made to this bean, i get the error which has been mentioned above

Thanks and Regards,
Srinidhi

was there any resolution to this… we are encountering a similar exception in talking from webmethods 6.01sp2 to websphere 5.02

the jndiprovider.properties file is indeed in the classpath.
-mark

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:190)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:108)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.init(InitialContext.java:231)
at javax.naming.InitialContext.(InitialContext.java:207)
at LCOMM100.Utils.getInitialContext(Utils.java:2332)
at LCOMM100.Utils.GetInitialContext(Utils.java:987)
at java.lang.reflect.Method.invoke(Native Method)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:287)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:344)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:97)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:167)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:204)
at com.wm.util.pool.PooledThread.run(PooledThread.java:105)
at java.lang.Thread.run(Thread.java:512)