2 Replies Latest reply on Dec 18, 2014 8:16 AM by Arun Gupta

    Migrating from GlassFish 4 to WildFly 8

    Willem Kunkels Newbie

      Dear forum,

       

      I have an EJB jar which contains a @Singleton bean (used to resolve connections) which look as follows:

       

      @Singleton

      @LocalBean

      @ConcurrencyManagement(ConcurrencyManagementType.BEAN)

      public class ConnectionResolver {

       

       

          // This is the internal resource name, please map to the correct resource

          // depending on the server this is deployed to.

          @Resource(name = "jdbc/AS400")

          private DataSource datasource;

       

      The problem is with the @Resource. I want to map the logical name jdbc/AS400 to a JNDI name (which I specified on the WildFly server as java:/jdbc/AS400Pool). For GlassFish this works when I specify in glassfish-ejb-jar.xml:

       

      <glassfish-ejb-jar>

          <enterprise-beans>

              <ejb>

                  <!--

                      Mapping from the application's internal resource name (res-ref-name)

                      to the actual resource on the GlassFish server (jndi-name).

                      Connections are handled by the ConnectionResolver

                  -->   

                  <ejb-name>ConnectionResolver</ejb-name>

                  <resource-ref>

                      <res-ref-name>jdbc/AS400</res-ref-name>

                      <jndi-name>jdbc/as400_dev_kpm</jndi-name>

                  </resource-ref>

              </ejb>

          </enterprise-beans>

      </glassfish-ejb-jar>

       

      I have tried several ways to achieve the same for WildFly, but can't get it working, the default data source keeps getting picked up (as per the spec). The EJB jar is deployed just fine.

       

      Does anyone have an idea on how achieve the above for WildFly deployment?

       

      Thanks,

      Willem Kunkels