http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd 返回 301
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd returning 301
我的申请是 运行 java 7/ jboss 5.2。
我正在使用 drools 5.3 并从 guvnor 5.3 加载我的规则。
从今天早上开始,我在从 guvnor 加载 ChangeSet 时遇到错误,确认应用程序昨天工作正常。
变更集 XML 加载正常,但我相信模式验证器正在尝试加载模式。其中有XSDURLhttp://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
此 URL 正在返回 301 状态代码和位置 header
地点:https://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
https url 在浏览器中加载正常,但我相信代码忽略了重定向并尝试从响应中加载 XSD 并抛出 org.xml.sax.SAXParseException:过早结束文件的响应 body 为空白。
我可以使用 -Ddrools.schema.validating=false 来解决这个问题,但是我找不到很多关于这个选项及其作用的文档。
有没有办法让 XML 解析器遵循重定向或我可以对 guvnor 进行更改以使用正确的 XSD?
堆栈跟踪:
10:28:16,573 ERROR [STDERR] java.lang.RuntimeException: Unable to parse ChangeSet
10:28:16,574 ERROR [STDERR] at org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:432)
10:28:16,574 ERROR [STDERR] at XXX.interactive.rules.RuleAgentManagerGuiImpl.createKnowledgeAgent(RuleAgentManagerGuiImpl.java:192)
10:28:16,574 ERROR [STDERR] at XXX.interactive.rules.RuleAgentManagerGuiImpl.init(RuleAgentManagerGuiImpl.java:131)
10:28:16,574 ERROR [STDERR] at XXX.RuleAgentManagerGuiImpl.initialize(RuleAgentManagerGuiImpl.java:70)
10:28:16,574 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:28:16,574 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:25)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,574 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:295)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.getObject(AbstractBeanFactory.java:293)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:482)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
10:28:16,575 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
10:28:16,575 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
10:28:16,575 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:313)
10:28:16,575 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.WebModule.startModule(WebModule.java:122)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
10:28:16,575 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:28:16,575 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:25)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,575 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
10:28:16,575 ERROR [STDERR] at com.sun.proxy.$Proxy39.start(Unknown Source)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,576 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
10:28:16,576 ERROR [STDERR] at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
10:28:16,576 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:460)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
10:28:16,577 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
10:28:16,577 ERROR [STDERR] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
10:28:16,577 ERROR [STDERR] at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.boot(Main.java:229)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.call(Main.java:561)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.call(Main.java:557)
10:28:16,577 ERROR [STDERR] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
10:28:16,577 ERROR [STDERR] at java.util.concurrent.FutureTask.run(FutureTask.java:138)
10:28:16,577 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
10:28:16,578 ERROR [STDERR] Caused by: org.xml.sax.SAXParseException: Premature end of file.
10:28:16,578 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:293)
10:28:16,579 ERROR [STDERR] at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:172)
10:28:16,579 ERROR [STDERR] at org.drools.xml.XmlChangeSetReader.read(XmlChangeSetReader.java:65)
10:28:16,579 ERROR [STDERR] at org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:430)
10:28:16,579 ERROR [STDERR] ... 102 more
我不能评论所以我必须把它放在一个答案中。
我们在 Spring XML 配置文件中引用架构时遇到了同样的异常。读取文件的底层 Java 流似乎无法遵循重定向。我们的解决方案只是在 XSD URL 中使用 HTTPS 而不是 HTTP,从而避免重定向。
这让我意识到,对于生产应用程序来说,依赖这样的外部资源可能需要重新评估。
我从 redhat 支持得到的回复是:
”
出于安全原因,此更改是有意的。
不理解重定向的代码的解决方法:
- 将 xsd 引用从 http 更改为 https
- 禁用 xsd 验证(代码特定,我相信 Drools 有一个系统 属性 来执行此操作)
“
我禁用了验证。我还没有找到更新 guvnor 以更改它生成的 XML 中的 XSD 的方法,我并没有真正尝试找到它。
我的申请是 运行 java 7/ jboss 5.2。 我正在使用 drools 5.3 并从 guvnor 5.3 加载我的规则。
从今天早上开始,我在从 guvnor 加载 ChangeSet 时遇到错误,确认应用程序昨天工作正常。
变更集 XML 加载正常,但我相信模式验证器正在尝试加载模式。其中有XSDURLhttp://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
此 URL 正在返回 301 状态代码和位置 header 地点:https://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
https url 在浏览器中加载正常,但我相信代码忽略了重定向并尝试从响应中加载 XSD 并抛出 org.xml.sax.SAXParseException:过早结束文件的响应 body 为空白。
我可以使用 -Ddrools.schema.validating=false 来解决这个问题,但是我找不到很多关于这个选项及其作用的文档。
有没有办法让 XML 解析器遵循重定向或我可以对 guvnor 进行更改以使用正确的 XSD?
堆栈跟踪:
10:28:16,573 ERROR [STDERR] java.lang.RuntimeException: Unable to parse ChangeSet
10:28:16,574 ERROR [STDERR] at org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:432)
10:28:16,574 ERROR [STDERR] at XXX.interactive.rules.RuleAgentManagerGuiImpl.createKnowledgeAgent(RuleAgentManagerGuiImpl.java:192)
10:28:16,574 ERROR [STDERR] at XXX.interactive.rules.RuleAgentManagerGuiImpl.init(RuleAgentManagerGuiImpl.java:131)
10:28:16,574 ERROR [STDERR] at XXX.RuleAgentManagerGuiImpl.initialize(RuleAgentManagerGuiImpl.java:70)
10:28:16,574 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:28:16,574 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:25)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,574 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,574 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:344)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:295)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:130)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.getObject(AbstractBeanFactory.java:293)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
10:28:16,574 ERROR [STDERR] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:482)
10:28:16,575 ERROR [STDERR] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
10:28:16,575 ERROR [STDERR] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
10:28:16,575 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
10:28:16,575 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
10:28:16,575 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:313)
10:28:16,575 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.WebModule.startModule(WebModule.java:122)
10:28:16,575 ERROR [STDERR] at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
10:28:16,575 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:28:16,575 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:25)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,575 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
10:28:16,575 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
10:28:16,575 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
10:28:16,575 ERROR [STDERR] at com.sun.proxy.$Proxy39.start(Unknown Source)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
10:28:16,575 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,576 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
10:28:16,576 ERROR [STDERR] at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
10:28:16,576 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:460)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
10:28:16,576 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1193)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)
10:28:16,576 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,576 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
10:28:16,577 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
10:28:16,577 ERROR [STDERR] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
10:28:16,577 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
10:28:16,577 ERROR [STDERR] at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
10:28:16,577 ERROR [STDERR] at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.boot(Main.java:229)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.call(Main.java:561)
10:28:16,577 ERROR [STDERR] at org.jboss.Main.call(Main.java:557)
10:28:16,577 ERROR [STDERR] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
10:28:16,577 ERROR [STDERR] at java.util.concurrent.FutureTask.run(FutureTask.java:138)
10:28:16,577 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
10:28:16,578 ERROR [STDERR] Caused by: org.xml.sax.SAXParseException: Premature end of file.
10:28:16,578 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
10:28:16,578 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
10:28:16,579 ERROR [STDERR] at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:293)
10:28:16,579 ERROR [STDERR] at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:172)
10:28:16,579 ERROR [STDERR] at org.drools.xml.XmlChangeSetReader.read(XmlChangeSetReader.java:65)
10:28:16,579 ERROR [STDERR] at org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:430)
10:28:16,579 ERROR [STDERR] ... 102 more
我不能评论所以我必须把它放在一个答案中。
我们在 Spring XML 配置文件中引用架构时遇到了同样的异常。读取文件的底层 Java 流似乎无法遵循重定向。我们的解决方案只是在 XSD URL 中使用 HTTPS 而不是 HTTP,从而避免重定向。
这让我意识到,对于生产应用程序来说,依赖这样的外部资源可能需要重新评估。
我从 redhat 支持得到的回复是:
” 出于安全原因,此更改是有意的。
不理解重定向的代码的解决方法: - 将 xsd 引用从 http 更改为 https - 禁用 xsd 验证(代码特定,我相信 Drools 有一个系统 属性 来执行此操作) “
我禁用了验证。我还没有找到更新 guvnor 以更改它生成的 XML 中的 XSD 的方法,我并没有真正尝试找到它。