2 Replies Latest reply on Dec 7, 2005 1:00 AM by Denis Kostousov

    Configure ejb binding

    Denis Kostousov Newbie

      How is to configure link from Global JNDI Namespace to bean's local namespace?

      There are two ejb application, deployed in JBoss 4.0.3sp1
      First - ejb2, second - ejb3. I need to create reference to SomeEJB2 (from first application) in SomeStatelessEJB3 (from second application).

      I think, I should do two steps:
      1. configure injection of home interface from bean's local namespace.
      I do this via:

      public class PasswordManagerSEJB3 implements IPasswordManager
      ...
       @EJB(name="PM")
       private PasswordManagerHome rpmHome=null;
      ...
      


      2. configure link java:comp.ejb3/env/ejb/PM (bean's local ns) -> java:/PasswordManager (global ns)
      how I can do it?

      I tried do step 2 with jboss.xml
      ...
       <session>
       <ejb-name>PasswordManagerSEJB3</ejb-name>
       <ejb-ref>
       <ejb-ref-name>PM</ejb-ref-name>
       <jndi-name>java:/PasswordManager</jndi-name>
       </ejb-ref>
       </session>
      ...
      

      but, it now worked



        • 1. Re: Configure ejb binding
          Denis Kostousov Newbie

          oops, method with jboss.xml is't work

          • 2. Re: Configure ejb binding
            Denis Kostousov Newbie

            I upgrade to EJB3 rc3. Now attempt to configure mapping with jboss.xml (as described in http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch3.chapter.html#d0e9047)

             <session>
             <ejb-name>PasswordManagerSEJB3</ejb-name>
             <ejb-ref>
             <ejb-ref-name>PM</ejb-ref-name>
             <jndi-name>java:/PasswordManager</jndi-name>
             </ejb-ref>
             </session>
            

            or
             <session>
             <ejb-name>PasswordManagerSEJB3</ejb-name>
             <ejb-ref>
             <ejb-ref-name>PM</ejb-ref-name>
             <jndi-name>PasswordManager</jndi-name>
             </ejb-ref>
             </session>
            

            gives exeption
            10:57:24,890 INFO [Ejb3DescriptorHandler] found jboss.xml jar:file:/usr/local/java/jboss-4.0.3SP1/server/ejb3/tmp/deploy/tmp54693office.ear-contents/office.ejb3!/META-INF/jboss.xml
            10:57:24,906 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=office.ejb3
            org.jboss.xb.binding.JBossXBException: Failed to parse source.
             at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:138)
             at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173)
             at org.jboss.ejb3.Ejb3DescriptorHandler.parseDescriptors(Ejb3DescriptorHandler.java:571)
             at org.jboss.ejb3.Ejb3HandlerFactory$DDFactory.<init>(Ejb3HandlerFactory.java:19)
             at org.jboss.ejb3.Ejb3HandlerFactory.getInstance(Ejb3HandlerFactory.java:54)
             at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:274)
             at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:262)
            ...
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
            Caused by: java.lang.NullPointerException
             at org.jboss.ejb3.dd.EnterpriseBeans.updateEjbRef(EnterpriseBeans.java:43)
             at org.jboss.ejb3.dd.JBossDDObjectFactory.addChild(JBossDDObjectFactory.java:374)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.xb.binding.ObjectModelBuilder.invokeFactory(ObjectModelBuilder.java:421)
             at org.jboss.xb.binding.DelegatingObjectModelFactory.addChild(DelegatingObjectModelFactory.java:115)
             at org.jboss.xb.binding.ObjectModelBuilder.endElement(ObjectModelBuilder.java:377)
             at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.endElement(SaxJBossXBParser.java:212)
             at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
             at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
             at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
             at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
             at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
             at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
             at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:134)
             ... 56 more