I HAVE THE SAME PROBLEM!!! I was about to write an email to the
list..hopefully someone else can answer this. Its pissing me off.

My problem is that EJB A uses EJB B, but my servlet, when it tries to get
EJB A, throws the naming exception. The code in EJB A hasn't even ran
yet..and the stack trace says it can't find EJB B! That is strange to me on
why if the code in EJB A that uses B isn't even running yet..just when the
object is trying to be found, that it says it can't find EJB B. Must be some
mechanism of EJB containers that makes sure they all exist.

My EJB A does a JNDI call to java:comp/env/ejb/Test and that should work
according to the ejb book I have. That is how a session bean uses an entity
bean supposedly. From what I read, a session bean (or I suppose any ejb)
must use a JNDI lookup for every bean it wants to use. God forbid if I had a
bean that needed to use 50 other beans! Isn't there a way to simplify this
process?

Also, it appears EJB 1.1 entity CMP stuff is very limited..VERY limited. I
can't have any type of joins. How then is a join done? Does EJB A (session)
that uses two entities, with entity A having a join to entity B..does this
have to be done in code? You have to get all the entities of both A and B,
then in code do a loop through all As and on each iteration do a loop
through all B's and if the fields of both that are in the "query" match,
store that in a vector, then return that result? That seems like a whole lot
of code just to do a simple one to many join of two tables. It's enough to
make me use standard JDBC sql, instead of entity CMP.

> -----Original Message-----
> From: J Davis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 25, 2000 10:21 AM
> To: Orion-Interest
> Subject: Can't call an EJB from Within another EJB
> 
> 
> We have gotten our Orion server(1.3.8) to work with EJBs on a singular
> level(i.e. we can call EJB A, B or C and it works fine.)  But 
> If one of our
> EJB's tries to call another(i.e. A calls B)  A throws a 
> naming exception
> that it can't find the EJB reference when doing a jndi 
> lookup.  Is there a
> dependency tag or something within one of the XML files that 
> denotes EJB
> dependencies on one another?  I'm sure this is something 
> simple, but it is
> getting annoying.
> 
> 
> 

Reply via email to