tomcat/lib的罐子在运行时未识别
为了准备更新我的JDK,我想删除servlet-api
,jsp-api
和el-api
jars中的jars > java_home/jre/lib/ext 目录,而是将它们添加到classPath,如推荐。
我试图通过提供提供的范围添加这些依赖项来做到这一点。
但是,当我(本地)部署Web应用程序时,我仍然会得到一个classNotFoundException
,我认为这是由3个缺少的JARS引起的(当我将它们包含在旧的JDK位置中时,此例外消失了) 。
java.lang.classnotfoundexception: javax.servlet.jsp.tagext.bodytagsupport
i double检查以确保为项目定义了J2EE ClassPath。从我的理解来看,该应用程序应在运行时从我的服务器容器(Tomcat)中访问3罐。实际上,看来此类路径的定义很好:
j2ee.platform.classpath
j2ee.server.home
在我的项目属性文件中都定义了。
另外,据我所知,我并不是在Web-Inf/lib
中加入这些罐子中的任何一个,所以我认为这也不是引起问题的原因。我确实将罐子定义为依赖项,但我给他们提供提供的
范围,每个jar的版本如下所示: https://tomcat.apache.org/whichversion.html (用于TOMCAT版本8.0.43)。
我正在NetBeans上使用ANT
构建应用程序。
还有关于为什么在运行时未识别这些JAR文件的其他建议?
In preparation for updating my JDK, I would like to remove the servlet-api
, jsp-api
and el-api
jars from the JAVA_HOME/jre/lib/ext
directory and instead add them to the classpath as is recommended.
I attempt to do this by adding these dependencies with the provided scope.
However, when I deploy my web application (locally), I still get a ClassNotFoundException
, which I think is caused by the 3 missing jars (when I include them in the old jdk location, this exception disappears).
java.lang.ClassNotFoundException:
javax.servlet.jsp.tagext.BodyTagSupport
I double checked to make sure that the j2ee classpath is well defined for the project. From my understanding, the application should have access to the 3 jars from my server container (Tomcat) at runtime. Indeed, it seems that this classpath was well defined:
j2ee.platform.classpath
j2ee.server.home
are both defined in my project properties file.
Also, as far as I know I'm not including any of these jars in WEB-INF/lib
so I don't think that's what's causing the issue either. I do define the jars as dependencies but I give them the provided
scope, with versions for each jar as dictated by this chart: https://tomcat.apache.org/whichversion.html (for Tomcat version 8.0.43).
I'm building the application with ant
on Netbeans.
Are there any other suggestions for why these jar files are not recognized at runtime?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我启动该项目时,我笨拙地将一些依赖罐放在
java-home/jre/lib/ext
中。去除这些罐子解决了问题。他们的依赖项与他们捆绑在一起,其中包括
jsp-api.jar
或servlet-api.jar
。When I had started the project, I clumsily placed some dependency jars in
JAVA-HOME/jre/lib/ext
.Removing these jars solved the issue. They had dependencies bundled with them that included
jsp-api.jar
orservlet-api.jar
.