This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Packaging Confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Packaging Confusion" Watch "Packaging Confusion" New topic
Author

Packaging Confusion

khaled Jamal
Ranch Hand

Joined: Feb 16, 2009
Posts: 64
Hi everyone

This is an example from the spec :

In this example, the Bean Provider has chosen to package the enterprise bean client view classes in a separate jar file and to reference that jar file from the other jar files that need those classes.

Those classes are needed both by ejb2.jar, packaged in the same application as ejb1.jar, and by ejb3.jar, packaged in a different application.

Those classes are also needed by ejb1.jar itself because they define the remote interface of the enterprise beans in ejb1.jar, and the Bean Provider has chosen the by reference approach to making these classes available.

The deployment descriptor for ejb1.jar names the client view jar file in the ejb-client-jar element. Because ejb2.jar requires these client view classes, it includes a Class-Path reference to ejb1_client.jar.

The Class-Path mechanism must be used by components in app2.ear to reference the client view jar file that corresponds to the enterprise beans packaged in ejb1.jar of app1.ear.

Those enterprise beans are referenced by enterprise beans in ejb3.jar. Note that the client view jar file must be included directly in the app2.ear file.

app1.ear:
META-INF/application.xml
ejb1.jar Class-Path: ejb1_client.jar
deployment descriptor contains:
<ejb-client-jar>ejb1_client.jar</ejb-client-jar>
ejb1_client.jar
ejb2.jar Class-Path: ejb1_client.jar

app2.ear:
META-INF/application.xml
ejb1_client.jar
ejb3.jar Class-Path: ejb1_client.jar

I didn't get why we have to include the <ejb-client-jar>ejb1_client.jar</ejb-client-jar>
in the DD of ejb1.jar and not in ejb2.jar and ejb3.jar

let me know please about that and about the difference between including the jar file in DD by means of the ejb-client-jar element AND using the Class-Path mecanism

Thanks


SCJP 6, SCBCD 5, SCWCD 5



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Packaging Confusion
 
Similar Threads
Relationships doubt
<ejb-client-jar> example from the core specification
ejb-ref and ejb-local-ref
EJB3 Session bean and JBoss 5
Cleared SCBCD last week.. some notes