[jboss-user] [EJB3] - Remote EJB 3.1 in JBoss 6.1 - ejb-jar.xml changes remote to local

Piotr Nowicki do-not-reply at jboss.com
Fri Nov 16 11:21:24 EST 2012


Piotr Nowicki [https://community.jboss.org/people/pedrokowalski] created the discussion

"Remote EJB 3.1 in JBoss 6.1 - ejb-jar.xml changes remote to local"

To view the discussion, visit: https://community.jboss.org/message/776916#776916

--------------------------------------------------------------
Howdy Guys.

Just bumped into some really nasty problem.

I have my EJB 3.1 beans defined using annotations like:

@Remote
@Stateless
public class MyBean implements MyBeanIf
{
}


This is a part of the ejb-jar (myEJB.jar) which is then packaged into EAR (myEAR.ear) and deployed into the server.

Because I would like to be able to lookup the MyBean using something different than myEJB in JNDI coordinates, I've added the ejb-jar.xml to the META-INF of ejb-jar.

It looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<ejb-jar xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
   version="3.1">
   <module-name>my-service</module-name>
</ejb-jar>


So, no surprise here - it's rather simple.

Now if I deploy it on JBoss AS 7.1 - everything works fine, the JNDI coordinates are correct and I can access the component using configured JNDI name.
However, ifI deploy it on JBoss 6.1 it somehow magically *changes my remote interface to local*. In other words, if I don't specify the ejb-jar.xml in my ejb-jar it correctly registers the bean as:

scada.server.ea/ArchivingTemplateProvider/remote - EJB3.x Default Remote Business Interface


When I add the ejb-jar.xml (in the exact form as you can se above), I can see:

scada.server.ea/ArchivingTemplateProvider/local - EJB3.x Default Local Business Interface


And, as expected, I cannot lookup my EJB. 

Is there some problem with mixing annotations and declarative EJB configuration? Why did my bean became local just by adding ejb-jar.xml with element not related with the configuration of enterprise beans?

I have a workaround to change the names of artifacts (ejb-jar's) directly in EAR using Maven plugin, but... uh... would rather know what am I doing wrong.

What kind of sorcery is this?

Regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/776916#776916]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121116/e5887370/attachment-0001.html 


More information about the jboss-user mailing list