org.apache.jasper.runtime.TldScanner未找到

时间:2015-06-24 07:15:48

标签: java spring

在我的spring项目中,我将所有外部jar导入WEB-INF / lib文件夹,之后我的项目停止编译。我不能再编译了。我正在尝试编译时出现错误。我尝试了所有的东西,但没有工作。

这是我的日志: -

Jun 24, 2015 12:38:03 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Jun 24, 2015 12:38:04 PM org.apache.catalina.startup.ContextConfig getServletContainerInitializer
SEVERE: The ServletContentInitializer [org.apache.jasper.runtime.TldScanner] could not be created
java.lang.ClassNotFoundException: org.apache.jasper.runtime.TldScanner
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1652)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
    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:5322)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Jun 24, 2015 12:38:04 PM org.apache.catalina.startup.ContextConfig processServletContainerInitializers
SEVERE: Failed to process JAR found at URL [jar:file:/home/east/workspace/jspworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/SpringFileUpload/WEB-INF/lib/javax.servlet.jsp-2.3.1-sources.jar!/] for ServletContainerInitializers for context with name [/SpringFileUpload]
Jun 24, 2015 12:38:04 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Jun 24, 2015 12:38:04 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Jun 24, 2015 12:38:04 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
Jun 24, 2015 12:38:04 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Jun 24, 2015 12:38:04 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/SpringFileUpload] startup failed due to previous errors
Jun 24, 2015 12:38:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 24, 2015 12:38:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 24, 2015 12:38:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1868 ms

我尝试了什么: -

 1.) there is no servet-api.jar in my WEB_INF/lib folder
 2.) Remove all spring jars from lib folder which i require to compile project.
 3.) Put jetty.jar in lib folder but not working.

2 个答案:

答案 0 :(得分:0)

尝试添加jetty的依赖项:

    <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>javax.servlet.jsp</artifactId>
        <version>2.2.0.v201112011158</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.orbit</groupId>
        <artifactId>org.apache.jasper.glassfish</artifactId>
        <version>2.2.2.v201112011158</version>
    </dependency>

为我工作。

答案 1 :(得分:0)

我只是将整个lib文件夹移出项目, 然后给出罐子的参考。将所需的罐子移动到web-inf / lib文件夹,之后就不会出现错误。

这可以解决错误。