• 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

Lookup problem for local beans on oc4j

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lookup of a local Bean as follows:

<%
Context context = new InitialContext();
jdevpackage.hrAppEJBLocalHome hrapphome = (jdevpackage.hrAppEJBLocalHome)context.lookup("java:comp/env/ejb/hrAppEJB");

// Create local object
jdevpackage.hrAppEJBLocal hrapp = (jdevpackage.hrAppEJBLocal)hrapphome.create();

%>

where the web.xml contains the reference of the bean as follows:

<ejb-ref>
<ejb-ref-name>hrApp</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>jdevpackage.hrAppEJBHome</home>
<remote>jdevpackage.hrAppEJB</remote>
</ejb-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/hrAppEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>jdevpackage.hrAppEJBLocalHome</local-home>
<local>jdevpackage.hrAppEJBLocal</local>
</ejb-local-ref>

gives the following Java exception:
javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance of the type 'jdevpackage.hrAppEJB' found for the ejb-ref hrApp


I am using oc4j and jdeveloper for deployment.
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To me that looks more like that the 'remote' EJB-Ref is invalid. Do you have a Remote Interface for this EJB? If not then please remove the EJB-Ref and only keep the local one.
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic