java.lang.NoSuchFieldError:IS_SECURITY_ENABLED [英] java.lang.NoSuchFieldError: IS_SECURITY_ENABLED

查看:1205
本文介绍了java.lang.NoSuchFieldError:IS_SECURITY_ENABLED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将服务部署到2台服务器.我在一台服务器上成功,但在另一台服务器上失败.实际上,我尽力使它们的环境相同.错误日志如下:

I want to deploy a service to 2 servers. I succeed on one server, but failed on the other one. In fact, I try my best to make their environments same. The error log is as following:

2013-01-21 22:08:18.178:WARN:oejuc.AbstractLifeCycle:FAILED jsp: java.lang.NoSuchFieldError: IS_SECURITY_ENABLED
java.lang.NoSuchFieldError: IS_SECURITY_ENABLED
    at org.apache.jasper.compiler.JspRuntimeContext.<init>(JspRuntimeContext.java:197)
    at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:150)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:492)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:312)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:776)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:258)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1213)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:36)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:491)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:138)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:142)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:53)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:604)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:535)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:398)
    at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:332)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:118)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:552)
    at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:227)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(AggregateLifeCycle.java:58)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:53)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:91)
    at org.eclipse.jetty.server.Server.doStart(Server.java:263)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1215)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.jetty.start.Main.invokeMain(Main.java:457)
    at org.eclipse.jetty.start.Main.start(Main.java:602)
    at org.eclipse.jetty.start.Main.main(Main.java:82)

感谢任何帮助.

推荐答案

java.lang.NoSuchFieldError: IS_SECURITY_ENABLED

这是Jasper JSP编译器内部类之一的一部分.该错误表明您(或Maven)出于某种原因在Webapp的/WEB-INF/lib文件夹中包含了Jasper JSP编译器JAR文件,而这些JAR文件应该已经由目标容器提供(在您的情况下为Jetty).

This is part of one of Jasper JSP compiler's internal classes. This error suggests that you (or Maven) have for some reason included the Jasper JSP compiler JAR files in webapp's /WEB-INF/lib folder while those JAR files are supposed to be already provided by the target container (which is Jetty in your case).

这样,仅当您的Web应用程序包含与目标容器具有相同版本的完全的Jasper JAR文件时,该方法才有效.但是,毕竟这不是正确的方法.这些Jasper JAR文件不属于Web应用程序的/WEB-INF/lib.它们应该已经由目标容器提供了.您需要在网络应用程序的/WEB-INF/lib中删除它们.

This way it would only work if your webapp contains Jasper JAR files of exactly the same version as the target container has. But, after all, this is not the right approach. Those Jasper JAR files do not belong in the webapp's /WEB-INF/lib. They are supposed to be already provided by the target container. You need to get rid of them in the webapp's /WEB-INF/lib.

我不是Maven英雄,但是,到目前为止,您需要告诉它不要在内置WAR的/WEB-INF/lib文件夹中包含Jasper JAR文件.您可以通过设置其依赖范围来做到这一点.到provided.

I'm no Maven hero, but, to the point, you need to tell it to not include the Jasper JAR files in the /WEB-INF/lib folder of the built WAR. You can do that by setting their dependency scope to provided.

这篇关于java.lang.NoSuchFieldError:IS_SECURITY_ENABLED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