You hit it exactly.  I couldn't understand why I had to
specify the entity bean in the descriptor for the session;
after all, it's given a jndi name, why can't the session
bean find the bean using that?  I guess it's a way for the
container to know which beans go with which application.
I've been thinking one application-centric and not multi-
application centric with respect to the container.

Thanks Nick!

-tim

> -----Original Message-----
> From: Nick Newman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 06, 2000 1:08 PM
> To: Orion-Interest
> Subject: Re: naming context problem
> 
> 
> The non-bean should "inherit" the naming context of the EJB 
> session bean
> from which it was called.  Are you sure that you have specified the
> appropriate <ejb-ref> for the TestDocument1 entity bean in 
> the xml for that
> session bean?
> 
> Nick
> 
> At 12:50 PM 9/6/00 -0400, you wrote:
> >
> >I have a servlet that finds/creates a session bean.
> >The session bean instantiates a non-bean java object.
> >That java object tries to find an EJB, but fails with
> >the usual: javax.naming.NameNotFoundException:
> >java:comp/env/ejb/TestDocument1
> >
> >Why?  Aren't the servlet, java object, and EJB all
> >running in the same JVM and context?  I've tried the
> >three usual methods for finding the EJB:
> >
> >1)
> >
> >Context ctx = new InitialContext();
> >Object boundObject = ctx.lookup("java:comp/env/ejb/TestDocument1");
> >
> >2) this one wants the application-client.xml:
> >
> >java.util.Properties props = new java.util.Properties();
> >props.setProperty("java.naming.factory.initial","com.evermind
> .server.Applica
> >tionClientInitialContextFactory");
> >props.setProperty("java.naming.provider.url","ormi://localhos
> t/docmgr");
> >props.setProperty("java.naming.security.principal","zzz");
> >props.setProperty("java.naming.security.credentials","zzz");
> >Context ctx = new InitialContext(props);
> >Object boundObject = ctx.lookup("java:comp/env/ejb/TestDocument1");
> >
> >3) same as #2 but with RMIInitialContextFactory:
> >
> >props.setProperty("java.naming.factory.initial",
> >"com.evermind.server.rmi.RMIInitialContextFactory");
> >
> >Any hints as to what I'm doing wrong?
> >
> >-tim
> 
> 

Reply via email to