java吧 关注:1,262,952贴子:12,763,938

tomcat启动后work目录下为空

只看楼主收藏回复

先介绍下背景,64位的机器。本来机器里有另一个项目的32位1.6的jdk,因为那个项目的开发软件是32位的,jdk和软件都是项目组给的。
然后有另一个项目来,是正常的java项目,我就下了64位1.7的jdk,64位的myeclipse10,tomcat7,部署好之后启动tomcat后有问题,最后找到问题是因为jdk冲突了。
于是我卸了64位1.7的jdk,重装了32位的myeclipse10,换了32位的tomcat7,结果启动后访问项目还是404,我看到控制台里有一句tomcat7应该用jdk1.7,于是又换了tomcat6
最终就是32位1.6的jdk,32位myeclipse10,32位tomcat6,部署项目启动tomcat

看起来没什么问题,访问项目

还是404,并且是这样

我停掉配置在myeclipse里的tomcat,去tomcat目录里的startup启动,依然这样,看下logs目录
看时间,我启动过两次,下面两个host-manager和manager的log文件都是空,localhost的内容如下:
2016-4-19 9:10:18 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2016-4-19 9:10:18 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2016-4-19 10:14:10 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextDestroyed()
2016-4-19 10:14:10 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextDestroyed()
2016-4-19 10:14:19 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2016-4-19 10:14:19 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
catalina的内容如下:
2016-4-19 9:10:15 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.34 using APR version 1.5.1.
2016-4-19 9:10:15 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2016-4-19 9:10:16 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized with version OpenSSL 1.0.1q 3 Dec 2015
2016-4-19 9:10:17 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2016-4-19 9:10:17 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2016-4-19 9:10:17 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2384 ms
2016-4-19 9:10:17 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2016-4-19 9:10:17 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.45
2016-4-19 9:10:17 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2016-4-19 9:10:17 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2016-4-19 9:10:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2016-4-19 9:10:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2016-4-19 9:10:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory lwbase
2016-4-19 9:10:19 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2016-4-19 9:10:19 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2016-4-19 9:10:19 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2016-4-19 9:10:19 org.apache.catalina.startup.Catalina start
信息: Server startup in 2698 ms
2016-4-19 10:14:09 org.apache.coyote.http11.Http11AprProtocol pause
信息: Pausing Coyote HTTP/1.1 on http-8080
2016-4-19 10:14:09 org.apache.coyote.ajp.AjpAprProtocol pause
信息: Pausing Coyote AJP/1.3 on ajp-8009
2016-4-19 10:14:10 org.apache.catalina.core.StandardService stop
信息: Stopping service Catalina
2016-4-19 10:14:10 org.apache.coyote.http11.Http11AprProtocol destroy
信息: Stopping Coyote HTTP/1.1 on http-8080
2016-4-19 10:14:10 org.apache.coyote.ajp.AjpAprProtocol destroy
信息: Stopping Coyote AJP/1.3 on ajp-8009
2016-4-19 10:14:16 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.34 using APR version 1.5.1.
2016-4-19 10:14:16 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2016-4-19 10:14:18 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized with version OpenSSL 1.0.1q 3 Dec 2015
2016-4-19 10:14:18 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2016-4-19 10:14:18 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2016-4-19 10:14:18 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2549 ms
2016-4-19 10:14:18 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2016-4-19 10:14:18 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.45
2016-4-19 10:14:18 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2016-4-19 10:14:19 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2016-4-19 10:14:19 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2016-4-19 10:14:19 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2016-4-19 10:14:19 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory lwbase
2016-4-19 10:14:22 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2016-4-19 10:14:22 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2016-4-19 10:14:22 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2016-4-19 10:14:22 org.apache.catalina.startup.Catalina start
信息: Server startup in 3926 ms
跪求解决,为什么tomcat启动后work目录下是空啊,访问项目都是404,都好几天了还没解决


