14 Replies Latest reply on Jul 13, 2009 4:50 AM by jaikiran pai

    Deployment Descriptor Overriding Not Working?

    Javid Jamae Newbie

      I'm playing around with JBoss 5.0.0 CR2.

      I have tried binding EJB Stateless session beans using annotations and using deployment descriptors, and they both seem to work fine separately. But, when I define a bean with the @LocalBinding and @RemoteBinding annotations and then try to override the bindings in the jboss.xml file, the remote binding defined in the deployment descriptor cannot be found.

      It was my assumption that the deployment descriptor takes precedence, am I incorrect?

      Here is my jboss.xml:

      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"

      Here is the first part of my bean:
      @LocalBinding(jndiBinding = "MyLocalOverridePrinter")
      @RemoteBinding(jndiBinding = "MyOverridePrinter")
      public class OverridePrinterBean implements MessagePrinterRemote,
       MessagePrinterLocal {

      When I look in the JndiView I see that:
      - MyLocalOverridePrinter (from local annotation) is not bound at all
      - MyOverridePrinter (from remove annotation) is bound as follows:
      MyOverridePrinter (class: Proxy for: com.manning.jbia.jndibinding.MessagePrinterRemote)
      - OverriddenGlobally (from remote in descriptor) is not bound at all
      - OverriddenLocally (from local in descriptor) is bound as follows:
      OverriddenLocally (class: Proxy for: com.manning.jbia.jndibinding.MessagePrinterLocal)

      So, it looks like its picking up the Local binding from the jboss.xml and the remote binding from the annotations.

      Any ideas? Is this a bug?