"asant build" for bookstore1 example in j2ee tutorial gives "compile error"

Hello everybody,
I am trying to run "asant build" command to build package for bookstore1 example given in j2ee tutorials.
I installed my j2ee tutorial 1.4 in "c:\java\j2eetutorial14" and my example is in "c:\java\j2eetutorial\examples\web\bookstore1".
My j2ee SDK with appliation server is installed in C:\sun\appserver.
When i run the "asant build" command in "c:\java\j2eetutorial\examples\web\bookstore1" directory i get compile error with last few lines as follows.
[javac] location: class servlets.ShowCartServlet
[javac] } catch (BookNotFoundException ex) {
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:136: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
:137: cannot resolve symbol
[javac] symbol : class BookDetails
[javac] location: class servlets.ShowCartServlet
[javac] bd = (BookDetails) item.getItem();
[javac] ^
[javac] 69 errors
BUILD FAILED
file:C:/Java/j2eetutorial14/examples/web/bookstore1/build.xml:68: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Can some one please help me.
thanks

When i run the "asant build" command in
"c:\java\j2eetutorial\examples\web\bookstore1"
directory i get compile error with last few lines as
follows.Did you package the bookstore common files as described in Chapter 3? My guess is that you didn't include bookstore.jar from <INSTALL>/j2eetutorial14/examples/build/web/bookstore/dist/.
-Ian Evans
Sun Microsystems
J2EE Tutorial team

Similar Messages

  • Error when executing EJB example in J2EE Tutorial

    Hi,
    I am trying Converter example in J2EE tutorial.
    I have created ConverterJAR and ConverterWAR
    ConverterJAR is verified sucessfully when using verifier option
    When verifying ConverterWAR i am getting the following error
    Error: Class [ converter.ConverterHome ] not found in WEB-INF/classes or WEB-INF/lib.
    For [ /ConverterWAR ]
    Error: class [ converter.ConverterHome ] cannot be found within this jar [ war-ic.war ].
    Error: Class [ converter.Converter ] not found in WEB-INF/classes or WEB-INF/lib.
    For [ /ConverterWAR ]
    Error: class [ converter.Converter ] cannot be found within this jar [ war-ic.war ].
    Please let me know if anybody aware of this problem

    I have created ConverterJAR and ConverterWAR
    ConverterJAR is verified sucessfully when using
    verifier option
    When verifying ConverterWAR i am getting the
    following errorCreate an EJB-client JAR which will contain only the home and remote interfaces. Place it in WEB-INF/lib of your webapp and recreate your WAR. This should solve the problem. :)
    $

  • Running examples from J2EE Tutorial

    Has anyone been successfully running examples from
    J2EE Tutorial on Creator?
    I tried to import the JSP but Creator complains that it is
    not an XHTML document. Clicking on the 'Convert to XHTML'
    button or 'Preview...' button does not seem to do anything.
    Openning the Source panel shows parsing problems on
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    Does anyone know how to run these in Creator correctly?
    - weijyh

    Yes,
    It runs successfully....
    I have download the examples from Sun,
    unzipped It into my Projektfolder and open it in Creator, start it and works fine ...
    No error messages ....

  • I am trying to buy mitril for hobbit kom but it always gives me error i have already added my card information to store but i cant buy it.Could u help me about it ,please?

    I am trying to buy mitril for hobbit kom but it always gives me error i have already added my card information to store but i cant buy it.Could u help me about it ,please?

    Wish I could help. My wife is having the same problem.  Same computer for 2 years and all of a suddent it thinks this is her first purchase.

  • Why does plsql give compilation error for select statement?

    When I run following plsql program, it gives compilation error. Could somebody please point me out what could be wrong here? I am running it from system user.
    create or replace procedure drop_user_proc (iname in varchar2) is
    uname varchar2(100);
    begin
    select username into uname from dba_users where username = upper(iname);
    end drop_user_proc;
    select username from dba_users where username = upper('newuser');
    When I run it, I get following error. dba_users is there that is the reason it works outside plsql block, but it doesn't from inside block.
    SQL> @t4
    Warning: Procedure created with compilation errors.
    USERNAME
    NEWUSER
    SQL> show err
    Errors for PROCEDURE DROP_USER_PROC:
    LINE/COL ERROR
    4/3 PL/SQL: SQL Statement ignored
    4/35 PL/SQL: ORA-00942: table or view does not exist

    Role based grants are not available within the stored procedures.
    Only explicit grants are recognized when compiling stored code.
    You need to grant select on that table to the user where you are creating this procedure.

  • How to use ant1.3 in Wndows ME to build the examples in J2EE Tutorial?

    When I tried to build the examples bundled with j2ee tutorial in the ..\j2eetutorial\examples directory using the ant 1.3 on Wndows ME I get the following exception.Anybody please help me.Is there any other build tool available for download?
    StringIndexOutOfboundsException
    D:\JAVATUTORIAL\J2EE\j2eetutorial\examples> ant -verbose all
    Ant version 1.3 compiled on March 2 2001
    Buildfile: build.xml
    Detected Java Version: 1.3
    Detected OS: Windows Me
    parsing buildfile D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml with URI
    = file:D:/JAVATUTORIAL/J2EE/j2eetutorial/examples/build.xml
    Project base dir set to: D:\JAVATUTORIAL\J2EE\j2eetutorial\examples
    Build sequence for target `all' is [init, savingsaccount, bank, cart, checker, c
    onfirmer, converter, enroller, order, salesrep, storagebin, teller, htmlreader,
    warehouse, simplemessage, cmproster, ejb, date, hello1, hello2, bookstore1, web-
    ejb, bookstore2, bookstore3, web, all]
    Complete build sequence is [init, savingsaccount, bank, cart, checker, confirmer
    , converter, enroller, order, salesrep, storagebin, teller, htmlreader, warehous
    e, simplemessage, cmproster, ejb, date, hello1, hello2, bookstore1, web-ejb, boo
    kstore2, bookstore3, web, all, create-storagebin-table, get-cci-jar, procs, cci,
    connector, create-salesrep-table, create-procs-alias, create-coffee-table, abou
    t, create-enroller-table, create-savingsaccount-table, create-web-db, create-war
    ehouse-table, create-bank-table, clean, create-order-table, create-teller-table,
    prepare, create-ejb-db]
    init:
    [property] Loading Environment myenv.
    BUILD FAILED
    D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml:19: D:\JAVATUTORIAL\J2EE\j2
    eetutorial\examples\build.xml:19: java.lang.StringIndexOutOfBoundsException: Str
    ing index out of range: -1
    --- Nested Exception ---
    D:\JAVATUTORIAL\J2EE\j2eetutorial\examples\build.xml:19: java.lang.StringIndexOu
    tOfBoundsException: String index out of range: -1
    --- Nested Exception ---
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1476)
    at org.apache.tools.ant.taskdefs.Property.loadEnvironment(Property.java:
    248)
    at org.apache.tools.ant.taskdefs.Property.execute(Property.java:172)
    at org.apache.tools.ant.Target.execute(Target.java:153)
    at org.apache.tools.ant.Project.runTarget(Project.java:898)
    at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    at org.apache.tools.ant.Project.executeTargets(Project.java:510)
    at org.apache.tools.ant.Main.runBuild(Main.java:421)
    at org.apache.tools.ant.Main.main(Main.java:149)
    Total time: 2 seconds
    D:\JAVATUTORIAL\J2EE\j2eetutorial\examples>
    *********************************************************************

    Please Help Me

  • Can't download chart builder for survey example

    Hey.. I've been able to download the 9i development suite, jdeveloper, and just about everything else, but when I try to access the download page to chart builder, I get bounced back to the license page.
    I'm a university student, and I desperately want to install the survey example application.
    I'm using IE6 on Win XP Pro.
    I noticed in a message somewhere, that someone was going to send something direct.. if the files are less than 5-6 MB they could be e-mailed directly to me. I suspect it's taboo to leave an address, but I suspect that there's a way to find it through my OTN account.
    thanks..
    Mike

    Try this url for Chartbuilder:
    Oracle Chart Builder for NT (3,297,099 bytes) - http://otn.oracle.com/software/htdocs/distlic.html?http://download.oracle.com/otn/utilities_drivers/chartbuilder/chartbuilder_kit_10.zip
    OTN

  • Problem with bookstore1 example in J2EE 5 tutorial

    Hi everyone. I'm pretty experienced with J2EE but new to the 1.5 version. I'm using the Sun One Server 9.1 and the ant tools. This is referring to the samples in the J2EE 1.5 tutorial. I set my build.properties file and tried to build bookstore1 using ant and then ant deploy. I get the following error.
    Deploying application in domain failed; Error loading deployment descriptors for module [bookstore1] -- javax.annotation.Resource.authenticationType()Ljavax/annotation/Resource$AuthenticationType;at com.sun.enterprise.deployment.annotation.AnnotationInfo@4b35d5 Error loading deployment descriptors for module [bookstore1] -- javax.annotation.Resource.authenticationType()Ljavax/annotation/Resource$AuthenticationType;at com.sun.enterprise.deployment.annotation.AnnotationInfo@4b35d5
    This error is wracking my brain. If any one could help me with this, I'd really appreciate it.

    Well, i haven't checked this forum for a while so by now you've probably figured this out. Anyway, there is a build.properties.sample file in the $JAVA_TUTORIAL_HOME\examples\bp-project directroy. Rename that file to build.properties. Open it and look at it. Really, it should already be filled out. There is a property in there like this
    javaee.server.passwordfile=${javaee.tutorial.home}/examples/common/admin-password.txtYou have to go to this admin-password.txt file and set the password to your app server. In mine, I have
    AS_ADMIN_PASSWORD=passwordNow, you can go to any web project and run asant. Us asant (which stands for Application Server ant). You can use ant, but using asant will ensure your using the right version. Also be sure your using Java Application Server 9 and the asant that comes with it.

  • Problems with Running the Examples in J2ee tutorial-asant utility

    Hello,
    I am just working on the examples given in the J2EE tutorials given by SUN.
    When trying to build the examples using the asant utility,I encounter an error message saying
    "BUILD FAILED"
    and it says some error with the build.xml file (C:\lib not found)
    I think i have all my CLASSPATH settings and PATH setting right.Can anyone suggets me a solution to this problem,so that i can go ahead with the details.
    Thanks
    Sandeep

    did you set the build.properties settings properly ?

  • Re: Case strange with an example of j2ee tutorial

    Sounds like a UI bug in deploy tool. You can always directly set the .xml for the env-entry in the ejb-jar.xml. It would look like this :
    <env-entry>
    <env-entry-name>DiscountLevel</env-entry-name>
    <env-entry-type>java.lang.Double</env-entry-type>
    <env-entry-value>0.05</env-entry-value>
    </env-entry>
    Then in the code :
    InitialContext ic = new InitialContext();
    Double discountLevel = (Double) ic.lookup("java:comp/env/DiscountLevel");
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Did you try looking up for "jdbc/BookDB" only?

  • I NEED HELP using Site Builder for adding sound to my personal webspace ~~ getting error!!

    I am trying to add a sound .wav file to my personal webspace and keep getting this error. 
    Even tried converting it to a .mp3 file and still got this error.  Anyone know a solution?

    If it did work then we know that there's nothing wrong with the site support for mp3 files. The problem is with how Itunes ripped the CD then if the website wasn't even accepting the .wav file it created. Try using another program to rip the CD. If you have a windows computer, you can use Windows Media Player to do the ripping. See if that works for you.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • My IPad 2 which I bought very recently is apparently the wrong build for Ios5 I tried DFU mode the same error occurs please help

    WHat do i do now? It will not update no matter what i do and it is an Ipad 2 purchased only a few weeks ago

    Calm down.  They are all the same.  First, make sure your. I tunes  is version 10.5.  Then plug the ipad into the computer.  On the left side, your pad should show up as a device.  Click it. Then i tunes will guide you thru the update.   In theory, anyway....

  • Tutorial 7 - Compile errors

    BUILD FAILED: C:\medrec_tutorial\src\physicianEar\mybuild.xml:7: Could not create
    task or type of type: wlcompile.
    Ant could not find the task or a class this task relies upon.
    This is common and has a number of causes; the usual
    solutions are to read the manual pages then download and
    install needed JAR files, or fix the build file:
    - You have misspelt 'wlcompile'.
    Fix: check your spelling.
    - The task needs an external JAR file to execute
    and this is not found at the right place in the classpath.
    Fix: check the documentation for dependencies.
    Fix: declare the task.
    - The task is an Ant optional task and optional.jar is absent
    Fix: look for optional.jar in ANT_HOME/lib, download if needed
    - The task was not built into optional.jar as dependent
    libraries were not found at build time.
    Fix: look in the JAR to verify, then rebuild with the needed
    libraries, or download a release version from apache.org
    - The build file was written for a later version of Ant
    Fix: upgrade to at least the latest release version of Ant
    - The task is not an Ant core or optional task
    and needs to be declared using <taskdef>.
    Remember that for JAR files to be visible to Ant tasks implemented
    in ANT_HOME/lib, the files must be in the same directory or on the
    classpath
    Please neither file bug reports on this problem, nor email the
    Ant mailing lists, until all of these causes have been explored,
    as this is not an Ant bug.
    Total time: 781 milliseconds
    Please help!!!
    Kaven

    Hey Kaven. The Ant task "wlcompile" is a custom Ant task provided within the WebLogic 8.1 distribution. If you use the set environment scripts within the distribution, the distribution's Ant script will be used and all the necessary jars will be added to your classpath. The class WLCompileTask is packaged in weblogic.jar.
    Message was edited by cwall at Jul 19, 2004 3:54 PM

  • Asant build on Windows

    Appserver is installed into: c:\Program files\Sun\Appserver
    When trying to perform
    asant build
    for hello1 sample an error occured
    c:\program%20files\Sun\j2eetutorial14\examles\common\targets.xml couldn't be found
    and
    c:\program%20files\Sun\j2eetutorial14\examles\web\common\targets.xml
    I found an advise inthe forum to set j2ee.home property. But the problem remained.
    I replaced entity tags references in a build.xml such as &targets and &webtargets with corresponding
    contents of targets.xml The problem disappeared.
    I think there is a problem with ant or xml parser when treating <!ENTITY > tags.
    So, have I to install j2ee into any dirrectory that does not contain white spaces ?

    A number of people have reported problems on Windows, when the App Server has been installed in C:\Program Files. This is due to the space embedded in the path.
    This error may be another manifestation of this issue.
    Please try reinstalling the app server (in some place like "C:\Sun\AppServer" [no spaces]) and try using asant them.
    Note: even if this error is not caused by this issue, there are a number of other errors which can only be resolved by doing the re-install.
    vbk

  • J2EE Tutorial

    I need do make work the examples of J2EE Tutorial. But, when i execute c:\j2eetutotial\examples\ant all happen following error : Exception in thread main java.lang.NoClassDefFoundError: org/apache/tools/ant/Main.
    What I do will make to try ??
    Tanks a lot.
    Obs.: Sorry, but my English is very bad !!!
    S�rgio
    Bauru - SP - Brasil
    [email protected]

    check your classpath configuration
    and if it is not included .(current directory) then
    add . to classpath
    bye

Maybe you are looking for