• Post Reply Bookmark Topic Watch Topic
  • New Topic

Moving EJB client to a remote machine  RSS feed

 
Sandareka Fernando
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an enterprise application with an EJB module and a web client which are hosted in the same machine. (I'm using glassfish V2)

Now I have a requirement of making the client a remote one.(Deploying the EJB module and web client in different machines) Can anybody show me the path to do this. What are the changes I should do to my existing application and configuration files (sun-ejb-jar.xml , sun-web.xml)?

Can I deploy the EJB module in another machine with a different application server? If so how can I communicate with it using a remote web client.

Thanks in advance.
 
Hasalaka Waravita
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Im not sure, how exactly your server and clients are deployed. However, having a web client. As long as client can locate and communicate with the service.
As a general guideline, I would say expose your EJBs as Webservices, and you can invoke them using WSIF.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sandareka Fernando:

Can I deploy the EJB module in another machine with a different application server? If so how can I communicate with it using a remote web client.



Yes, you can do that. You have to deploy the web client on a remote server (the same as you deploy currently). The EJB can be deployed on a separate system. The web client can then do a JNDI lookup by passing it the correct PROVIDER_URL through the InitialContext properties. The PROVIDER_URL needs to point to the remote server where the EJB is deployed. Here is an example for JBoss application server:

 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great info Jaikiran
 
Sandareka Fernando
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.

I have another problem. How can I send a JMS message to an MDB in the remote server? My current code is as follows (when the client and MDB is in the same server).

 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandareka,

Here are a couple of things that might help: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html and http://forums.java.net/jive/message.jspa?messageID=254961. I would advise you to pursue this in the GlassFish forums. This is very app-server specific and a relatively uncommon topic, so they would be able to help you the most in terms of solving it elegantly.

Best regards,
Reza
[ December 12, 2008: Message edited by: Reza Rahman ]
 
Sandareka Fernando
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tanks.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!