• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB calling another EJB over a Network

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have two servers one @location X and another @location Y, the connection to the Server is over the Internet. I have an J2EE application running on Tomcat or JBoss server at both the locations. I would like to have the EJB at location X make a call at Locatoin Y.
Firstly is this Possible[yes it is]?
How can I make such a call?
Please let me know with an example .
Thanks in Advance
Vishnu
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTTP-Tunneling comes to mind - higher-end servers support that right out of the box - even then its not for the faint-hearted, configuration and security-wise.

JBoss seems to have an http-invoker that can connect to MessageDrivenBeans, so that may be worth your investigation.

Firewall Tunneling using Java
JProxy
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use xdoctlet that creates the remote and local interfaces for me. Then all i do is set the jndi context on my client i.e.

Hashtable jndiSettings = new Hashtable();
jndiSettings.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
jndiSettings.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
jndiSettings.put(Context.PROVIDER_URL, url);

and then get the home interface as I would if it were local(home):
mySession = MySessionUtil.getHome(jndiSettings).create();

In side the util class made by xdoclet I have...


public static alpha.MySessionHome getHome( java.util.Hashtable environment ) throws javax.naming.NamingException
{
// Obtain initial context
javax.naming.InitialContext initialContext = new javax.naming.InitialContext(environment);
try {
java.lang.Object objRef = initialContext.lookup(alpha.MySessionHome.JNDI_NAME);
return (alpha.MySessionHome) javax.rmi.PortableRemoteObject.narrow(objRef, alpha.MySessionHome.class);
} finally {
initialContext.close();
}
}

hope this helps
reply
    Bookmark Topic Watch Topic
  • New Topic