Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to connect EJB 3.0 application with swing application?  RSS feed

 
Kavisha Paranamana
Greenhorn
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've developed a swing application, and it needs to connect to the EJB server which is currently servicing a web application. The EJB server is connected to the internet and has a static IP address. The swing application, on the otherhand, is distributed among the users, as is downloadable from the website. Is their a way for this swing application to directly connect to the EJB server through the IP address? For now, I use the approach of sending HTTP requesets to the webserver, so the webserver dispatches them to the EJB server. Can't we directly call a remote EJB without the need of the intermediate web server?
 
Jayr Motta
Ranch Hand
Posts: 110
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should look about this.

Edited:

Hmm, you changed the question, so do I my answer. :-)

For sure, you just have to be aware the price to pay by willing this. Every EJB exposed to your clients will have to be remote or web services, so you're gonna pay the overhead. To achieve this in the most straight forward way I do is to include a jndi.properties on your classpath, then you'll use the server specified there instead the local one.

You can also rely on the low-level JNDI lookup / Service Locator, but it's not recommended. Try to keep away as much as possible if you want to avoid complexity and very tightly coupling. Let the container, annotations and deployment descriptor elements do the heavy / monkey job for you and be happy.

You can spare the time that you'll earn doing this paying a beer for us here on the bar, :P
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!