Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes J2ee Application client module Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "J2ee Application client module" Watch "J2ee Application client module" New topic
Author

J2ee Application client module

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

Could somebody please tell me the difference between Stand alone java application and J2EE application client ?

I have read that we need Application client container to run the J2EE application client so that we can have services such as JNDI, security etc.

How it would be different to access the EJB components from stand alone client to the client runnng under the Application client container.

If i have JNDI api and stub classes for my EJB in my stand alone code to use the EJB components, then why should i use client application running under container.

FYI

i was going through this page

webpage and at step 7 it says
To deploy the application client, assemble the application client to create a standard J2EE .ear file and then deploy the application client to Sun ONE Application Server


If application client is for client then why do we need to create ear file and deploy it in the application server?


Please help me to understand this concept.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
could somebody please help me on this?
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
anybody?
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

If application client is for client then why do we need to create ear file and deploy it in the application server?

You do not. It is perfectly legal and common occurence to have a stand alone client to a j2ee component (ejb, connectors, jms queues etc)

A client application that runs within the application container is usually a web component (servlet/jsp/tags etc) and since they run within the container have all necessary j2ee jars in the classpath.

A standalone client would need all the artifacts (like ejb stubs etc), j2ee jars and application server specific jars imported and available in it's classpath to succesfully invoke a j2ee component.

ram.
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Thanks for your replay but i still have doubt about this question.

How it would be different to access the EJB components from stand alone client to the client runnng under the Application client container?


Lets say i have Swing application which needs to access EJB deployed in a remote server, so i will make this swing application as Application client(under the container) with DD and deploy it in the server where my ejb is deployed and generate the client jar file and distribute it to the client and make the client to invoke this client jar file using the tool provided by my container?.

please correct me if i am wrong.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Siva Masilamani wrote: How it would be different to access the EJB components from stand alone client to the client runnng under the Application client container?
The main difference I see is that you can use some container services in your client if it's running in the Application client container. For example: With an Application client container you can use dependency injection to access an ejb while a standalone client has to do a JNDI lookup.

Siva Masilamani wrote:Lets say i have Swing application which needs to access EJB deployed in a remote server, so i will make this swing application as Application client(under the container) with DD and deploy it in the server where my ejb is deployed and generate the client jar file and distribute it to the client and make the client to invoke this client jar file using the tool provided by my container?
All you need is the client jar (irrespective it's packaged with an app server IDE or, say, "by hand"). Then you can run the client with the Application client container.


SCJP 5 (98%) - SCBCD 5 (98%)
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

Thanks for your reply...

i know that making jar either using command prompt or using IDE doesn't matter...

my question is....what files need to be given to the client?

E.g. if Swing application is made as application client to EJB instead of Stand alone and deploy it in the application server...

which files do i need to give to the client?

Swing app + Application server generated file? or only the application server generated file?

Also do i need to install application client container in each client site and if so how should i do it with respect to particular vendor say Websphere?
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Siva Masilamani wrote:what files need to be given to the client?

If the app client container is installed on the client machine the app-client-jar is sufficient.But according to your questions it seems you have to distribute your application to a couple of clients. In this situation each vendor has its own strategies. Glassfish, for example, offers

- Java Web Start to download the client application from the app server to the client
- bundling the app client container and the client application into a jar that then has to be distributed to the clients.

I don't know about websphere, but I've come across the following webpage. If it's reliable then websphere seems to offer similar approaches ...

All in all, not much is standardized about application clients in the JEE spec.

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Thanks for your help..

I got an idea now.
 
wood burning stoves
 
subject: J2ee Application client module