IDEA无法运行SpringMVC项目,提示No TLD files were found in
2017年12月27日 01:08更新
我刚刚误解了一个IDEA的设置项:
我以为这是“浏览器默认打开这个网址”的意思,结果是给项目加前缀,导致一直404,但是我还是很好奇我问的问题的答案,希望有朋友愿意帮我解答,谢谢。
原问题如下:
小弟刚从Eclipse转战到IDEA平台,可以说是诸事不顺。
尝试用IDEA编写一个简单的SpringMVC例子,但是一直无法正常运行,在几经奋战之下,已经跳过几个坑,比如JDK版本冲突问题,比如libraries未勾选上等问题。
但是还是无法顺利的完成,在Google与baidu的搜索之下,也没有找到合适的资料,所以希望能够借助各位的帮助。
说了这么多,错误信息贴出来:
[2017-12-27 12:22:01,098] Artifact myProjectName:war exploded: Artifact is being deployed, please wait...
27-Dec-2017 00:22:02.541 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/assets/css/].
27-Dec-2017 00:22:02.541 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/assets/js/].
27-Dec-2017 00:22:02.542 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/assets/images/].
27-Dec-2017 00:22:02.543 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/assets/].
27-Dec-2017 00:22:02.543 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/views/].
27-Dec-2017 00:22:02.543 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanResourcePaths No TLD files were found in resource path [/WEB-INF/].
27-Dec-2017 00:22:02.546 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/logkit-1.0.1.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.547 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/c3p0-0.9.5.2.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.548 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-tx-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.549 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-dao-2.0.8.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.549 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/avalon-framework-4.1.3.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.550 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-beans-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.552 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-web-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.555 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/mybatis-3.4.5.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.556 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-jdbc-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.558 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-core-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.558 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-jcl-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.560 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/mchange-commons-java-0.2.11.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.561 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-expression-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.586 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan TLD files were found in JAR [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-webmvc-5.0.1.RELEASE.jar].
27-Dec-2017 00:22:02.587 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/aopalliance-1.0.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.587 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/gson-2.8.2.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.588 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/mysql-connector-java-6.0.6.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.590 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-context-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.591 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-aop-5.0.1.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.591 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/fastjson-1.2.43.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.592 详细 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/mybatis-spring-1.3.1.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
27-Dec-2017 00:22:02.593 信息 [RMI TCP Connection(3)-127.0.0.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.
备注一点:同样的配置,在Eclipse中可以完美运行(包含几个主要的配置文件,以及共用的Maven,Tomcat等)
如果可以,小弟还想问一下,如何让IDEA像Eclipse一样在运行时显示更多关于Spring容器的日志呢?比如是否加载某个配置文件,还有IDEA的运行目录能不能不要那么非主流?直接放在Tomcat的webapps下面呢?
感谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
先回答你误解的那个设置:
这里其实没有什么好解释,字面意思就很显然是配置上下文地址的,至于你以为的“浏览器默认打开这个网址”是这个:
你可以参考这里,也许能解决你的问题。
https://my.oschina.net/fdblog...
你觉得少,首先可能是你项目自身日志配置的问题,详细的日志,例如log4j、slf4j等等请自行网上了解。
这里给出spring官方文档说明:https://docs.spring.io/spring...
还有一种可能是在这里:
以前我也用eclipse,用了IDEA就再也回不去了,不是IDEA非主流,是你没习惯。
如果坑实在太多,最简单的办法就是你在IDEA新建一个空的maven工程,再把以前的代码一个个copy过来,这样出问题的可能性会小很多。
首先需要明确一点,项目构建是否使用了Maven?
从项目使用了lib目录感觉不是
/E:/IDEA/myProjectName/target/myProjectName/WEB-INF/lib/spring-webmvc-5.0.1.RELEASE.jar
在idea中web资源的目录是
web
文件夹,如果是eclipse项目web资源的目录则是WebRoot
,点击Module中项目下的web进行更改,改为WebRoot
即可。这两个地方都需要更改。在idea中部署的都是Artifacts。在第4步添加web模块的时候,添加完成后,对话框右下角是有提示创建Artifact的,选择创建即可;这里我们手动创建
如果需要热加载需要更改
On Update action
和On frame deactivatioin
为Update classes and resources
Tomcat依赖的JDK版本和启动也有较大关系。
部署项目,添加后给项目配置
Application context
路径,只能有一个/
路径如果项目中使用了
Servlet
等 API,如果lib中没有相关依赖,我们要添加Tomcat依赖到项目中关于Tomcat运行目录的问题:
这里有三个目录
因为Tomcat部署的都是Artifact,所以就是
Artifacts Out directory
这个路径。你看一个这个路径,就知道了。会把项目中编译好的资源拷贝到这个路径下。在第一次运行的时候,idea也会拷贝的,至于热加载配置,在前文也提到了。第一次回答问题,希望可以帮到你。