aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB lookup problem on WebSphere 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 lookup problem on WebSphere" Watch "EJB lookup problem on WebSphere" New topic
Author

EJB lookup problem on WebSphere

Jules Zendev
Greenhorn

Joined: Oct 14, 2005
Posts: 1
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 ?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Jules,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB lookup problem on WebSphere