• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client Archive to Application Server

 
Mark Garland
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm reading about packaging on pg. 391 of EJB3 in Action.

It mentions "Enterprise Java applications need to be assembled into specific types of JAR files before they can be deployed to an application server." and then goes on to list the various types of archive, including CAR - Client Application Archives.

It then shows an example EAR, which includes a packaged CAR.
META-INF/application.xml
actionBazaar-ejb.jar
actionBazaar.war
actionBazaar-client.jar
lib/actionBazaar-commons.jar


My question, is that if CARs are for Clients, and contain thick clients, why would you be packaging them inside an EAR? I understand that putting it in the EAR might keep everything together, however what does the Application Server do with it (presumably nothing as the code is for clients)?

Thanks,

MG
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thick clients ? It does not contain thick clients. It contains classes necessary to the client, like the beans business interfaces. The server also needs those classes, that's why they are in the ear.
 
Mark Garland
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe,

Thanks for your very quick response.

What you've said makes a lot more sense, but the book would disagree. See the attachment.
Perhaps a new Errata?

Thanks for your help,

MG
EJB3InActionP390.jpeg
EJB In Action P390
[Thumbnail for EJB3InActionP390.jpeg]
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. It's different from what I thought. It uses a client application descriptor (application-client.xml). I didn't remember that. This is described here. That page explains that it is convenient to have everything in one ear, so that the server uses only what it needs, and the client also uses only what it needs. It's fully described in the J2EE specification, Chapter EE.9 Application Clients.

I'm not sure that you need to know about it for the SCBCD exam. (I don't think you need to). It's out of the EJB spec.
 
Mark Garland
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe,

Thank you very much for your time and very useful reply.

I think the key sentence is here: "However, it is also possible to include a client module (a JAR file) in an EAR file. This JAR file is only used on the client side; you configure this client module using the application-client.xml deployment descriptor. This scheme makes it possible to package both client and server side modules together. The server looks only at the parts it is interested in (based on the application.xml file) and the client looks only at the parts it is interested in (based on the application-client.xml file). " taken from your link here: http://download.oracle.com/docs/cd/E12840_01/wls/docs103/client/appa.html

That makes perfect sense - thank you for your help,

MG
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic