aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes JNDI and WAS Deployment Descriptot Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "JNDI and WAS Deployment Descriptot" Watch "JNDI and WAS Deployment Descriptot" New topic
Author

JNDI and WAS Deployment Descriptot

Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
Good Afternoon to All!

I have been scratching my head all day yesterday trying to understand this error:


quote:
--------------------------------------------------------------------------------
[2005-06-15 09:44:38,203][Servlet.Engine.Transports : 1][FATAL][{ServiceLocator}{getHome}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:Name comp/env/ejb not found in context "java:".}]
{ServiceLocator}{getHome}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:Name comp/env/ejb not found in context "java:".}
--------------------------------------------------------------------------------



What is going on is the user is logging into the web application. The process is the user comes in from the web container and enters the EJB container through the AdminEJB. The AdminEJB has a reference to a singleton POJO entitled ServiceLocator. This POJO follows the locator pattern. One of the things the Locator is attempting to accomplish is retrieving the CacheEJBLocalHome. This Cache ejb has a JNDI name of
quote:
--------------------------------------------------------------------------------
ejb/CacheEJBHome
--------------------------------------------------------------------------------

I have promoted the Cache ejb to the Local and the Remote interfaces using WSAD.

I realize the lookup method can not find the EJB, but I do not know what is causing this behavior. I originally thought the AdminEJB needed a bean reference to the CacheEJB, but this did not work.

Any insight or debugging techniques into this issue would be greatly appreciated.

Thank you for reading my post.

Russ
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Russ,
A good debugging tip is to see if you can access the bean through the Univeral Test Client. (right click the server to get to it.) This will tell you if the error is in the configuration or the client.


[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
Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
Jeanne:

Thank You, Thank You! Your answered was what I was looking for--something to check the JNDI tree.

What I see in the tree is :

CacheEJBHome (pakage namee.ejb.cache._CacheEJBHome_Stub)

My understanding is this is the "home". This works great for the client perspective.

The bean has a Local too. I created the local so others can call the bean from inside the EJB container. I got the code running yesterday afternoon by using the home. This is not the correct way, but it got me further along in my coding until I could work out the steps for using a home and a local for a single bean.

Thank you very much for taking the time to offer some insight on how to debug the application within WSAD. Any more insight would greatly be appreciated.......

Russ
Russ Ray
Ranch Hand

Joined: Feb 11, 2003
Posts: 52
whoops I spoke to soon without checking all of the jndi tree.

My earlier post was for the home. When I go looking in the tree local EJB Beans. I notice a ejb entry for my CacheEJB Bean:
CacheEJBHome (package.ejb.cache.EJSLocalStatelessCacheEJBHome_d3064579)


This tells me I can get this local to by using the jdni, but I am now more confused. When I created the Stateless Session bean I set the jndi name to be:
ejb/CacheEJBHome
'ejb' is below the tree root. This will get me the home. What I want is the local. The local us located under [local ejb beans]/ejb/CacheEJBHome.

What jndi name do I use? If I use 'ejb/CacheEJBHome' I get the home. When I attempt to cast this to the local, I get a class cast exception.

What am I missing?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Russ,
You're "missing" an undocumented feature. WSAD automatically creates the local JNDI name for you. It is local:ejb/whateverYourJndiNameIs.

So if your remote JNDI name is "ejb/Test", the local one is "local:ejb/ejb/Test."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI and WAS Deployment Descriptot