• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Basic

 
Suhas Mohamedali
Greenhorn
Posts: 29
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.....
 
Myyron Murray Latorilla
Ranch Hand
Posts: 65
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
Aparna Rajan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi found the solution....


included jbossall-client.jar in class path....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic