2010-03-01 31 views
3

成功啓動Tomcat和幾個REST調用後,我在Tomcat控制檯中收到此消息,然後應用程序自動重新加載它。由於重新加載需要幾秒鐘,響應時間太長。然後再次 - 在REST調用後,我再次收到此消息並重新加載應用程序...信息:已添加其他JAR:'xalan-2.7.0.jar'

谷歌沒有幫助我,可以嗎? :)

我(長)的pom.xml:

 <?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>core</groupId> 
    <artifactId>core</artifactId> 
    <packaging>war</packaging> 
    <version>0.1</version> 
    <name>Core</name> 

    <repositories> 
     <repository> 
      <id>terracotta-repository</id> 
      <name>Terracotta</name> 
      <url>http://www.terracotta.org/download/reflector/maven2</url> 
     </repository> 
    </repositories> 

    <profiles> 
     <profile> 
      <!-- this profile is for deploying to jboss as --> 
      <id>jboss</id> 
      <dependencies> 
       <dependency> 
        <groupId>xml-apis</groupId> 
        <artifactId>xml-apis</artifactId> 
        <version>2.0.2</version> 
        <scope>provided</scope> 
       </dependency> 
      </dependencies> 
     </profile> 
    </profiles> 

    <dependencies> 
     <!-- Spring --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-core</artifactId> 
      <version>2.5.6</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-aop</artifactId> 
      <version>2.5.6</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-web</artifactId> 
      <version>2.5.6</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-jdbc</artifactId> 
      <version>2.5.6</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-orm</artifactId> 
      <version>2.5.6.SEC01</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>2.5.6</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.integration</groupId> 
      <artifactId>spring-integration-mail</artifactId> 
      <version>1.0.3.RELEASE</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-core</artifactId> 
      <version>2.0.2</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Struts --> 
     <dependency> 
      <groupId>org.apache.struts</groupId> 
      <artifactId>struts2-core</artifactId> 
      <version>2.1.8.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.struts</groupId> 
      <artifactId>struts2-convention-plugin</artifactId> 
      <version>2.1.8.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.struts</groupId> 
      <artifactId>struts2-rest-plugin</artifactId> 
      <version>2.1.8.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.struts</groupId> 
      <artifactId>struts2-spring-plugin</artifactId> 
      <version>2.1.8.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjweaver</artifactId> 
      <version>1.6.6</version> 
     </dependency> 

     <!-- Terracotta --> 
     <dependency> 
      <groupId>org.terracotta.modules</groupId> 
      <artifactId>tim-distributed-cache</artifactId> 
      <version>1.2.0</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- JiBX --> 
     <dependency> 
      <groupId>org.jibx</groupId> 
      <artifactId>jibx-run</artifactId> 
      <version>1.2.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.jibx</groupId> 
      <artifactId>jibx-extras</artifactId> 
      <version>1.2</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Servlet --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
      <scope>provided</scope> 
     </dependency> 

     <!-- Axis --> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2</artifactId> 
      <version>1.5.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-transport-http</artifactId> 
      <version>1.5.1</version> 
      <exclusions> 
       <!-- provided by tomcat --> 
       <exclusion> 
        <groupId>xerces</groupId> 
        <artifactId>xercesImpl</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>xerces</groupId> 
        <artifactId>xmlParserAPIs</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-transport-local</artifactId> 
      <version>1.5.1</version> 
     </dependency> 
     <dependency> 
      <groupId>httpcomponents-httpcore</groupId> 
      <artifactId>jakarta-httpcore</artifactId> 
      <version>4.0-alpha2</version> 
     </dependency> 
     <dependency> 
      <groupId>wsdl4j</groupId> 
      <artifactId>wsdl4j</artifactId> 
      <version>1.6.2</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.xmlbeans</groupId> 
      <artifactId>xmlbeans</artifactId> 
      <version>2.4.0</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Commons --> 
     <dependency> 
      <groupId>commons-lang</groupId> 
      <artifactId>commons-lang</artifactId> 
      <version>2.3</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-dbcp</groupId> 
      <artifactId>commons-dbcp</artifactId> 
      <version>1.2.2</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-httpclient</groupId> 
      <artifactId>commons-httpclient</artifactId> 
      <version>3.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-attributes</groupId> 
      <artifactId>commons-attributes-api</artifactId> 
      <version>2.1</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>commons-codec</groupId> 
      <artifactId>commons-codec</artifactId> 
      <version>1.4</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Quartz --> 
     <dependency> 
      <groupId>quartz</groupId> 
      <artifactId>quartz</artifactId> 
      <version>1.5.2</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Postgresql --> 
     <dependency> 
      <groupId>postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
      <version>8.4-701.jdbc3</version> 
      <scope>compile</scope> 
     </dependency> 

     <!-- Hibernate & JPA --> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-core</artifactId> 
      <version>3.3.2.GA</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-entitymanager</artifactId> 
      <version>3.4.0.GA</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-annotations</artifactId> 
      <version>3.4.0.GA</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>3.1.0.GA</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-ehcache</artifactId> 
      <version>3.3.2.GA</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>1.5.8</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.12</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax.mail</groupId> 
      <artifactId>mail</artifactId> 
      <version>1.4.1</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.7</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <finalName>core</finalName> 
     <plugins> 
      <!-- 
         <plugin> 
          <artifactId>maven-assembly-plugin</artifactId> 
          <configuration> 
           <descriptorRefs> 
            <descriptorRef>jar-with-dependencies</descriptorRef> 
           </descriptorRefs> 
           <archive> 
            <manifest> 
             <mainClass></mainClass> 
            </manifest> 
           </archive> 
          </configuration> 
          <executions> 
           <execution> 
            <id>make-assembly</id> 
            <phase>package</phase> 
            <goals> 
             <goal>attached</goal> 
            </goals> 
           </execution> 
          </executions> 
         </plugin> 
      --> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.0.2</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 

      <plugin> 
       <artifactId>maven-idea-plugin</artifactId> 
       <version>2.2</version> 
       <configuration> 
        <downloadSources>true</downloadSources> 
        <downloadJavadocs>true</downloadJavadocs> 
        <dependenciesAsLibraries>true</dependenciesAsLibraries> 
        <useFullNames>false</useFullNames> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.jibx</groupId> 
       <artifactId>maven-jibx-plugin</artifactId> 
       <version>1.2.1.1</version> 
       <configuration> 
        <directory>src/main/resources/config/rest/mappings</directory> 
        <includes> 
         <include>*.xml</include> 
        </includes> 
        <!--<verbose>true</verbose>--> 
       </configuration> 
       <executions> 
        <execution> 
         <phase>process-classes</phase> 
         <goals> 
          <goal>bind</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.4.3</version> 
       <configuration> 
        <testFailureIgnore>true</testFailureIgnore> 
       </configuration> 
      </plugin> 

      <!-- --> 
      <plugin> 
       <groupId>org.apache.axis2</groupId> 
       <artifactId>axis2-wsdl2code-maven-plugin</artifactId> 
       <version>1.5.1</version> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <executions> 
        <execution> 
         <phase>compile</phase> 
         <configuration> 
          <tasks> 
           <property name="compile_classpath" refid="maven.compile.classpath"/> 
           <property name="runtime_classpath" refid="maven.runtime.classpath"/> 
           <property name="test_classpath" refid="maven.test.classpath"/> 
           <property name="plugin_classpath" refid="maven.plugin.classpath"/> 

           <fileset id="dataClasses" dir="${basedir}/src/main/java" includes="**/*.java"> 
            <or> 
             <contains text="@Entity"/> 
             <contains text="@javax.persistence.Entity"/> 
            </or> 
           </fileset> 

           <copy file="${basedir}/src/main/resources/hibernate/hibernate.cfg.tmpl.xml" 
             tofile="${basedir}/src/main/resources/hibernate/hibernate.cfg.xml" 
             overwrite="true"/> 

           <pathconvert targetos="unix" pathsep="&quot;/&gt;&#10;  &lt;mapping class=&quot;" 
              property="mappedClasses" 
              refid="dataClasses"> 
            <chainedmapper> 
             <globmapper 
               from="${basedir}${file.separator}src${file.separator}main${file.separator}java${file.separator}" 
               to=""/> 
             <packagemapper from="*.java" to=""/> 
            </chainedmapper> 
           </pathconvert> 

           <echo message="mapped classes: ${mappedClasses}"/> 

           <replace file="${basedir}/src/main/resources/hibernate/hibernate.cfg.xml" 
             token="INSERT HBM FILES HERE" 
             value="${mappedClasses}"/> 

           <copy file="${basedir}/src/main/resources/hibernate/hibernate.cfg.xml" 
             tofile="${basedir}/target/classes/hibernate.cfg.xml" overwrite="true"/> 

           <java 
             jvm="${java.home}" 
             classpath="${compile_classpath}" 
             classname="net.core.jpa.hibernate.HibernateUtils"> 
            <arg value="${basedir}/src/main/resources/hibernate/hibernate.sql"/> 
           </java> 

           <copy file="${basedir}/src/main/resources/hibernate/hibernate.sql" 
             tofile="${basedir}/src/main/resources/hibernate/hibernate.sql.ori" 
             overwrite="true"/> 

           <java 
             jvm="${java.home}" 
             classpath="${runtime_classpath}" 
             classname="net.core.jpa.hibernate.SqlFixer"> 
            <arg value="${basedir}/src/main/resources/hibernate/hibernate.sql"/> 
           </java> 

           <!-- 
           <taskdef name="instrument" 
             classname="org.hibernate.tool.instrument.javassist.InstrumentTask"> 
            <classpath> 
             <path refid="maven.runtime.classpath"/> 
             <path refid="maven.plugin.classpath"/> 
            </classpath> 
           </taskdef> 
           <instrument verbose="false"> 
            <fileset dir="${project.build.outputDirectory}"> 
             <include name="**/data/**/*.class"/> 
            </fileset> 
           </instrument> 
           --> 

          </tasks> 
         </configuration> 
         <goals> 
          <goal>run</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.1-beta-1</version> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

