Hi
I want to do a rmi lookup from Glassfish to a Weblogic8.1 server. Including weblogic.jar and doing a t3://.. doesn't seem to work that well because the weblogic.jar file includes saxparsers and loads of other crap that doesn't work that well with Glassfish.
The solution should be iiop then i guess. I read another thread here and got this:
http://forums.java.net/jive/thread.jspa?messageID=246646𼍶
[i]Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory");
env.put("org.omg.CORBA.ORBInitialHost", "localhost");
env.put("org.omg.CORBA.ORBInitialPort", "7001");
InitialContext ctx = new InitialContext(env);
ctx.lookup("ejbname_on_wls");
....Even your ejb-jar.xml or web.xml is the same. The difference is in sun-web.xml, or sun-ejb-jar.xml, or weblogic-ejb-jar.xml, etc.
My previous post showed the injection way. But if you prefer lookup on your client side:
Context ic = new InitialContext();
Object obj = ic.lookup("java:comp/env/ejb/fooRef");
web.xml should have a
<ejb-ref>
<ejb-ref-name>ejb/fooRef</ejb-ref-name>
sun-web.xml should have a
<ejb-ref>
<ejb-ref-name>ejb/fooRef</ejb-ref-name>
<jndi-name>corbaname:iiop:1.2_at_localhost:7001#ejb/foo</jndi-name>
</ejb-ref>[/i]
I'd like to do this using code only so that i can set the url in a configuration file. Is this possible ?
[Message sent by forum member 'laban' (laban)]
http://forums.java.net/jive/thread.jspa?messageID=257471