No luck -- I still get the following exception:

javax.naming.NamingException: Error instantiating web-app JNDI-context: No
location specified and no suitable instance of the type 'com.company.Caller'
found for the ejb-ref ejb/Caller
 at com.evermind.server.http.HttpApplication.getEnvironmentContext(JAX)
 at com.evermind.server.g4.fy(JAX)
 at com.evermind.server.g4.lookup(JAX)
 at javax.naming.InitialContext.lookup(InitialContext.java:350)
 at /testdb.jsp._jspService(/testdb.jsp.java:60) (JSP page line 30)
 at com.evermind.server.http.EvermindHttpJspPage.service(JAX)
 at com.evermind.server.http.HttpApplication.wa(JAX)
 at com.evermind.server.http.JSPServlet.service(JAX)
 at com.evermind.server.http.du.rr(JAX)
 at com.evermind.server.http.du.forward(JAX)
 at com.evermind.server.http.d5.rx(JAX)
 at com.evermind.server.http.d5.rw(JAX)
 at com.evermind.util.f.run(JAX)

I also changed the structure so that application.xml points to the web root:

***application.xml***
 <module>
  <web>
   <web-uri>web</web-uri>
  </web>
 </module>

(Note that this is the same directory pointed to by the <web-module
path="..."> element in Orion configuration file application.xml for the
default application-- it's unclear to me how these two paths, which seem
redundant, interrelate.)

Garret

----- Original Message -----
From: "Juan Lorandi (Chile)" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Wednesday, November 22, 2000 12:42 PM
Subject: RE: error instantiating web-app JNDI-context, JSP -> EJB


> In ejb-jar.xml....
>
>
> <display-name>Caller</display-name>
> <ejb-name>Caller</ejb-name>
>
> also, make sure you include the web module in application.xml
> -----Original Message-----
> From: Garret Wilson [mailto:[EMAIL PROTECTED]]
> Sent: Mi�rcoles, 22 de Noviembre de 2000 15:44
> To: Orion-Interest
> Subject: error instantiating web-app JNDI-context, JSP -> EJB
>
>
> I've been stuck for days trying to call a sample entity EJB from JSP. (I
> believe this question has been asked before on the list, but I can't find
> any responses.) Specifically, when calling context.lookup() from
testdb.jsp,
> I get the following error:
>
> javax.naming.NamingException: Error instantiating web-app JNDI-context: No
> location specified and no suitable instance of the type
'com.company.Caller'
> found for the ejb-ref ejb/CallerBean
>  at com.evermind.server.http.HttpApplication.getEnvironmentContext(JAX)
> [etc.]
>
> I know that my ejb-jar.xml file is being located correctly, because Orion
> automatically creates the CMP table (note that I am using a directory
> structure instead of an actual .jar file):
>
> ***ejb-jar.xml***
>   <entity>
>    <description>Represents a caller in the Voyager system.</description>
>    <ejb-name>com.company.Caller</ejb-name>
>    <home>com.company.CallerHome</home>
>    <remote>com.company.Caller</remote>
>    <ejb-class>com.company.CallerBean</ejb-class>
>    <persistence-type>Container</persistence-type>
>    <prim-key-class>com.company.CallerPK</prim-key-class>
> [etc.]
>
> I also know that my application.xml file works, for the same reason --
> otherwise, the ejb-jar.xml file could not be found and the table created
> automatically:
>
> ***application.xml***
>  <module>
>   <ejb>ejb</ejb>
> [etc.]
>
> Lastly, I know my web.xml file works, at least in part, because the
servlets
> defined in it work correctly. My EJB references in web.xml are as follows:
>
> ***web.xml***
>  <ejb-ref>
>   <ejb-ref-name>ejb/CallerBean</ejb-ref-name>
>   <ejb-ref-type>Entity</ejb-ref-type>
>   <home>com.company.CallerHome</home>
>   <remote>com.company.Caller</remote>
>
> Why then can't my JSP page access the Caller EJB? Here's the JSP file:
>
> ***testdb.jsp***
> <%@page language="java"%>
> <%@page import="java.util.Properties"%>
> <%@page import="javax.ejb.*"%>
> <%@page import="javax.naming.*"%>
> <%@page import="javax.rmi.*"%>
> <%@page import="com.company.*"%>
> [cut]
> Context context = new InitialContext();
> Object boundObject = context.lookup("java:comp/env/ejb/CallerBean");
> [etc.]
>
> The last line gives the error at the start of this message. I've even
tried
> this:
>
> final Properties properties=new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "com.evermind.server.ApplicationInitialContextFactory");
> properties.setProperty(Context.PROVIDER_URL,
> "ormi://localhost/voyagerApplication");
> Context context = new InitialContext();
>
> That gives the same results. Has anyone called EJB from JSP? (Yes, I have
> read all the Orion tutorials. Yes, I've read the J2EE specification, the
> Servlet specification, Java Blueprints, O'Reilly's _Enterprise JavaBeans_,
> the Wrox _Java Server Programming J2EE Edition_, and Wiley's _Mastering
> Enterprise JavaBeans_.)
>
> Thanks for any help,
>
> Garret
> [EMAIL PROTECTED]
>
>
>


Reply via email to