SpringMVC启动tomcat出现Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run异常

 SpringMVC启动tomcat出现Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run异常_第1张图片

异常:Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project SpringMVC_start: 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]

原因:子容器在启动期间失败

查看pom.xml配置

依赖:

        
            javax.servlet
            servlet-api
            2.5

        
        
            javax.servlet
            jsp-api
            2.0

        

插件:

    
        SpringMVC_start
        
            



                
                    org.apache.tomcat.maven
                    tomcat7-maven-plugin
                    2.2
                    
                        80
                    
                

                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    
                        9
                        9
                        UTF-8
                    
                
            
        
    

 

可能原因:

①servlet及jsp导致与maven集成的tomcat的servlet及jsp冲突(不过有个疑问:我尝试没加scope使用maven集成的tomcat启动却能成功,而用tomcat7启动却有异常)

解决方法:将代码中的servlet及jsp的scope注释放开即能用tomcat7启动

 

②可能是jdk版本的关系(具体解决方式自行百度)

你可能感兴趣的:(Java程序设计--笔记,tomcat,maven,spring)