• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

EJB application runs as WebSphere Application client, fails as JavaApplication

Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
senthil, can you give the url where in sun site(examples)
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic