[jboss-user] [EJB/JBoss] - EJB invokation happens locally event if remote lookup is per

unnis do-not-reply at jboss.com
Fri Dec 26 00:20:52 EST 2008


I am having 2 jboss application server in which i am deploying same ear . From the fist application server I want to lookup and invoke the ejbs belongs to second application server.

For that i am writing the following code

  | Properties properties = new Properties();
  | 		properties.put(Context.INITIAL_CONTEXT_FACTORY,
  | 				"org.jnp.interfaces.NamingContextFactory");
  | 		properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
  | 		properties.put(Context.PROVIDER_URL, "second jboss IP" + ":1099");
  | 		context = new InitialContext(properties);
  | Object 	objectRef = context.lookup("MyEjb");
  | MyEjbHome    	myHome = (MyEjbHome) PortableRemoteObject.narrow(objectRef, MyEjbHome.class);
  | MyEjbRemote myRemote = myHome .create();
  | String x = myRemote .getVal();

Even if i have given IP of remote jboss server while creating initial context, it is always invoking the EJB belongs to first jboss server.My first application server is also having corresponding ejbs deployed. If i am not having those EJB in my first application server remote lookup is performed.

I am using jboss 3.2.7 and jdk 1.4

Any help is appreciated

Thanks & Regards


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

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

More information about the jboss-user mailing list