Bug 761435 - SAXParseException configuring event listeners in spring
Summary: SAXParseException configuring event listeners in spring
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Mario Fusco
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-08 10:36 UTC by Radovan Synek
Modified: 2020-04-27 01:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---


Attachments (Terms of Use)
maven web app (12.88 KB, application/zip)
2011-12-08 10:36 UTC, Radovan Synek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3437 0 Major Resolved SAXParseException configuring event listeners in spring 2015-09-14 16:57:44 UTC

Description Radovan Synek 2011-12-08 10:36:25 UTC
Created attachment 542475 [details]
maven web app

Part of my spring configuration:

<drools:ksession id="statefulSession" type="stateful" kbase="kbase1">        
           <drools:workingMemoryEventListener>
               <bean class="org.drools.event.DebugWorkingMemoryEventListener"/>
           </drools:workingMemoryEventListener>
           <drools:processEventListener>
               <bean class="org.drools.event.DebugProcessEventListener"/>
           </drools:processEventListener>         
</drools:ksession>

throws :

Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 41; cvc-complex-type.2.4.a: Invalid content was found starting with element 'drools:processEventListener'. One of '{"http://drools.org/schema/drools-spring":workingMemoryEventListener, "http://drools.org/schema/drools-spring":batch, "http://drools.org/schema/drools-spring":script, "http://drools.org/schema/drools-spring":configuration}' is expected.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:387)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:321)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:421)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3186)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1810)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:709)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)

But following configuration is OK:

<drools:ksession id="statefulSession" type="stateful" kbase="kbase1">        
           <drools:processEventListener>
               <bean class="org.drools.event.DebugProcessEventListener"/>
           </drools:processEventListener>         
</drools:ksession>

Also this configuration is OK:

<drools:ksession id="statefulSession" type="stateful" kbase="kbase1">        
           <drools:workingMemoryEventListener>
               <bean class="org.drools.event.DebugWorkingMemoryEventListener"/>
           </drools:workingMemoryEventListener>       
</drools:ksession>


Exception occurs only when both listeners are configured.

See attachment:
build as maven project, then deploy to tomcat. Exception occurs during deployment (see server log)

Comment 1 Radovan Synek 2011-12-12 15:17:18 UTC
probably because of bad position of elements; when listeners configured inside <drools:ksession> as shown above, current order required:
agendaEventListener
processEventListener
workingMemoryEventListener

but when configured through <drools:eventListeners> element and listeners attribute in <drools:ksession> element, order of event listeners does not matter. I think this is because of <xsd:all> resp. <xsd:sequence> inside drools-spring.xsd.

It would by nice to unite both styles of configuration.

Comment 2 Radovan Synek 2012-02-29 08:23:47 UTC
reproducer added to pull request:
https://github.com/droolsjbpm/droolsjbpm-integration/pull/12

Comment 3 JBoss JIRA Server 2012-03-30 10:15:41 UTC
Mario Fusco <mario.fusco> updated the status of jira JBRULES-3437 to Resolved

Comment 4 Ryan Zhang 2012-04-23 07:36:15 UTC
Update status to ON_QA. Please verify them against ER6.


Note You need to log in before you can comment on or make changes to this bug.