问题描述
我正在将Web应用程序转换为使用TomEE而不是Jboss 5.1.0,并看到以下异常:
I'm converting a web application to use TomEE instead of Jboss 5.1.0 and seeing the following exception:
ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[mlui]- Servlet.service() for servlet [mlui] in context with path [] threw exception [The absolute uri: http://www.springframework.org/spring-social/social/tags cannot be resolved in either web.xml or the jar files deployed with this application] with root cause
org.apache.jasper.JasperException: The absolute uri: http://www.springframework.org/spring-social/social/tags cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:311)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
我阅读了所有类似的问题,它们都缺少依赖项或jsp和tld文件之间的URI不匹配.但就我而言,这些都很好.这是我的taglib声明:
I read all the similar questions and they all suffer from missing dependencies or not matching URIs between jsp and tld file. But in my case these are all fine. Here is my taglib declaration:
<%@ taglib prefix="social" uri="http://www.springframework.org/spring-social/social/tags" %>
我在spring-social-web:1.1.0.RELEASE中有spring-social.tld文件,该文件位于WEB-INF \ lib下,并且具有与我的jsp文件相同的URI.如果可以帮助的话,下面是WEB-INF \ lib下与spring相关的库.
I have the spring-social.tld file in spring-social-web:1.1.0.RELEASE which is under WEB-INF\lib and it has the same URI as my jsp file. Here are the spring related libraries under WEB-INF\lib in case it can help.
spring-aop-3.2.2.RELEASE.jar
spring-beans-3.2.2.RELEASE.jar
spring-context-3.2.2.RELEASE.jar
spring-core-3.2.2.RELEASE.jar
spring-data-commons-core-1.4.0.RELEASE.jar
spring-expression-3.2.2.RELEASE.jar
spring-jdbc-3.2.2.RELEASE.jar
spring-security-config-3.1.3.RELEASE.jar
spring-security-core-3.1.3.RELEASE.jar
spring-security-crypto-3.1.3.RELEASE.jar
spring-social-config-1.1.0.RELEASE.jar
spring-social-core-1.1.0.RELEASE.jar
spring-social-facebook-1.1.1.RELEASE.jar
spring-social-instagram-1.0.1.BUILD.jar
spring-social-web-1.1.0.RELEASE.jar
spring-test-3.1.3.RELEASE.jar
spring-tx-3.2.2.RELEASE.jar
spring-web-3.2.2.RELEASE.jar
spring-webmvc-3.2.2.RELEASE.jar
推荐答案
对于感兴趣的人,我只是从jar中提取了.tld文件,并将其放在我的WEB-INF目录下,就可以解决该问题.我仍然不知道为什么TomEE放在罐子里时无法解决它.
For those who are interested, I simply extracted the .tld file from the jar and put it under my WEB-INF directory and it solved the problem. I still don't know why TomEE was unable to resolve it when it was inside the jar.
这篇关于绝对uri无法在web.xml或与此应用程序一起部署的jar文件中解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!