My application is running on java 7/ jboss 5.2. I am using drools 5.3 and loading my rules from guvnor 5.3.
Starting this morning I am getting an error loading a ChangeSet from guvnor, confirmed the application was working fine yesterday.
The changeset XML is loading fine but I believe the schema validator is trying to load the schema. Which has the XSD URL http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
This URL is returning a 301 status code and Location header of Location: https://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd.
The https url load fine in a browser but I believe the code is ignoring the redirect and trying to load the XSD from the response and throwing a org.xml.sax.SAXParseException: Premature end of file as the response body is blank.
I was able to work around the problem using -Ddrools.schema.validating=false but I could not find much documentation on this option and what it is doing.
Is there a way to get the XML parser to follow the redirect or a change I can make to guvnor to use the correct XSD?
Stack Trace:
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$1.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$1.call(Main.java:561)
10:28:16,577 ERROR [STDERR] at org.jboss.Main$1.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
The reply I got from redhat support was:
" The change was intentional, for security reasons.
Workarounds for code that doesn't understand redirects: - change the xsd reference from http to https - disable xsd validation (code specific, I believe Drools has a system property to do this) "
I disabled the validation. I have not found a way to update guvnor to change the XSD within the XML it produces, I did not really try to find it.