0 Replies Latest reply on Nov 21, 2016 12:57 AM by armahdi

    Internalizing ejb lookups

    armahdi

      I am deploying EJB2 on wildfly 10. I have made the application to work on WF10 which was previously working on jboss 5.0.1

       

      In order to make it work I added a jboss-ejb3.xml and a reference to that in standalone.xml

      What I am trying to do, and I am not sure if it is possible or not, is to place the lookups inside the application bundle and not in widlfly's standalone.xml

       

      in ejb-jar.xml:

           <session >

               <description><![CDATA[Country Service Bean]]></description>

               <display-name>Country Service Bean</display-name>

               <ejb-name>CountryService</ejb-name>

               <home>com.mycomp.cms.service.impl.ejb.CountryServiceHome</home>

               <remote>com.mycomp.cms.service.impl.ejb.CountryService</remote>

               <local-home>com.mycomp.cms.service.impl.ejb.CountryServiceLocalHome</local-home>

               <local>com.mycomp.cms.service.impl.ejb.CountryServiceLocal</local>

               <ejb-class>com.mycomp.cms.service.impl.ejb.CountryBean</ejb-class>

               <session-type>Stateless</session-type>

               <transaction-type>Bean</transaction-type>

               <security-role-ref>

                  <role-name>CMSAccess</role-name>

                  <role-link>CMSAccess</role-link>

               </security-role-ref>

            </session>

        

      In jboss-ejb3.xml 

         <session>

                  <ejb-name>CountryService</ejb-name>

                  <resource-ref>

                      <res-ref-name>CountryService</res-ref-name>

                      <lookup-name>java:/cms/CountryServiceLocal</lookup-name>

                  </resource-ref>

                  <!--jndi-name>java:/cms/CountryService</jndi-name>

                  <local-jndi-name>java:/cms/CountryServiceLocal</local-jndi-name-->

              </session>

       

        in standalone.xml

       

          <subsystem xmlns="urn:jboss:domain:naming:2.0">

        .

        .

        <lookup name="java:/cms/CountryService" lookup="java:global/ACMServices/CMSServices/CountryService!com.mycomp.cms.service.impl.ejb.CountryServiceHome"/>

        <lookup name="java:/cms/CountryServiceLocal" lookup="java:app/CMSServices/CountryService!com.mycomp.cms.service.impl.ejb.CountryServiceLocalHome"/>

        .

        .

        .

       

       

       

       

      Now the listings in the standalone.xml for the lookups is very static. they can be actually be part of the ejb jar file in a descriptor. I tried to look it up where i can put it and how. I think it should be part of jboss-ejb3.xml but i cant see what the syntax should be like.