• 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 Context Problem

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm trying call a Session Bean from a JSP.
Every time I call it I get the following error:-
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance of the type 'mypackage.Travel' found for the ejb-ref Travel

I have checked all of the following files:-
ejb-jar.xml,
application-client.xml,
orion-application-client.xml,
orion-ejb-jar.xml,
orion-web.xml and web.xml
for any refrence to any of the following:-
<ejb-name>Travel</ejb-name>
<ejb-ref-name>Travel</ejb-ref-name>
<ejb-ref-mapping name="Travel" location="mypackage/TravelBean" />
<session-deployment name="Travel" location="mypackage/TravelBean" />
Within my JSP file I use:-
final String location = "java:comp/env/Travel";
Object boundObject = context.lookup(location);
Can anybody help?.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to move this thread to the J2EE EJB forum. I think you might get some faster responses there.
Mark
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not familiar with Orion, but it looks like you're attempting to define the EJB as "Travel" to JNDI but when you lookup the EJB via JNDI, you're asking for "mypackage.Travel".
JNDI names are just dictionary ids, BTW. there's no particular need to qualify them unless it helps you keep track of where to look if you're managing a complex mix of packages.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not familiar with Orion, either. But my guess would be that maybe you need the ejb client-jar (containing Home and Remote interfaces) in the webapp's WEB-INF/lib?
 
reply
    Bookmark Topic Watch Topic
  • New Topic