IP属地:江苏1楼2016-04-19 10:32回复
    看楼下怎么说


    2楼2016-04-19 10:34
    回复
      2025-06-06 19:42:58
      广告
      webapps目录下有东西吗??


      3楼2016-04-19 10:40
      收起回复
        是看webapp下有没有你的项目,不是看work啊


        IP属地:广东5楼2016-04-19 10:50
        收起回复
          补图,webapps里面是有东西的


          IP属地:江苏6楼2016-04-19 10:53
          回复
            4L被删了,是不是因为sever.xml里有个网址?


            IP属地:江苏7楼2016-04-19 10:55
            回复
              <?xml version='1.0' encoding='utf-8'?>
              <!--
              Licensed to the Apache Software Foundation (ASF) under one or more
              contributor license agreements. See the NOTICE file distributed with
              this work for additional information regarding copyright ownership.
              The ASF licenses this file to You under the Apache License, Version 2.0
              (the "License"); you may not use this file except in compliance with
              the License. You may obtain a copy of the License at
              Unless required by applicable law or agreed to in writing, software
              distributed under the License is distributed on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
              See the License for the specific language governing permissions and
              limitations under the License.
              -->
              <!-- Note: A "Server" is not itself a "Container", so you may not
              define subcomponents such as "Valves" at this level.
              Documentation at /docs/config/server.html
              -->
              <Server port="8005" shutdown="SHUTDOWN">
              <!--APR library loader. Documentation at /docs/apr.html -->
              <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
              <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
              <Listener className="org.apache.catalina.core.JasperListener" />
              <!-- Prevent memory leaks due to use of particular java/javax APIs-->
              <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
              <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
              <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
              <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
              <!-- Global JNDI resources
              Documentation at /docs/jndi-resources-howto.html
              -->
              <GlobalNamingResources>
              <!-- Editable user database that can also be used by
              UserDatabaseRealm to authenticate users
              -->
              <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
              </GlobalNamingResources>
              <!-- A "Service" is a collection of one or more "Connectors" that share
              a single "Container" Note: A "Service" is not itself a "Container",
              so you may not define subcomponents such as "Valves" at this level.
              Documentation at /docs/config/service.html
              -->
              <Service name="Catalina">
              <!--The connectors can use a shared executor, you can define one or more named thread pools-->
              <!--
              <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
              maxThreads="150" minSpareThreads="4"/>
              -->
              <!-- A "Connector" represents an endpoint by which requests are received
              and responses are returned. Documentation at :
              Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
              Java AJP Connector: /docs/config/ajp.html
              APR (HTTP/AJP) Connector: /docs/apr.html
              Define a non-SSL HTTP/1.1 Connector on port 8080
              -->
              <Connector port="8080" protocol="HTTP/1.1"
              connectionTimeout="20000"
              redirectPort="8443" />
              <!-- A "Connector" using the shared thread pool-->
              <!--
              <Connector executor="tomcatThreadPool"
              port="8080" protocol="HTTP/1.1"
              connectionTimeout="20000"
              redirectPort="8443" />
              -->
              <!-- Define a SSL HTTP/1.1 Connector on port 8443
              This connector uses the JSSE configuration, when using APR, the
              connector should be using the OpenSSL style configuration
              described in the APR documentation -->
              <!--
              <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
              maxThreads="150" scheme="https" secure="true"
              clientAuth="false" sslProtocol="TLS" />
              -->
              <!-- Define an AJP 1.3 Connector on port 8009 -->
              <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
              <!-- An Engine represents the entry point (within Catalina) that processes
              every request. The Engine implementation for Tomcat stand alone
              analyzes the HTTP headers included with the request, and passes them
              on to the appropriate Host (virtual host).
              Documentation at /docs/config/engine.html -->
              <!-- You should set jvmRoute to support load-balancing via AJP ie :
              <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
              -->
              <Engine name="Catalina" defaultHost="localhost">
              <!--For clustering, please take a look at documentation at:
              /docs/cluster-howto.html (simple how to)
              /docs/config/cluster.html (reference documentation) -->
              <!--
              <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
              -->
              <!-- The request dumper valve dumps useful debugging information about
              the request and response data received and sent by Tomcat.
              Documentation at: /docs/config/valve.html -->
              <!--
              <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
              -->
              <!-- This Realm uses the UserDatabase configured in the global JNDI
              resources under the key "UserDatabase". Any edits
              that are performed against this UserDatabase are immediately
              available for use by the Realm. -->
              <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
              resourceName="UserDatabase"/>
              <!-- Define the default virtual host
              Note: XML Schema validation will not work with Xerces 2.2.
              -->
              <Host name="localhost" appBase="webapps"
              unpackWARs="true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="false">
              <!-- SingleSignOn valve, share authentication between web applications
              Documentation at: /docs/config/valve.html -->
              <!--
              <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
              -->
              <!-- Access log processes all example.
              Documentation at: /docs/config/valve.html -->
              <!--
              <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
              prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
              -->
              </Host>
              </Engine>
              </Service>
              </Server>


              IP属地:江苏8楼2016-04-19 10:56
              回复
                server.xml,我把注释里的网址删了,还不行!


                IP属地:江苏9楼2016-04-19 10:57
                回复
                  2025-06-06 19:36:58
                  广告
                  server.xml


                  IP属地:江苏10楼2016-04-19 11:03
                  收起回复
                    不是看tomcat下的server.xml,是看你工作区间的


                    IP属地:广东11楼2016-04-19 11:49
                    收起回复






                      IP属地:江苏12楼2016-04-19 12:05
                      收起回复


                        IP属地:广东13楼2016-04-19 12:29
                        收起回复
                          <Context docBase="D:\apache-tomcat-7.0.68\webapps\strust2Web" path="/strust2Web" reloadable="true" source="org.eclipse.jst.jee.server:strust2Web"/>
                          我的server.xml中有这个,你的有吗?


                          IP属地:广东14楼2016-04-19 12:31
                          收起回复
                            双击servers窗口的内容。。


                            19楼2016-04-19 12:42
                            回复
                              2025-06-06 19:30:58
                              广告
                              这是myeclipse和eclipse的区别?还是版本问题?


                              IP属地:江苏20楼2016-04-19 12:44
                              收起回复