• 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

What classes should I provide for my EJB client?

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a little long, but ultimately, it's surely an easy question for experienced EJB users.

Quick background... I have a lot of experience with Java, including Servlets/JSPs, but am just beginning with EJBs. For the past few months, I've been working on a J2EE app, implemented on Orion web server. This included Stateless Session EJBs. I've followed Orion's tutorials, and have successfully deployed and used my EJBs. The thing is, the "client" and the "server" are both essentially the same application... and they both have access to the same JARs and classfiles.

Now, it's time to actually start using the EJBs the way they're supposed to be used; i.e. remotely. So I'm starting small, with a command-line client that tries to access one EJB. I know that this client needs stubs for the home and remote interface. But... how do I generate these stubs? What exactly do I need to include in the client's classpath to get it to be able to use the remote EJB?

For example, the EJB I am trying to access is BuddyList. I have, of course, BuddyList.class, BuddyListHome.class, and BuddyListBean.class available. My first thought was just to copy BuddyList.class and BuddyListHome.class over for my new client to use. I then tried to invoke the BuddyList bean in the same manner as I have (successfully) invoked the bean from withint the webapp. And I get an error message which seems to stem from the fact that BuddyList and BuddyListHome have dependencies on the javax.ejb package:


Clearly, my little client wouldn't be required to run within an EJB container (I at least know that much!) So... is there a special was to generate stubs/interfaces for my client to use?

Thanks in advance!
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or, do I need to include something like ejb.jar (which includes the javax.ejb package classes) in my client's classpath?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

indeed you need to include javax.ejb package in your client classpath.

regards

natesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic