Pourquoi cette erreur de fourmi n'empêche - t-elle pas l'ensemble du système(Java Pet Store) de fonctionner?


J'étudie le projet Java Pet Store(un peu daté) . Lors de l'exécution de la configuration, je dois exécuter ant J'obtiens cette erreur:

C:\LatestPS\trunk\ws\apps\petstore>ant
Buildfile: C:\LatestPS\trunk\ws\apps\petstore\build.xml

default-ear:

-pre-compile:

bpp-actual-compilation:
     [echo] Compiling petstore
    [mkdir] Created dir: C:\LatestPS\trunk\ws\apps\petstore\build\web\WEB-INF\cl
asses
    [javac] Compiling 40 source files to C:\LatestPS\trunk\ws\apps\petstore\buil
d\web\WEB-INF\classes
    [javac] C:\LatestPS\trunk\ws\apps\petstore\src\java\com\sun\javaee\blueprint
s\petstore\model\CatalogFacade.java:39: package javax.servlet.annotation does no
t exist
    [javac] import javax.servlet.annotation.WebListener;
    [javac]                                ^
    [javac] C:\LatestPS\trunk\ws\apps\petstore\src\java\com\sun\javaee\blueprint
s\petstore\model\CatalogFacade.java:41: cannot find symbol
    [javac] symbol: class WebListener
    [javac] @WebListener()
    [javac]  ^
    [javac] 2 errors

BUILD FAILED
C:\LatestPS\trunk\ws\bp-project\command-line-ant-tasks.xml:78: Compile failed; s
ee the compiler error output for details.

Total time: 2 seconds

C:\LatestPS\trunk\ws\apps\petstore>

Après cela, je fais d'autres choses de configuration (asadmin start-database, puis Mais ensuite, lorsque asadmin start-domain domain1, puis ant deploy).

Mais finalement je vais à la destination finale de la page Web (http://localhost:8080/petstore/faces/index.jsp ) , et cela fonctionne (image)!

entrez la description de l'image ici

Et voici la construction.fichier xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2006 Sun Microsystems, Inc.  All rights reserved.  You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: 
 http://developer.sun.com/berkeley_license.html
 $Id: build.xml,v 1.56 2007-03-16 15:29:15 basler Exp $ -->

<project name="petstore" default="default" basedir=".">
    <description>Builds, tests, and runs the project petstore.</description>

    <property name="is.war.module" value="true"/>
    <property name="default.javac.target" value="1.5"/>
    <property name="default.javac.source" value="1.5"/>
    <import file="bp-project.xml" />

    <available property="bp-ui-5-jar.exists" file="lib/bp-ui-5.jar"/>    
    <target name="create-bp-ui-5-jar" depends="init" unless="bp-ui-5-jar.exists">
        <ant dir="${bp-ui-5.home}" inheritAll="false" inheritRefs="false"/>
        <!-- copy appropriate jars that are needed in petstore -->
        <copy todir="lib/">
            <fileset dir="${bp-ui-5.home}/dist"/> 
        </copy>
    </target>    

    <target name="-post-compile" depends="init">
        <!-- copy property files into build directory -->
        <copy todir="${build.classes.dir}" overwrite="true">
            <fileset dir="src/java">
                <include name="**/*.properties"/>
            </fileset>
        </copy>
        <mkdir dir="${build.web.dir}/WEB-INF/lib"/>
        <copy todir="${build.web.dir}/WEB-INF/lib">
            <fileset file="./build/catalog-persistence.jar"/>
            <fileset file="${file.reference.lucene-core-2.0.0.jar}"/>
            <fileset file="${file.reference.bp-ui-5.jar}"/>
            <fileset file="${file.reference.shale-remoting.jar}"/>
            <fileset file="${file.reference.commons-fileupload-1.1.1.jar}"/>
            <fileset file="${file.reference.commons-io-1.2.jar}"/>
            <fileset file="${file.reference.commons-logging-1.1.jar}"/>
            <fileset file="${file.reference.jdom.jar}"/>
            <fileset file="${file.reference.rome-0.8.jar}"/>
            <fileset file="${file.reference.rome-fetcher-0.7.jar}"/>
        </copy>        

        <copy file="src/conf/persistence.xml" todir="${build.web.dir}/WEB-INF/classes/META-INF"/>

        <antcall target="insert-proxy-settings"/>
    </target>

    <target name="insert-proxy-settings">
        <copy todir="${build.web.dir}/WEB-INF/" file="web/WEB-INF/web.xml"/>
        <concat destfile="${build.dir}/proxy.properties">proxy.host=${proxy.host}
            proxy.port=${proxy.port}
            <filterchain>
                <expandproperties/>
            </filterchain>
        </concat>
        <!-- Replace value of the proxy settings in web.xml for Google maps -->
        <replace file="${build.web.dir}/WEB-INF/web.xml" propertyFile="${build.dir}/proxy.properties">          
            <replacefilter token="@@proxy.host@@" property="proxy.host"/>
            <replacefilter token="@@proxy.port@@" property="proxy.port"/>
        </replace>        
    </target>

    <target name="unzipIndexes">
        <unzip src="lib/petstoreIndexes.zip" dest="${javaee.domaindir}/lib/petstore" overwrite="true"/>
    </target>

    <target name="setup" depends="init, create-bp-ui-5-jar">
        <mkdir dir="${javaee.domaindir}/lib/petstore/images"/>
        <ant dir="." antfile="setup/setup.xml" target="setup" inheritAll="false" inheritRefs="false"/>
        <antcall target="unzipIndexes"/>
    </target>

    <target name="unsetup">
        <ant dir="." antfile="setup/setup.xml" target="unsetup" inheritAll="false" inheritRefs="false"/>
    </target>

    <target name="checkLines">
        <fixcrlf srcdir="./src" tab="remove" tablength="4" eol="unix" includes="**/*.properties,**/*.jsp,**/*.html,**/*.sh,**/*.java,**/*.xml" excludes="**/ja/**" />
    </target>
</project>

Pourquoi l'a-t-il laissé courir, mais avant a dit qu'il ya un échec ? Comment puis-je corriger ce message d'erreur(ou dois-je même le faire?) ?

Author: Coffee, 2012-08-26