You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by zacwolfe <za...@safisystems.com> on 2010/08/29 21:08:34 UTC

Problem with modified simple example quartz.xml

Hi,

I'm trying to get the simple quartz.xml example working with a jobDetail
section as follows:

<camel:camelContext>
		<camel:route>
			<camel:from
uri="jbi:endpoint:http://servicemix.apache.org/examples/camel/receiver/endpoint"
/>
			<camel:to uri="log:test" />
		</camel:route>
	</camel:camelContext>

	<quartz:endpoint service="b:service" endpoint="endpoint"
targetService="b:receiver">
		<quartz:jobDetail>
			<quartz:jobDetail name="myJobName" group="myJobGroup">
				<quartz:jobDataAsMap>
					<quartz:property key="xml">
						<![CDATA[
						<hello>world</hello>
						]]>
					</quartz:property>
				</quartz:jobDataAsMap>
			</quartz:jobDetail>
		</quartz:jobDetail>
		<quartz:trigger>
			<quartz:simple repeatCount="500" repeatInterval="1000" startDelay="2000"
/>
		</quartz:trigger>
	</quartz:endpoint>

	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

Everything is the same except for the jobDetail section I added. While the
example works fine without the jobDetail, I get the following error with the
jobDetail section included:

Exception in thread "SpringOsgiExtenderThread-73"
java.lang.IllegalStateException: BeanFactory not initialized or already
closed - call 'refresh' before accessing beans via the ApplicationContext 
				at
org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextExecutor.java:345)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.fail(DependencyWaiterApplicationContextExecutor.java:401)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:287)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
        at
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
        at java.lang.Thread.run(Thread.java:619)

Calling log:display-exception at the console reveals:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
29 in XML document from URL
[bundleentry://232.fwk28441588/META-INF/spring/quartz_test.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: cvc-compl
ex-type.2.4.a: Invalid content was found starting with element
'quartz:property'. One of
'{WC[##other:"http://servicemix.apache.org/quartz/1.0"]}' is expected.
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
        at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
        at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
        at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
        at
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'quartz:property'. One of
'{WC[##other:"http://servicemix.apache.org/quartz/1.0"]}' is expected.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)

        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1805)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
        ... 18 more

It's an XSD validation error but I don't see anything wrong with the XML. 
Any guidance here is appreciated.

Thanks,
Zac
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Problem-with-modified-simple-example-quartz-xml-tp2796105p2796105.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Problem with modified simple example quartz.xml

Posted by zacwolfe <za...@safisystems.com>.
Thanks Gert,

I've raised a JIRA issue for this: 
https://issues.apache.org/activemq/browse/SMXCOMP-794 SMXCOMP-794 
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Problem-with-modified-simple-example-quartz-xml-tp2796105p2798342.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Problem with modified simple example quartz.xml

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

According to the schema, this element only allows for child elements
belonging to another namespace.  The <quartz:jobDetail> belongs to the
same namespace, so that's why you get the exception.

The code snippet you showed us earlier is correct, so it looks like
there's a problem with the generated XSD here.  Could you raise a JIRA
issue for this so we can get it fixed?

In the meanwhile, as a workaround, you should be able to use
<bean class="org.apache.servicemix.quartz.support.JobDetailBean">
instead of the custom quartz tag to define your quartz job.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



On 30 August 2010 22:22, zacwolfe <za...@safisystems.com> wrote:
>
> Can anyone please help me with this issue?  I don't understand why I'm
> getting a schema validation error when the schema should allow any content:
>
> <xs:element name='jobDataAsMap' minOccurs='0' maxOccurs='1'>
>          <xs:complexType>
>            <xs:sequence minOccurs='0' maxOccurs='unbounded'><xs:any
> namespace='##other'/></xs:sequence>
>          </xs:complexType>
>        </xs:element>
>
> According to all the examples I've seen my <quartz:jobDetail> tag is
> correct. Any ideas?
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Problem-with-modified-simple-example-quartz-xml-tp2796105p2797312.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Re: Problem with modified simple example quartz.xml

Posted by zacwolfe <za...@safisystems.com>.
Can anyone please help me with this issue?  I don't understand why I'm
getting a schema validation error when the schema should allow any content:

<xs:element name='jobDataAsMap' minOccurs='0' maxOccurs='1'>
          <xs:complexType>
            <xs:sequence minOccurs='0' maxOccurs='unbounded'><xs:any
namespace='##other'/></xs:sequence>
          </xs:complexType>
        </xs:element>

According to all the examples I've seen my <quartz:jobDetail> tag is
correct. Any ideas?
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Problem-with-modified-simple-example-quartz-xml-tp2796105p2797312.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.