What modifications should be made to the JAR file to make the configuration of JBoss.xml effective?

43 Views Asked by At

There is currently an EJB2 JAR package with ejb-jar.xml, jboss.xml, and weblogic-ejb-jar.xml files under its META-INF directory. When this package is deployed to Wildfly 26, only the element in ejb-jar.xml is effective, while the element in jboss.xml is not. Attempts to modify ejb-jar.xml or add jboss-ejb3.xml and include in either of these files result in an error message that reads 'Unexpected element '{http://java.sun.com/xml/ns/javaee}jndi-name' encountered'.

ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar >

   <description><![CDATA[No Description.]]></description>
   <display-name>Generated by XDoclet</display-name>
   
   <enterprise-beans>
      <!-- Session Beans -->
      <session >
         <description><![CDATA[Description for TestRunAs]]></description>
         <display-name>Name for TestRunAs</display-name>

         <ejb-name>TestRunAs</ejb-name>

         <home>keyservice.appserver.ejb.session.ITestRunAsHome</home>
         <remote>keyservice.appserver.ejb.session.ITestRunAs</remote>
         <local-home>keyservice.appserver.ejb.session.ITestRunAsLocalHome</local-home>
         <local>keyservice.appserver.ejb.session.ITestRunAsLocal</local>
         <ejb-class>keyservice.appserver.ejb.session.TestRunAsEJB</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

         <env-entry>
            <env-entry-name>COMMON_PROPERTIES_FILENAME</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value><![CDATA[/config/common_app.properties]]></env-entry-value>
         </env-entry>

         <ejb-local-ref >
            <ejb-ref-name>ejb/PasswordOperationsLocal</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <local-home>hk.gov.ogcio.egis.rm.keyservice.appserver.ejb.session.IPasswordOperationsLocalHome</local-home>
            <local>hk.gov.ogcio.egis.rm.keyservice.appserver.ejb.session.IPasswordOperationsLocal</local>
            <ejb-link>PasswordOperations</ejb-link>
         </ejb-local-ref>

         <security-identity>
            <description><![CDATA[This bean is to run as internal role in order to access the passwords and keys]]></description>
            <run-as>
               <description><![CDATA[This bean is to run as internal role in order to access the passwords and keys]]></description>
               <role-name>keyservice_readonly</role-name>
            </run-as>
         </security-identity>

         <resource-ref >
            <res-ref-name>jdbc/RmDSRef</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>

      </session>
    </enterprise-beans>
</ejb-jar>

jboss.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

<jboss>

   <security-domain></security-domain>

   <enterprise-beans>
      <session>
         <ejb-name>TestRunAs</ejb-name>
         <jndi-name>keyservice/ejb/TestRunAsHome</jndi-name>
         <local-jndi-name>keyservice/ejb/TestRunAsLocalHome</local-jndi-name>

         <resource-ref>
            <res-ref-name>jdbc/RmDSRef</res-ref-name>
            <jndi-name>java:/MySqlDS</jndi-name>
         </resource-ref>

        <method-attributes>
        </method-attributes>
      </session>
    </enterprise-beans>
</jboss>

What modifications should I make to make the configuration of jboss.xml effective in Wildfly 26? I would appreciate your help in answering my question. Thank you very much.

0

There are 0 best solutions below