File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes ejb2 beans from jboss4 to jboss5 need different naming lookup patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "ejb2 beans from jboss4 to jboss5 need different naming lookup patterns" Watch "ejb2 beans from jboss4 to jboss5 need different naming lookup patterns" New topic
Author

ejb2 beans from jboss4 to jboss5 need different naming lookup patterns

bill selig
Greenhorn

Joined: Jan 20, 2010
Posts: 3
We have an installation that uses ejb2 beans and runs under jboss 4.2.3. We are trying to move that installation to jboss 5.1.0.GA (jdk6 fwiw).

A typical ejb-jar.xml entry is

and in jboss.xml we have a corresponding entry


In JB4 we can do a servicelocator lookup of this in JBDI using the simple name "ActiveRecordingAccess";

Since we've moved to JB5, we've found that the lookup now has to be "xxx/ActiveRecordingAccess/home"
(the bean is contained in deploy/xxx.ear)
and we find it in the JNDI global space (using jmx-console) as "xxx/ActiveRecordingAccess/home"


For backwards compatibility in our code we'd like to still be able to look them up using the simpler name (i.e. "ActiveRecordingAccess").

Is this at all possible or are we going to have to change all our references to the "xxx/ActiveRecordingAccess/home" form.

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
168

If it's EJB2.x beans then use the EJB2.x xsd instead of the EJB3.0 xsd in the ejb-jar.xml. Even the jboss.xml should be the same as what you had in JBoss AS4.

I'll move this to our JBoss forum.

[My Blog] [JavaRanch Journal]
bill selig
Greenhorn

Joined: Jan 20, 2010
Posts: 3
Jaikiran,

Tried your suggest and things didn't go well. Here's more info.

What we are currently using tha tworks is the ejb-jar 3.0 via attributes and jboss 5_0 DTD via DOCTYPE (as listed in original post).
What I get with that is the bean installing, deploying and binding as shown via the following snippets form the server.log:




When I tried your suggestion I only got the installing part


but with no binding information (or deploying for that matter)

For the ejb-jar I used, per your suggestion:


For the jboss.xml I tried various specs, each of which gave the same result of install but no deploy or bind:

(our orignal that worked in JB4.2.3.GA)


The JB4.2 DTD

and the JB5 DTD



So, at this point the only conbination that actually deploys and binds the beans is the one from my original post.
The one with the ejb-jar 2.1 xsd doesn't seem to get past installing. We don't see binding information with any of them.


Shri Mabr
Greenhorn

Joined: Jan 26, 2012
Posts: 1
What was your final work around or tweak to get it working? Did you have to change the JNDI naming in your code or found a way to keep the jndi name the old way?
bill selig
Greenhorn

Joined: Jan 20, 2010
Posts: 3
I don't recall anymore what we finally did as a resolution. I think we crafted the name the way it needed to be (been a while since I was in that code base). However, that was short lived. We ultimately rolled back to JB4 since JB5 was significantly slower (at least at that time).
Sorry I couldn't be more help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb2 beans from jboss4 to jboss5 need different naming lookup patterns