java 信息:在类路径上未检测到 Spring WebApplicationInitializer 类型(jre 1.8)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41711391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
INFO: No Spring WebApplicationInitializer types detected on classpath (jre 1.8)
提问by
I got this error message from putty:
我从腻子收到此错误消息:
Error: No Spring WebApplicationInitializer types detected on classpath.
错误:在类路径上未检测到 Spring WebApplicationInitializer 类型。
When I deploy WAR file using eclipse and maven. Right now I'm using jre 1.8 and tomcat version 7. I checked compiler and its version is 1.8. Is there any solution for this problem? I also enabled the option build automatically.
当我使用 eclipse 和 maven 部署 WAR 文件时。现在我使用的是 jre 1.8 和 tomcat 版本 7。我检查了编译器,它的版本是 1.8。这个问题有什么解决方案吗?我还启用了自动构建选项。
These are the error messages I got from putty
这些是我从腻子中得到的错误信息
17-Jan-2017 17:50:03.587 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-9485"]
17-Jan-2017 17:50:11.982 INFO [ruthhere.cafe24.com-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Jan-2017 17:50:11.989 INFO [ruthhere.cafe24.com-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
2017 年 1 月 17 日 17:50:03.587 信息 [主要] org.apache.coyote.AbstractProtocol.init 初始化 ProtocolHandler [“http-nio-9485”]
2017 年 1 月 17 日 17:50:11.982 信息 [ruthhere.cafe24.com-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 至少扫描了一个 JAR 以查找 TLD,但不包含 TLD。为该记录器启用调试日志记录以获取已扫描但未在其中找到 TLD 的 JAR 的完整列表。在扫描期间跳过不需要的 JAR 可以缩短启动时间和 JSP 编译时间。
2017 年 1 月 17 日 17:50:11.989 信息 [ruthhere.cafe24.com-startStop-1] org.apache.catalina.core.ApplicationContext.log 在类路径上未检测到 Spring WebApplicationInitializer 类型
回答by
I solved this problem just right now. The reason why I kept getting this error is because the java version I have and java version in the eclipse project property were mismatched. First, I checked the java version that I have. than opened pom.xml and changed java version so that it can match with the java version.
我刚刚解决了这个问题。我一直收到这个错误的原因是因为我拥有的java版本和eclipse项目属性中的java版本不匹配。首先,我检查了我拥有的 Java 版本。比打开 pom.xml 并更改 java 版本,以便它可以与 java 版本匹配。
<java-version>1.7</java-version>
Also, I checked window >properties > project facets and changed java version too.
另外,我检查了 window >properties > project facets 并更改了 java 版本。