• 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

How to connect EJB 3.0 application with swing application?

 
Greenhorn
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic