[JAVAEETUTORIAL-153] Incomplete/incorrect ANT example and explanation. Created: 14/Feb/13  Updated: 16/Jul/13  Resolved: 16/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.8
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: swiss-chris Assignee: Ian Evans
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes


In the EJB Tutorial "cart" project, we find the following passage:


3. Type the following command:
ant deploy
The cart.ear file is deployed to the GlassFish Server.

4. Type the following command:
ant run
This task retrieves the application client JAR, cartClient.jar, and runs the application client. The client JAR, cartClient.jar, contains the application client class, the helper class BookException, and the Cart business interface.

This task is equivalent to running the following command:

appclient -client cartClient.jar
When you run the client, the application client container injects any component references declared in the application client class, in this case the reference to the Cart enterprise bean.


There are two errors in the above text, afaik:
1. The text states that: "[the 'ant run'] task is equivalent to running [...] appclient -client cartClient.jar". This is not true. Running
'appclient -client cartClient.jar'
does not "retrieve the application client JAR, cartClient.jar,", hence the output will be "Error: Unable to access jarfile appClient.jar"
2. Even if the user knew to run 'ant client-jar' before the appclient task, the appclient task would need to be
'appclient -client client-jar\appClient.jar'
if the user doesn't cd into the client-jar directory beforehand.

My suggestion would be the following. Modify the text to read:
"This task is equivalent to running the following command:
ant client-jar
appclient -client client-jar\cartClient.jar"

This will help the user understand what's going on in the background, which was the main point missing for me in this tutorial in the first place. After following through on the cart exercise, my main question was: "How does the client-app know where to find the remote EJB on the glassfish server Unable to render embedded object: File (" Providing the 'ant client-jar' task and maybe explaining what's happening in the background (asadmin ...) would be a great help for anyone interested in how the remote EJB binding works in this example) not found. Hence my improvement suggestion to add this to the next revision of the tutorial.

Comment by Ian Evans [ 14/Feb/13 ]

The text could be clearer about exactly which steps ant run performs.

This issue affect the Java EE 6 Tutorial. At this point, we don't have any planned updates for the EE 6 Tutorial, and we have moved to Maven for Java EE 7.

If we have another EE 6 release, this issue should be fixed in the documentation source.

Comment by Ian Evans [ 16/Jul/13 ]

With no planned releases of the Java EE 6 Tutorial planned, and the Java EE 7 Tutorial released (which uses Maven), I'm closing this out.

Generated at Sat Dec 03 11:27:18 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.