1. javaeetutorial

Incomplete/incorrect ANT example and explanation.


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 6.0.8
    • Fix Version/s: None
    • Component/s: doc
    • Labels:


      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.



          • Assignee:
            Ian Evans
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created:

              Time Tracking

              Original Estimate - 5 minutes
              Remaining Estimate - 5 minutes
              Time Spent - Not Specified
              Not Specified