撒克逊XMLBeans Tomcat [英] Saxon XMLBeans Tomcat

查看:93
本文介绍了撒克逊XMLBeans Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近更新了Tomcat Web服务.我们真正更新的唯一一件事就是将XMLBeans更新为版本2.4,将Saxon更新为版本9.

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.

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

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

我们尝试将JAXEN更新到1.1.1版,但没有任何乐趣.

We tried updating JAXEN to version 1.1.1 but no joy.

有什么想法吗?

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

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)

推荐答案

此问题是由JAR文件引起的,该文件的MANIFEST.MF文件包含Tomcat不喜欢的Extension-List属性的值. Tomcat希望此属性的值是扩展名的空格分隔列表(请参见

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.

我看过官方的 JAR文件规范,但似乎并未说明应如何分隔这些扩展名.

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

我不能说哪个JAR在清单中具有此逗号分隔的Extension-List属性.但是,我将首先检查XMLBeans和Saxon的最新版本中的JAR文件.如果您的项目在升级之前就可以正常工作,则说明问题可能是由最近发生的变化引起的.

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.

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

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

祝你好运!

这篇关于撒克逊XMLBeans Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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