Maven使用tomcat7运行报错:Unable to determine URL for WEB-INF/classes

在pom.xml中的配置如下:

<build>
        <finalName>maven_demo_webfinalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.tomcat.mavengroupId>
                    <artifactId>tomcat7-maven-pluginartifactId>
                    <version>2.0-beta-1version>
                    <configuration>
                        <url>http://localhost:8080/manager/texturl>
                        <server>tomcatserver>
                    configuration>
                plugin>
            plugins>
        pluginManagement>
    build>

点击tomcat7:run 之后:报错了:

Unable to determine URL for WEB-INF/classes
七月 07, 2017 3:07:29 下午 org.apache.catalina.startup.ContextConfig webConfig
严重: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
    at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
    at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
    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)

七月 07, 2017 3:07:30 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]

*后来在over stackflow上找到了解决办法:
这实际上是Tomcat 7.0.25中的一个错误,并在Tomcat 7.0.26中修复。另见第52511号。请注意,您只需继续使用您的Web应用程序!这个日志纯粹是非正式的,不会阻止Tomcat启动和运行。这是由于Tomcat扫描注释类的方式发生变化。当您的Eclipse项目中没有任何类时,此堆栈跟踪将被打印,因此/WEB-INF/classes保持为空。
升级到Tomcat 7.0.26将会隐藏这个日志。您也可以完全忽略它,并像往常一样继续使用Tomcat。
根据意见,*

你可能感兴趣的:(maven)