撒克逊 XMLBeans Tomcat

发布于 2024-07-19 08:53:23 字数 4122 浏览 12 评论 0原文

我们最近更新了 Tomcat Web 服务。 我们真正更新的唯一事情是将 XMLBeans 更新到版本 2.4,将 Saxon 更新到版本 9。

运行 Netbeans 和 eclipse,我们的项目现在工作正常,但是当尝试部署到 tomcat 时,我们得到以下信息。

我们尝试将 JAXEN 更新到版本 1.1.1,但效果不佳。

有任何想法吗?

我们在部署时遇到的错误是:

java.lang.IllegalArgumentException: dom4j-core,jdom,xml-apis,xerces,junit-Extension-Name
        at java.util.jar.Attributes$Name.(Attributes.java:440)
        at java.util.jar.Attributes.getValue(Attributes.java:99)
        at org.apache.catalina.util.ManifestResource.getRequiredExtensions(ManifestResource.java:186)
        at org.apache.catalina.util.ManifestResource.processManifest(ManifestResource.java:155)
        at org.apache.catalina.util.ManifestResource.(ManifestResource.java:52)
        at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:186)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4154)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)
        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:585)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
        at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1458)
        at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:820)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:348)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)

We recently updated our Tomcat web service. The only things we really updated were that we updated XMLBeans to version 2.4 and Saxon to version 9.

Running it Netbeans and eclipse, our project now works fine, but when trying to deploy to tomcat we get the following.

We tried updating JAXEN to version 1.1.1 but no joy.

Any ideas?

The error we get in deployment is:

java.lang.IllegalArgumentException: dom4j-core,jdom,xml-apis,xerces,junit-Extension-Name
        at java.util.jar.Attributes$Name.(Attributes.java:440)
        at java.util.jar.Attributes.getValue(Attributes.java:99)
        at org.apache.catalina.util.ManifestResource.getRequiredExtensions(ManifestResource.java:186)
        at org.apache.catalina.util.ManifestResource.processManifest(ManifestResource.java:155)
        at org.apache.catalina.util.ManifestResource.(ManifestResource.java:52)
        at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:186)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4154)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220)
        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:585)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
        at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1458)
        at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:820)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:348)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

俏︾媚 2024-07-26 08:53:23

该问题是由 JAR 文件引起的,该 JAR 文件的 MANIFEST.MF 文件包含 Tomcat 不喜欢的 Extension-List 属性值。 Tomcat 期望此属性的值是以空格分隔的扩展名称列表(请参阅 ManifestResource 源),但您的 JAR 之一似乎具有逗号分隔列表 dom4j-core,jdom,xml-apis,xerces,junit 。 该列表中没有空格,因此 Tomcat 认为这都是一个大扩展名。

扩展名称还用于为清单中其他属性的名称添加前缀。 例如,以下是有效清单的一部分:

Extension-List: ant qdox commons-attributes-api javadoc
ant-Extension-Name: ant
ant-Implementation-Version: 1.5
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5.
 jar
qdox-Extension-Name: qdox
qdox-Implementation-Version: 1.5

属性名称只能包含字母、数字、连字符和下划线,因此扩展名称也必须遵循相同的规则。 带有逗号的扩展名显然是无效的,这就是您收到上述异常的原因。

我查看了官方 JAR 文件规范,但这似乎没有说明这些扩展名称应如何分隔。

我无法说出哪个 JAR 在其清单中具有此逗号分隔的 Extension-List 属性。 不过,我会首先检查最新版本的 XMLBeans 和 Saxon 中的 JAR 文件。 如果您的项目在升级之前可以正常运行,那么问题很可能是由最近发生的更改引起的。

当然,修复方法是编辑有问题的清单文件,在其 Extension-List 属性中使用空格而不是逗号。

祝你好运!

The problem is being caused by a JAR file whose MANIFEST.MF file contains a value for the Extension-List attribute that Tomcat doesn't like. Tomcat expects this attribute's value to be a space-separated list of extension names (see the ManifestResource source), but it appears one of your JARs has the comma-separated list dom4j-core,jdom,xml-apis,xerces,junit instead. There are no spaces in this list, so Tomcat thinks it's all one big extension name.

Extension names are also used to prefix names of further attributes within the manifest. For example, here's part of a valid manifest:

Extension-List: ant qdox commons-attributes-api javadoc
ant-Extension-Name: ant
ant-Implementation-Version: 1.5
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5.
 jar
qdox-Extension-Name: qdox
qdox-Implementation-Version: 1.5

Attribute names can only contain letters, numbers, hyphens and underscores, and so extension names must also follow the same rules. An extension name with a comma in it is clearly not valid, and this is why you are getting the exception above.

I've had a look at the official JAR file specification, but that appears not to state how these extension names should be delimited.

I can't say which JAR has this comma-separated Extension-List attribute in its manifest. However, I would check the JAR files within the latest versions of XMLBeans and Saxon first. If your project worked before the upgrade, then it's likely that the problem has been caused by something that has changed recently.

The fix is of course to edit the offending manifest file to use spaces instead of commas in its Extension-List attribute.

Good luck!

回忆躺在深渊里 2024-07-26 08:53:23

删除应用程序 lib 目录中的 jaxen-1.1-beta-2.jar 并将其替换为 jaxen-1.1.6.jar 对我有用。 jaxen-1.1-beta-2.jar 在其 MANIFEST.MF 文件中具有扩展列表 dom4j-core,jdom,xml-apis,xerces,junit。
参考:https://www.twblogs.net/a/5b8833f42b71775d1cdaf884

Deleting jaxen-1.1-beta-2.jar in the lib directory of the application and replace it with jaxen-1.1.6.jar worked for me. jaxen-1.1-beta-2.jar has the Extension list dom4j-core,jdom,xml-apis,xerces,junit in its MANIFEST.MF file.
Reference: https://www.twblogs.net/a/5b8833f42b71775d1cdaf884

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文