hi

i dont really know what the error means tho..but for external EJB stuff,
here's how i did it.

I have 3 beans with one as a facade to two others.
RegistrationAdminViewEJB(stateful session)
                (calls)
                           |--------------------> SequenceGeneratorEJB (stateless
session)
                           |--------------------> RegistrantEJB (entity)


the packaging and .xml should look like these

for SequenceGeneratorEJB jar
    SequenceGeneratorHome
    SequenceGeneratorRemoteInterface
    SequenceGeneratorBean

for the .xml, nothing special in ejb-jar.xml but in jboss.xml, i make sure that i
have the jndi-name
so that i can reference it later in RegistrationAdmin's jboss.xml
 <enterprise-beans>
     <session>
      <ejb-name>SequenceEJB</ejb-name>
        <jndi-name>sequence/registrant/RegistrantSequence</jndi-name>
         <configuration-name></configuration-name>
         <resource-ref> </resource-ref>
       </session>
     </enterprise-beans>

for RegistrantEJB jar
    RegistrantHome
    RegistrantRemoteInterface
    RegistrantBean

for the .xml, again nothing special in ejb-jar.xml but in jboss.xml
      <enterprise-beans>
       <entity>
        <ejb-name>RegistrantEJB</ejb-name>
        <jndi-name>registration/component/Registrant</jndi-name>
       <configuration-name></configuration-name>
       <resource-ref> </resource-ref>
        </entity>
     </enterprise-beans>



for RegistrationAdminViewEJB jar:
    RegistrantAdminViewHome
    RegisrantAdminViewRemoteInterface
    RegistrantAdminViewBean
    SequenceGeneratorHome
    SequenceGeneratorRemoteInterface
    RegistrantHome
    RegistrantRemoteInterface


here's where you refer those two

ejb-jar.xml

      <session>
        <description>Registration Admin</description>
        <display-name>Registration Admin View</display-name>
        <ejb-name>RegistrationAdminViewEJB</ejb-name>
        <home>streamworx.registration.ejb.RegistrationAdminViewHome</home>
        <remote>streamworx.registration.ejb.RegistrationAdminView</remote>

<ejb-class>streamworx.registration.ejb.RegistrationAdminViewBean</ejb-class>
             <session-type>Stateful</session-type>
        <transaction-type>Bean</transaction-type>

   <!-- external EJB link to SequenceGenerator-->
     <ejb-ref>

<ejb-ref-name>ejb/sequence/registration/RegistrantSequence</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <home>streamworx.sequence.ejb.SequenceGeneratorHome</home>
                <remote>streamworx.sequence.ejb.SequenceGenerator</remote>
   </ejb-ref>

   <!-- external EJB link to Registrant-->
     <ejb-ref>
              <ejb-ref-name>ejb/registration/component/Registrant</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
                <home>streamworx.registrant.ejb.RegistrantHome</home>
                <remote>streamworx.registrant.ejb.Registrant</remote>
   </ejb-ref>
  </session>


and in jboss.xml

   <enterprise-beans>

  <!-- resource for RegistrationAdminView -->
       <session>
    <ejb-name>RegistrationAdminViewEJB</ejb-name>
    <jndi-name>registration/component/RegistrationAdminView</jndi-name>
    <configuration-name></configuration-name>

   <!-- real link to SequenceGenerator -->
   <ejb-ref>

<ejb-ref-name>ejb/sequence/registration/RegistrantSequence</ejb-ref-name>
                <jndi-name>/sequence/registration/RegistrantSequence</jndi-name>
             </ejb-ref>

   <!-- real link to Registrant -->
   <ejb-ref>
                <ejb-ref-name>ejb/registration/component/Registrant</ejb-ref-name>

                <jndi-name>/registration/component/Registrant</jndi-name>
             </ejb-ref>

        </session>

     </enterprise-beans


AND...(pheww i hope someone put this to use..) for the code in
RegistrationAdminView


   /**
   * cache references to resources in this bean.
   */
   private void cacheReferences() {
      try {
            Object objref;
            InitialContext initial = new InitialContext();
                if(sequenceGenHomeRef == null) {
                    objref =
initial.lookup("java:comp/env/ejb/sequence/registration/RegistrantSequence");
                    sequenceGenHomeRef = (SequenceGeneratorHome)
                    PortableRemoteObject.narrow(objref,
SequenceGeneratorHome.class);
                }
                if(regHomeRef == null) {
                    objref =
initial.lookup("java:comp/env/ejb/registration/component/Registrant");
                    regHomeRef = (RegistrantHome)
                    PortableRemoteObject.narrow(objref, RegistrantHome.class);
                }
        } catch (javax.naming.NamingException ne) {
            throw new EJBException ("Naming error" + ne);
        }
        return;
   }



and i'd like to mention that i didnt put anything in lib/ext  except
some helper classes which are outside of this discussion context...

any error please do tell me...thankss

HTH
.u






[EMAIL PROTECTED] wrote:

> Dear all,
>
> I found the email below in the archives about some of the challenges of using
> multiple jar files and I am having problems in this area.
>
> I am trying to do this
>
> EJB JAR 'A'                     EJB JAR 'B'
> bean 'a'      -- calls ->        bean 'b'
>
> I arrange for the EJB JAR B to be deployed first but when I try to deploy EJB
> JAR A I get an error saying bean 'b' is not found within this application.
>
>  I don't want to combine my beans into on jar file (and I would argue I
> shouldn't need to).    I have tried putting the Home,Remote and implementation
> classes of the bean 'b' into a seperate jar file in the CLASSPATH as well as
> in the ext directory.
>
> Any assistance would be greatly appreciated.
>
> TIA
> Tom Daly
>
> >From the Archives ...
>
>     Hi guys!
>
>     There were some threads about how you do things with multiple jars. So
>     here are my $.02 :
>     a) Be aware that beans in one jar can't access/see classes in other
>     jars. It is intended to be that way.
>     b) To solve a) some people suggest adding the jars to /lib/ext/ or
>     extending the classpath to include the jars in the deployment directory.
>     Be aware that there could be a big problem with that. Since the jar is
>     in the classpath now and the container starts looking for ejb-jar.xml it
>     may get it from the jar in the classpath and not from the jar it
>     actually wants to deploy !
>     c) There are two solutions I am aware of: 1) include everything in one
>     jar and merge the descriptors or 2) only include the remote and home
>     interfaces into one jar you can include into the class-path (NO
>     ejb-jar.xml). Be careful with updates of your interfaces then.
>
>     Any other solutions ?
>
>     Ciao,
>     Tobias
>
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to