• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

EJB Basic

 
Greenhorn
Posts: 29
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have got a Main.Java file which is out side application server (JBOSS)

I have one remote interface and one implementation and entity as server side components.

I tried one example ( in O'reilly's enterprise java beans work book) where the client is also included in the server side jar.

and instantiating the jar using ant command run.client.

My question is can I invoke the EJB method if run the java class from out side the container.

Please help me with some good examples..... PLEASE.....
 
Ranch Hand
Posts: 65
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can by doing remote lookup on your EJB.

First you need to build the context, you will need specific JBoss libraries to be included in your application, this one you need to refer to their documentation:


Then lookup the remote object:

For EJB2.x


For EJB3.x


Hope this helps.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can refer 'EJB3 in Action' from Manning. It is a good one and covers the basics.
 
Suhas Mohamedali
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi myyron and aparna ....

thanks for the reply..... when I tried to start the client class as java application from eclipse...
It gives me javax.naming.NoInitialContextException exception...

I places jndi.properties in root folder and server is running.......


Please suggest.....
 
Suhas Mohamedali
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi found the solution....


included jbossall-client.jar in class path....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic