Well...

Robert Krueger wrote:
> 
> same here. check all ejb-refs and the corresponding mappings, it's usually
> something like that.

... I checked, and I'm still confused (and new to orion, so please bear
with me).  Perhaps I'm expecting too much from orion's auto-deployment
feature, but I want to understand its logic.

When I autodeploy my app containing two beans, each in a separate jar
file, I naturally get two orion-ejb-jar elements (non-pertinent stuff
omitted):

<orion-ejb-jar>
  <enterprise-beans>
    <session-deployment name="S" location="S">
      <ejb-ref-mapping name="ejb/e" />
    </session-deployment>
  </enterprise-beans>
</orion-ejb-jar>

<orion-ejb-jar>
  <enterprise-beans>
    <entity-deployment name="E" location="E">
    </entity-deployment>
  </enterprise-beans>
</orion-ejb-jar>

This works fine.  My session bean finds my entity bean by the name,
"java:comp/env/ejb/e", just like I would expect.  But when I put both
beans in the same jar, carefully combining the separate ejb-jar.xml
files into one, making sure the data elements (specifically
<ejb-ref-name>) are the same, I get this orion-ejb-jar file after
auto-deployment:

<orion-ejb-jar>
  <enterprise-beans>
    <session-deployment name="S" location="S">
      <ejb-ref-mapping name="ejb/e" />
    </session-deployment>
    <entity-deployment name="E" location="E">
    </entity-deployment>
  </enterprise-beans>
</orion-ejb-jar>

This is precisely what I would expect -- a logical combination of the
two previous elements.  Unfortunately, this deployment yields the
following error when the session bean attempts to lookup
"java:comp/env/ejb/e":

  javax.naming.NameNotFoundException: e not found

If I simply change the location attribute of the entity-deployment
element from "E" to "e", the lookup works.  Why?

> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Crossley
> > > Sent: Friday, November 10, 2000 10:19 AM
> > > To: Orion-Interest
> > > Subject: Multiple beans in one jar
> > >
> > >
> > > I seem to get different behavior when I package beans in my ear file
> > > differently.
> > >
> > > Within one application (ear), I have one servlet, one session bean, and
> > > one entity bean.  Very simply, the first tells the second to create the
> > > third.
> > >
> > > When I package the servlet up into its war file and each bean into its
> > > own jar file, and then all three into the ear file, everything works
> > > fine when auto-deployed on orion.
> > >
> > > However, if I package the two beans up into the same jar file, I get a
> > > NameNotFoundException and the transaction is rolled back.  The
> > > ejb-jar.xml file looks as I would expect -- like a combination of the
> > > separate ejb-jar.xml files in the working ear.
> > >
> > > Before I dig too much further, I was wondering if this was a known bug.
> > > Should I just get in the habit of putting each bean in its own jar file?
> > >

Reply via email to