[jboss-user] [EJB 3.0] - Deployment Descriptor Overriding Not Working?

javidjamae do-not-reply at jboss.com
Tue Oct 7 21:57:51 EDT 2008


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"
  |        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |        xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
  |                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
  |        version="3.0">
  | 
  | 	<enterprise-beans>
  | 		<session>
  | 			<ejb-name>OverridePrinterBean</ejb-name>
  | 			<jndi-name>OverriddenGlobally</jndi-name>
  | 			<local-jndi-name>OverriddenLocally</local-jndi-name>
  | 		</session>
  | 	</enterprise-beans>
  | </jboss>
  | 

Here is the first part of my bean:

  | @Stateless
  | @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?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180909#4180909

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180909



More information about the jboss-user mailing list