当我启动tomcat时,我的java应用程序只是一遍又一遍地重复启动

时间:2011-11-11 21:28:45

标签: java jsf tomcat

当我在我的IDE中使用此特定项目(adminapp)启动tomcat时,它会不断重新启动并重新启动。

这是我的堆栈跟踪。如果我离开电脑,我会看到这几百次。

什么会导致应用继续这样做?

Nov 11, 2011 3:25:36 PM 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:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\sybase15_0_7\OCS-15_0\bin;C:\sybase15_0_7\OCS-15_0\dll;C:\sybase15_0_7\OCS-15_0\lib3p;C:\sybase15_0_7\DataAccess\ADONET\dll;C:\sybase15_0_7\DataAccess\ODBC\dll;C:\sybase15_0_7\DataAccess\OLEDB\dll;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files (x86)\QuickTime\QTSystem\;.
Nov 11, 2011 3:25:36 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:adminapp' did not find a matching property.
Nov 11, 2011 3:25:36 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 11, 2011 3:25:36 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 730 ms
Nov 11, 2011 3:25:36 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 11, 2011 3:25:36 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.33
Nov 11, 2011 3:25:40 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
Nov 11, 2011 3:25:53 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 11, 2011 3:25:53 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 11, 2011 3:25:53 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23  config=null
Nov 11, 2011 3:25:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 16615 ms
Nov 11, 2011 3:26:03 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'standard.jar'
Nov 11, 2011 3:26:03 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/adminapp] has started
Nov 11, 2011 3:26:03 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/adminapp] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@7446a09b]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@48da5bc0]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Nov 11, 2011 3:26:05 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
Nov 11, 2011 3:26:22 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'standard.jar'
Nov 11, 2011 3:26:22 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/adminapp] has started
Nov 11, 2011 3:26:22 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/adminapp] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@18e3f02a]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@1cac622a]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Nov 11, 2011 3:26:23 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
Nov 11, 2011 3:26:39 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'standard.jar'
Nov 11, 2011 3:26:39 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/adminapp] has started
Nov 11, 2011 3:26:39 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/adminapp] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@740f5f97]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@1d4cee08]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Nov 11, 2011 3:26:40 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
Nov 11, 2011 3:26:54 PM org.apache.catalina.loader.WebappClassLoader modified
INFO:     Additional JARs have been added : 'standard.jar'
Nov 11, 2011 3:26:54 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/adminapp] has started
Nov 11, 2011 3:26:54 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/adminapp] created a ThreadLocal with key of type [org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder] (value [org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@7b1ebc46]) and a value of type [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl] (value [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@1edad6d0]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Nov 11, 2011 3:26:56 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.

的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <display-name>Document Manager</display-name>


    <context-param>
        <description>
            State saving method: "client" or "server" (= default) See
            JSF Specification 2.5.3
        </description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <description>
            Only applicable if state saving method is "server" (=
            default). Defines the amount (default = 20) of the latest
            views are stored in session.
        </description>
        <param-name>
            org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
        </param-name>
        <param-value>20</param-value>
    </context-param>
    <context-param>
        <description>
            Only applicable if state saving method is "server" (=
            default). If true (default) the state will be serialized to
            a byte stream before it is written to the session. If false
            the state will not be serialized to a byte stream.
        </description>
        <param-name>
            org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
        </param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            Only applicable if state saving method is "server" (=
            default) and if
            org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (=
            default) If true (default) the serialized state will be
            compressed before it is written to the session. If false the
            state will not be compressed.
        </description>
        <param-name>
            org.apache.myfaces.COMPRESS_STATE_IN_SESSION
        </param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            This parameter tells MyFaces if javascript code should be
            allowed in the rendered HTML output. If javascript is
            allowed, command_link anchors will have javascript code that
            submits the corresponding form. If javascript is not
            allowed, the state saving info and nested parameters will be
            added as url parameters. Default: "true"
        </description>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <description>
            If true, rendered HTML code will be formatted, so that it is
            "human readable". i.e. additional line separators and
            whitespace will be written, that do not influence the HTML
            code. Default: "true"
        </description>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            If true, a javascript function will be rendered that is able
            to restore the former vertical scroll on every request.
            Convenient feature if you have pages with long lists and you
            do not want the browser page to always jump to the top if
            you trigger a link or button action that stays on the same
            page. Default: "false"
        </description>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <description>
            Used for encrypting view state. Only relevant for client
            side state saving. See MyFaces wiki/web site documentation
            for instructions on how to configure an application for
            diffenent encryption strengths.
        </description>
        <param-name>org.apache.myfaces.SECRET</param-name>
        <param-value>NzY1NDMyMTA=</param-value>
    </context-param>

    <context-param>
        <description>
            Validate managed beans, navigation rules and ensure that
            forms are not nested.
        </description>
        <param-name>org.apache.myfaces.VALIDATE</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            A class implementing the
            org.apache.myfaces.shared.renderkit.html.util.AddResource
            interface. It is responsible to place scripts and css on the
            right position in your HTML document. Default:
            "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
            Follow the description on the MyFaces-Wiki-Performance page
            to enable StreamingAddResource instead of DefaultAddResource
            if you want to gain performance.
        </description>
        <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
        <param-value>
            org.apache.myfaces.renderkit.html.util.DefaultAddResource
        </param-value>
        <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
    </context-param>

    <context-param>
        <description>
            A very common problem in configuring
            MyFaces-web-applications is that the Extensions-Filter is
            not configured at all or improperly configured. This
            parameter will check for a properly configured
            Extensions-Filter if it is needed by the web-app. In most
            cases this check will work just fine, there might be cases
            where an internal forward will bypass the Extensions-Filter
            and the check will not work. If this is the case, you can
            disable the check by setting this parameter to false.
        </description>
        <param-name>
            org.apache.myfaces.CHECK_EXTENSIONS_FILTER
        </param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
    </context-param>
    <context-param>
        <description>
        Comma-delimited list of context-relative resource paths under which the JSF implementation
will look for application configuration resources, before loading a configuration resource
named /WEB-INF/facesconfig.xml (if such a resource exists).</description>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
        <description>
        The default suffix for extension-mapped resources that contain JSF components.
Default is '.jsp'.</description>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.jsp</param-value>
    </context-param>
    <context-param>
        <description>
        Monitors Faces JSP files for modifications and synchronizes a running server with
the changes without restarting the server. If this parameter is set to false or
removed from the deployment descriptor, any changes made to Faces JSP files may
not be seen by the server until it is restarted. This parameter is usually set
to true while the Faces JSP files are being developed and debugged in order to
improve the performance of the development environment.</description>
        <param-name>com.ibm.ws.jsf.JSP_UPDATE_CHECK</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
        Load JSF runtime when the application server starts up. If this parameter is set to false or removed,
JSF runtime will be loaded and initialized when the first JSF request is processed.
This may disable custom JSF extensions, such as factories defined in the project.</description>
        <param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name>
        <param-value>true</param-value>
    </context-param>
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>


    <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>
            org.apache.myfaces.webapp.filter.ExtensionsFilter
        </filter-class>
        <init-param>
            <description>
                Set the size limit for uploaded files. Format: 10 - 10
                bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
            </description>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
        </init-param>
        <init-param>
            <description>
                Set the threshold size - files below this limit are
                stored in memory, files above this limit are stored on
                disk.

                Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
            </description>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>
            org.apache.myfaces.webapp.StartupServletContextListener
        </listener-class>

    </listener>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <display-name>
        Apache-Axis Servlet</display-name>
        <servlet-name>AxisServlet</servlet-name>
        <servlet-class>
        org.apache.axis.transport.http.AxisServlet</servlet-class>
    </servlet>
    <servlet>
        <display-name>
        Axis Admin Servlet</display-name>
        <servlet-name>AdminServlet</servlet-name>
        <servlet-class>
        org.apache.axis.transport.http.AdminServlet</servlet-class>
        <load-on-startup>100</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>*.jws</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AdminServlet</servlet-name>
        <url-pattern>/servlet/AdminServlet</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/index.jsp</welcome-file>
        <welcome-file>/index.html</welcome-file>
    </welcome-file-list>
    <resource-ref id="IngresResourceRef">
        <description>Ingres Reference</description>
        <res-ref-name>jdbc/ingresRef</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref> 
    <resource-ref id="ResourceRef_1207169053212">
        <res-ref-name>jdbc/edbcRef</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <resource-ref>
        <description>DB2 Reference</description>
        <res-ref-name>jdbc/db2Ref</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

</web-app>

2 个答案:

答案 0 :(得分:1)

我删除了standard.jar文件并解决了问题。

答案 1 :(得分:0)

从您的日志中

严重:Web应用程序[/ adminapp]使用[org.apache.axis.utils.XMLUtils.ThreadLocalDocumentBuilder]类型的键创建了一个ThreadLocal(值[org.apache.axis.utils.XMLUtils$ThreadLocalDocumentBuilder@7446a09b])和[com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl]类型的值(值[com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@48da5bc0])但未能删除它Web应用程序已停止。这很可能会造成内存泄漏。

以某种方式阻止它正常失败。