• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic