aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB application runs as WebSphere Application client, fails as JavaApplication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB application runs as WebSphere Application client, fails as JavaApplication" Watch "EJB application runs as WebSphere Application client, fails as JavaApplication" New topic
Author

EJB application runs as WebSphere Application client, fails as JavaApplication

Sandeep Murthy
Ranch Hand

Joined: Oct 05, 2005
Posts: 34
Hi,
I have developed a TestClient and an EJB module in WSAD 5.1(web sphere studio application developer).
( The ejb module has only stateless session beans. I'm accessing DB2 8.1 database from the session bean using type-4 jdbc driver)

It runs fine when i run the testclient as "Websphere v5.1 Application Client".
But when i run it as "Java Application", i'm getting a NamingException.
This same exception occurs when i generate an ear, deploy it on WebSphere and run the application.

The error stack-trace is as follows :

javax.naming.NamingException: The JNDI operation "lookup"on the context "localhost/nodes/localhost/servers/server1" with the name "ejb/com/thbs/PiggyBank/session/BankSessionHome" failed. Please get the root cause Throwable contained in this NamingException for more information. Root exception is java.lang.NoClassDefFoundError: com/ibm/ejs/jts/jts/CurrentFactory
at com.ibm.ws.naming.jndicos.CNContextImpl.suspendTransaction(CNContextImpl.java:4064)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3521)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1565)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at com.thbs.PiggyBank.TestClient.getReferences(TestClient.java:61)
at com.thbs.PiggyBank.TestClient.main(TestClient.java:628)

Observe one thing here :
it's trying to lookup on server1 while i'm running my application on other server with different ports(http,bootstrap,etc all dirrerent ports).
Server1 is another server running on Websphere in my system, while i'm trying to run my application in another server in WebSphere Studio, with different ports.
But this doesn't seem to be important, because i tried running the application after stopping the WebSphere srever, with same error.

What seems to be the problem ? How to fix it ?


SCJP 1.4
Senthil Somasundaram
Greenhorn

Joined: Jun 30, 2003
Posts: 17
Hi Sandeep,

use InitialContext with the proper input parameters (provider URL, Initialcontext factory) to lookup EJB in your java client.

There are lot of examples available in the sun site.



Senthil
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
senthil, can you give the url where in sun site(examples)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB application runs as WebSphere Application client, fails as JavaApplication