删除Tomcat7中的临时文件

时间:2013-03-01 07:24:09

标签: tomcat7

我在服务器上安装了tomcat7。我们里面有一个应用程序。现在应用程序崩溃了。当我们尝试登录时,没有创建会话。所以我想删除TOMCAT7主文件夹下temp内的文件。

现在我的问题,

  1. 删除临时文件夹是否安全?
  2. 删除后会有任何问题吗?
  3. 这是日志catalina.log

    `Mar 01, 2013 2:13:16 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6.
    Mar 01, 2013 2:13:16 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
    Mar 01, 2013 2:13:17 AM org.apache.catalina.core.AprLifecycleListener initializeSSL
    INFO: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012)
    Mar 01, 2013 2:13:18 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-apr-8081"]
    Mar 01, 2013 2:13:18 AM org.apache.coyote.AbstractProtocol init
    SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-8081"]
     java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:423)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
    
       Mar 01, 2013 2:13:18 AM org.apache.catalina.core.StandardService initInternal
       SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8081]]
       org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8081]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
        Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more
        Caused by: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:423)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
    ... 13 more
    
      Mar 01, 2013 2:13:18 AM org.apache.coyote.AbstractProtocol init
      INFO: Initializing ProtocolHandler ["ajp-apr-8010"]
      Mar 01, 2013 2:13:18 AM org.apache.coyote.AbstractProtocol init
      SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-apr-8010"]
       java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:423)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
    
        Mar 01, 2013 2:13:18 AM org.apache.catalina.core.StandardService initInternal
        SEVERE: Failed to initialize connector [Connector[AJP/1.3-8010]]
        org.apache.catalina.LifecycleException: Failed to initialize component        [Connector[AJP/1.3-8010]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
        Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more
        Caused by: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:423)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
    ... 13 more
    
       Mar 01, 2013 2:13:18 AM org.apache.catalina.startup.Catalina load
       INFO: Initialization processed in 2816 ms
       Mar 01, 2013 2:13:18 AM org.apache.catalina.core.StandardService startInternal
       INFO: Starting service Catalina
       Mar 01, 2013 2:13:18 AM org.apache.catalina.core.StandardEngine startInternal
       INFO: Starting Servlet Engine: Apache Tomcat/7.0.29
       Mar 01, 2013 2:13:18 AM org.apache.catalina.valves.AccessLogValve open
       SEVERE: Failed to open access log file [C:\storefront\tomcat8081\logs\localhost_access_log.2013-03-01.txt]
       java.io.FileNotFoundException: C:\storefront\tomcat8081\logs\localhost_access_log.2013-03-01.txt (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:1115)
    at   org.apache.catalina.valves.AccessLogValve.startInternal(AccessLogValve.java:1222)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at   org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:185)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1137)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    
        Mar 01, 2013 2:13:18 AM org.apache.catalina.startup.HostConfig deployWAR
        INFO: Deploying web application archive C:\storefront\tomcat8081\webapps       \storefrontAdmin.war
        Mar 01, 2013 2:13:27 AM org.apache.catalina.startup.HostConfig deployWAR
        INFO: Deploying web application archive C:\storefront\tomcat8081\webapps  \storefrontAppServer.war
        Mar 01, 2013 2:13:56 AM org.apache.catalina.startup.HostConfig deployWAR
        INFO: Deploying web application archive C:\storefront\tomcat8081\webapps\storefrontCatalog.war
        Mar 01, 2013 2:14:02 AM org.apache.catalina.startup.HostConfig deployWAR
        INFO: Deploying web application archive C:\storefront\tomcat8081\webapps \storefrontCommerceTest.war
        Mar 01, 2013 2:14:05 AM org.apache.catalina.startup.TaglibUriRule body
        INFO: TLD skipped. URI:  is already defined
        Mar 01, 2013 2:14:05 AM org.apache.catalina.startup.TaglibUriRule body
        INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
    

1 个答案:

答案 0 :(得分:0)

好像另一个应用程序正在使用该端口。如果应用程序已绑定到端口,则另一个应用程序无法使用/绑定到同一端口。检查哪个应用程序绑定到该端口。 试试这个:

netstat -ntl | grep :8080

查看已经使用8080的进程。

如果要更改Tomcat的端口,请检查目录 TOMCAT_HOME \ conf 中的文件 server.xml ,如果 8080,将提及端口地址,尝试将其更改为 8081 或其他任何内容并启动服务器并点击localhost:8081进行检查。

server.xml 中,代码如下所示:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

此外,如果您想知道哪个进程正在使用该端口,请尝试以下方法:

netstat -aon | findstr 0.0:8080

这将在最后一栏中为您提供进程ID。然后从任务管理器中找到具有该进程ID的进程,您将知道正在使用该端口的进程。