• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

EJB lookup problem on WebSphere

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I’m stuck with a problem in WebSphere 5.1 with EJBs and enterprise applications.

I have 2 enterprise applications, A and B. Each has one stateless session EJB. There is also a WAR file in application A.

At runtime a client makes a call on a servlet in application A, it looks up EJB A and calls methods on it, and in turn this looks up EJB B in application B and calls methods on it.

It’s a big system and the goal is to do a complete automated system build via ANT from PVCS without involving WSAD. ie to get WebSphere to generate the EJB deployment code at the time of deploying the EARs. (ignore the IBM specific xmi files etc, for the time being they are hand crafted).

Deployment style 1, a temporary solution:

The EAR for A is built by ANT. When its deployed, WebSphere starts up the workbench and creates the missing EJB deployment code.

The EAR for B is built from WSAD, ie it contains EJB deployment code. On deployment WebSphere recognises that everthing needed is already present.

This works fine at both deployment and runtime.
Deployment style 2, ie the goal:

The EAR for A is built by ANT.
The EAR for B is built by ANT.

The only difference between the structure of the EAR file for B is that it is now missing the EJB deployment code (~ classes starting with underscore).

There are no errors at deployment time. But at runtime, when EJB A tries to lookup EJB B it can’t find it. I’ve checked the JNDI tree - its fine the correct class is stored against the jndi lookup name. The error is a class not found exception.


So what do I need to do in WebSphere such that the EJB deployment code generated for the EJB in application B falls within the classloader / classpath such that the EJB in application A can access it ?

I’m surprised the problem doesn’t occur in application A. WebSphere creates the EJB deployment code and wherever it puts it, its available to the EJB lookup from the servlet. However, they are in the same application.

Can any WebSphere experts help ?
author & internet detective
Posts: 40239
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

I agree with you - I�m surprised the problem doesn�t occur in application A too.

When I had problems deploying an app from Ant vs WSAD, I unzipped both ear files (and ejb files) to compare the META-INF directory.
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic