• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Accessing EJB from a Swing Client

 
Ranch Hand
Posts: 62
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ! I have trouble figuring out how to access an EJB from a remote Swing/SE Client running on a different machine. I tried the example in the official tutorial, but its somewhat unclear.

I assume, that i need the Business Interface of the EJB on the client side as well ?

A little example would be awesome

Thank you
 
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you need the remote business interface on the client side.

put "gf-client.jar" in your classpath, then access the bean using JNDI lookup.
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Client App

Remote interface


then access the bean using JNDI lookup

Remote interface and bean implementation class should be in "ejb-app" application.

remember put gf-client.jar in your client-app classpath (im using glassfish server for my ejb-app)
 
Torsten Oppermann
Ranch Hand
Posts: 62
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, that was exactly what i was looking for.

So this can be very server specific ? or is it always some kind of Jar, like for JBoss ?

I also use Glassfish, but im curious
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
other containers have corresponding client.jar, like for jboss you use the jbossall-client.jar in client applications for JNDI lookups
 
Torsten Oppermann
Ranch Hand
Posts: 62
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok great, thank you very much !
 
Torsten Oppermann
Ranch Hand
Posts: 62
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried your example, slightly modified today and ran into some problems. Here is what i did:

on the glassfish server is deployed:


and



on the client side with gf-client.jar and javaee-api-6.0.jar as additional libraries:



and finally the client:



any ideas ? here the errors i get:

 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic