无法从Eclipse将Web应用程序部署到tomcat

时间:2014-09-09 04:47:15

标签: java eclipse tomcat java-ee

我正在尝试将网络应用部署到tomcat,但却遇到了下一个错误

    INFO: validateJarFile(C:\Users\Denis.Belykh\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\IBRSWebTomcatWAR\WEB-INF\lib\javaee-api-6.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
    сен 09, 2014 11:03:42 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
               INFO: validateJarFile(C:\Users\Denis.Belykh\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\IBRSWebTomcatWAR\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
    сен 09, 2014 11:03:48 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
    java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:530)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:512)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4907)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

我找到了下一个解决方案 - 添加范围"提供"对于pom.xml中的依赖项

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

但我没有任何pom.xml文件,因为我没有在我的项目中使用maven!

我解决了这个问题。我正在使用两个包含alredy部署的jar的库。但该应用程序仍然无法正常工作。现在我有404错误,这个

    сен 09, 2014 12:35:14 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:\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Java/jre7/bin/client;C:/Java/jre7/bin;C:/Java/jre7/lib/i386;D:\app\Denis.Belykh\product\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\eclipse;;.
сен 09, 2014 12:35:14 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:IBRSWebTomcatWAR' did not find a matching property.
сен 09, 2014 12:35:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
сен 09, 2014 12:35:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
сен 09, 2014 12:35:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 632 ms
сен 09, 2014 12:35:15 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
сен 09, 2014 12:35:15 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.55
сен 09, 2014 12:35:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\docs
сен 09, 2014 12:35:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\docs has finished in 368 ms
сен 09, 2014 12:35:23 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\examples
сен 09, 2014 12:35:24 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
сен 09, 2014 12:35:24 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
сен 09, 2014 12:35:24 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@171ac12')
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\examples has finished in 570 ms
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\host-manager
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\host-manager has finished in 336 ms
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\manager
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\manager has finished in 310 ms
сен 09, 2014 12:35:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.55\webapps\ROOT
сен 09, 2014 12:35:25 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.55\webapps\ROOT has finished in 285 ms
сен 09, 2014 12:35:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
сен 09, 2014 12:35:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
сен 09, 2014 12:35:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 10016 ms 

我甚至无法在这里看到项目的部署(IBRSWebTomcatWAR)/

1 个答案:

答案 0 :(得分:0)

解决方案太简单了:我使用了胜利&#34; web&#34;用于在我的项目中查找Web内容而不是WEB-CONTENT目录。这很明显,不是吗? :)