Resolution: Won't Fix
Affects Version/s: 6.0.8
Fix Version/s: None
In the EJB Tutorial "cart" project, we find the following passage:
3. Type the following command:
The cart.ear file is deployed to the GlassFish Server.
4. Type the following command:
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:
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.