• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • 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:

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic