• 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

J2ee Application client module

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could somebody please help me on this?
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anybody?
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help..

I got an idea now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic