1 Reply Latest reply: Jan 20, 2012 7:50 AM by Mark Ashworth RSS

Why JBoss enforces java:/ java:boss/ naming and how to override it in the jboss-ejb3.xml?

Mark Ashworth Newbie

Good Day,

 

I am busy writing an application that uses JPA and JMS and noticed during the setup process of JBoss 7.1 CR1b (but it possibly relates to JBoss 7.x) that JBoss enforces the java:/ and java:jboss/ names for resources. I updated the application references and it worked but the problem is that I would like the application to be deployable to Glassfish, JBoss and Weblogic.

 

Can someone point me to an example or the jboss-ejb3.xml schema so that I can use it override the annotations on the class files. And just maybe as an additional note, does JBoss support a deployment.xml file similar to Weblogic that provides the deployment specific overrides?

 

Your assistance is greatly appreciated.

 

Regards,

Mark P Ashworth

http://mpashworth.wordpress.com

  • 1. Re: Why JBoss enforces java:/ java:boss/ naming and how to override it in the jboss-ejb3.xml?
    Mark Ashworth Newbie

    I worked around this by using JNDI environment property, e.g.

     

    @Resource(mappedName="java:comp/env/yellowfire/queue/notification")

    private Queue notifyEventQueue;

     

     

    And then in the web.xml, mapping this using the resource-ref node.

     

    <resource-ref>

      <res-ref-name>yellowfire/queue/notification</res-ref-name>

      <mapped-name>java:/yellowfire/queue/notification</mapped-name>

    </resource-ref>

     

    This also works for the MDB activation configuration.

     

    @MessageDriven(

            name = "NotificationProcessor",

            messageListenerInterface = MessageListener.class,

            mappedName = "java:comp/env/yellowfire/queue/notification",

            activationConfig = {

                @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),

                @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

                @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:comp/env/yellowfire/queue/notification"),

                @ActivationConfigProperty(propertyName = "clientID", propertyValue = "notification")

            }

    )

     

     

    Now all the JNDI configuration has moved from the code to the web.xml file which is more manageable but I would really like to use the jboss-ejb3.xml, glassfish-ejb-jar.xml, etc to contain the actual implementation JNDI names and the web.xml to contain a link to those files.

     

    Where can I find the XSD of the jboss-ejb3.xml so that I can resolve this?

     

    Regards,

    Mark P Ashworth

    http://mpashworth.wordpress.com