• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI and WAS Deployment Descriptot

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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."
reply
    Bookmark Topic Watch Topic
  • New Topic