Tomcat的日誌:

1.3.2010 13:29:16 org.apache.tomcat.util.digester.SetPropertiesRule begin 
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:core' did not find a matching property. 
1.3.2010 13:29:16 org.apache.catalina.core.AprLifecycleListener init 
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\PC Connectivity Solution\;C:\Program Files\Nokia\Carbide.c++ v1.3\x86Build\Symbian_Tools\Command_Line_Tools;C:\Program Files\Common Files\Symbian\Tools;C:\Program Files\CSL Arm Toolchain\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\ActivIdentity\ActivClient\;c:\Program Files\Hewlett-Packard\IAM\bin;c:\Python26;c:\Program Files\TortoiseSVN\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\TortoiseGit\bin;C:\Sun\SDK\bin;; 
1.3.2010 13:29:16 org.apache.coyote.http11.Http11Protocol init 
INFO: Initializing Coyote HTTP/1.1 on http-8080 
1.3.2010 13:29:16 org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 390 ms 
1.3.2010 13:29:16 org.apache.catalina.core.StandardService start 
INFO: Starting service Catalina 
1.3.2010 13:29:16 org.apache.catalina.core.StandardEngine start 
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20 
1.3.2010 13:29:17 org.apache.catalina.core.ApplicationContext log 
INFO: Set web app root system property: 'core.root' = [C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\core\] 
1.3.2010 13:29:17 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing log4j from [file:C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/conf/livecliq-log4j.properties] 
1.3.2010 13:29:17 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing Spring root WebApplicationContext 
1.3.2010 13:29:27 org.apache.coyote.http11.Http11Protocol start 
INFO: Starting Coyote HTTP/1.1 on http-8080 
1.3.2010 13:29:27 org.apache.jk.common.ChannelSocket init 
INFO: JK: ajp13 listening on /0.0.0.0:8009 
1.3.2010 13:29:27 org.apache.jk.server.JkMain start 
INFO: Jk running ID=0 time=0/16 config=null 
1.3.2010 13:29:27 org.apache.catalina.startup.Catalina start 
INFO: Server startup in 10983 ms 
1.3.2010 13:29:37 org.apache.catalina.loader.WebappClassLoader modified 
INFO:  Additional JARs have been added : 'xalan-2.7.0.jar' 
1.3.2010 13:29:37 org.apache.catalina.core.StandardContext reload 
INFO: Reloading this Context has started 
1.3.2010 13:29:38 org.apache.catalina.core.ApplicationContext log 
INFO: Closing Spring root WebApplicationContext 
1.3.2010 13:29:38 org.apache.catalina.core.ApplicationContext log 
INFO: Shutting down log4j 
1.3.2010 13:29:38 org.apache.catalina.core.ApplicationContext log 
INFO: Set web app root system property: 'core.root' = [C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\core\] 
1.3.2010 13:29:38 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing log4j from [file:C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/conf/livecliq-log4j.properties] 
1.3.2010 13:29:39 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing Spring root WebApplicationContext 
1.3.2010 13:29:59 org.apache.catalina.loader.WebappClassLoader modified 
INFO:  Additional JARs have been added : 'xalan-2.7.0.jar' 
1.3.2010 13:29:59 org.apache.catalina.core.StandardContext reload 
INFO: Reloading this Context has started 
1.3.2010 13:29:59 org.apache.catalina.core.ApplicationContext log 
INFO: Closing Spring root WebApplicationContext 
1.3.2010 13:29:59 org.apache.catalina.core.ApplicationContext log 
INFO: Shutting down log4j 
1.3.2010 13:30:00 org.apache.catalina.core.ApplicationContext log 
INFO: Set web app root system property: 'core.root' = [C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\core\] 
1.3.2010 13:30:00 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing log4j from [file:C:\Work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0/conf/log4j.properties] 
1.3.2010 13:30:00 org.apache.catalina.core.ApplicationContext log 
INFO: Initializing Spring root WebApplicationContext 
+0

你可以加入日誌消息與周圍的條目嗎?此外,這是與一個香草Tomcat或JBoss? – 2010-03-01 11:08:15

+0

其Apache Tomcat 6.0.20。 – Trick 2010-03-01 12:33:56

回答

3

更多的線索比一個答案,但類似的Eclipse/Tomcat的/春天的問題(與其他JAR)報告於Application Context Keeps ReloadingTomcat behaving Strangely。檢查您的xalan JAR是否未損壞(嘗試使用winzip打開它)並在需要時重新下載它。如果沒有,也許嘗試在JBoss上部署,看看這個問題是否與Tomcat插件相關。

+0

我會檢查它的答案,因爲它導致我的錯誤。該文件被破壞是的,但在Eclipse的服務器目錄中的文件!在這裏:「C:\ Work \ metadata \ .plugins \ org.eclipse.wst.server.core \ tmp0 \ wtpwebapps \ core \ WEB-INF \ lib」。我不知道爲什麼Eclipse沒有把它從Maven或Apache的目錄中拿走... – Trick 2010-03-02 14:55:37

+0

@Trick很高興它已經解決了 – 2010-03-02 15:40:07

相關問題