aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Basic" Watch "EJB Basic" New topic
Author

EJB Basic

Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
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

Joined: Dec 10, 2009
Posts: 65

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.


OCPJP6
Aparna Rajan
Greenhorn

Joined: Sep 18, 2008
Posts: 5
I think you can refer 'EJB3 in Action' from Manning. It is a good one and covers the basics.


Aparna<br />SCJP 1.4 91%<br />SCWCD 1.4 92%<br/>SCBCD 5 86%
Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
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

Joined: Jun 05, 2012
Posts: 29
Hi found the solution....


included jbossall-client.jar in class path....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Basic