简体   繁体   English

如何部署tomcat7-maven-plugin?

[英]How to deploy tomcat7-maven-plugin?

I want to deploy a project using maven tomcat7:deploy. 我想使用maven tomcat7:deploy部署项目。 I am using maven 3.3.9, apache tomcat 7, OS X. 我正在使用maven 3.3.9,apache tomcat 7,OSX。

I set the user and password in tomcat-users.xml, and in Maven settings.xml set the password and user. 我在tomcat-users.xml中设置了用户和密码,在Maven settings.xml中设置了密码和用户。

And I got this error message: 我得到了这个错误信息:

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/springAngularjs]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)

        .
        .
        .
        .

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/springAngularjs]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 6 more
Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
        .
        .
        .
        .
Apr 17, 2016 2:31:32 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        .
        .
        . 

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    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.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] -----------------------------------------------------------------------
        [ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project springAngularjs: Could not start Tomcat: Failed to start component [StandardServer[-1]]: Failed to start component [StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]: A child container failed during start -> [Help 1]
        [ERROR] 
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer

means that you've built an environment with two copies of spring-web: one inside your webapp, and one outside, and something is passing an object from one to the other. 意味着您已经建立了一个环境,其中包含两个spring-web副本:一个在webapp中,一个在外部,并且某些东西将对象从一个传递到另一个。 This probably means that you need to get rid of the copy from inside your webapp so that it inherits the classes from outside. 这可能意味着您需要摆脱Web应用程序内部的副本,以便它从外部继承类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 pom.xml 中配置“tomcat7-maven-plugin”? - How to configure “tomcat7-maven-plugin” in pom.xml? 远程服务器上的tomcat7-maven-plugin contextFile - tomcat7-maven-plugin contextFile on remote server 在tomcat7-maven-plugin中定义上下文元素 - Define context elements in tomcat7-maven-plugin 通过 tomcat7-maven-plugin 部署不断添加“/deploy?path”到目标路径 - Deployment via tomcat7-maven-plugin keeps adding “/deploy?path” to the target path 使用tomcat7-maven-plugin的Tomcat部署失败,并显示错误“无法调用Tomcat管理器:对等重置连接:套接字写入错误” - Tomcat deploy using tomcat7-maven-plugin fails with error “Cannot invoke Tomcat manager: Connection reset by peer: socket write error” 如何运行tomcat7-maven-plugin,该服务器代码更改将立即更新 - How to run tomcat7-maven-plugin, that server code changes will be updated immediately 使用tomcat7-maven-plugin设置已部署战争的名称 - Set the name of deployed war with tomcat7-maven-plugin 重新加载在Eclipse中编辑的JSP,并使用tomcat7-maven-plugin运行 - Reloading JSPs edited in Eclipse, run with tomcat7-maven-plugin 使用tomcat7-maven-plugin指定要打包的目录 - Specifying which directory to package using tomcat7-maven-plugin Maven在使用tomcat7-maven-plugin时找不到tomcat7目标 - Maven cannot find tomcat7 goal while using tomcat7-maven-plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM