I am trying to access an EJB on server1 from an EJB on server2 (each server is running on its own PC). I first packaged the entire application (war and ejb-jar files) in one ear file and deployed it to server1, and verified that I could access the EJB from my web application. I then deployed the same ear to server2 and verified that once again I could access the EJB on server2 from the web app on server2. So far so good.
I then changed the JNDI lookup on server2 such that it used the URL jnp://server1:1099 for the initial context. Then, using the web app on server2, I attempted to access the EJB and I got the EJB from server2, not from server1. I did a little digging and found the culprit to be the ejb-ref nodes in web.xml and jboss-web.xml. Once I commented them out, I could then use the web app on server2 to access the EJB on server1. (My code that looks up the EJB by name first tries the name ?java:comp/env/XXX?, and if that fails, tries just ?XXX?.) After thinking about this for a minute, the above behavior (before I changed web.xml and jboss-web.xml) doesn?t make sense. After all, in my code that runs on server2 I get an initial context supposedly based on the JNDI tree for server1, yet when I ask for an object with a given name, I get an object from the JNDI tree in server2. Is this a bug? Should I open a JIRA? Or am I just clueless? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952808#3952808 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952808 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
