jQuery in Action, 2nd edition*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Client Archive to Application Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Client Archive to Application Server" Watch "Client Archive to Application Server" New topic
Author

Client Archive to Application Server

Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226
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


28/06/06 - SCJP - 69%, 05/06/07 - SCWCD - 92%, 28/02/08 - IBM DB2 v9 Fundamentals (Exam 730) - 87%, 18/11/08 - IBM DB2 v9 DBA (Exam 731) - 89%, 26/02/11 - SCBCD - 88%
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226
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



[Thumbnail for EJB3InActionP390.jpeg]

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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

Joined: Nov 11, 2006
Posts: 226
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
 
GeeCON Prague 2014
 
subject: Client Archive to Application Server