Announcement Announcement Module
Collapse
No announcement yet.
xml message marshalling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • xml message marshalling

    I am receiving the following exception when trying to marshal xml messages from a JMS queue. From what I can find online there appears to be a threading issue with the parser, but I have not found a way to deal with it in SI. Any ideas?


    Code:
    <int:channel id="dataFeedV1InChannel"/>
    <int:channel id="dataFeedV1AggregatorChannel"/>
    	
    <int:transformer input-channel="dataFeedV1InChannel" output-channel="dataFeedV1AggregatorChannel">
    	<bean class="org.springframework.integration.xml.transformer.UnmarshallingTransformer">
    		<constructor-arg>
    			<bean class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller">
    				<property name="validating" value="false" />
                                    <property name="xmlOptions" ref="xmlOptions"/>
    			</bean>
    		</constructor-arg>
    	</bean>
    </int:transformer>
    
    	<bean id="xmlOptions" class="org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean">
    		<property name="options">
    			<map>
    				<entry key="LOAD_USE_XMLREADER" value-ref="xmlReader"/>
    			</map>
    		</property>
    	</bean>
    	
    	<bean id="xmlReader" class="org.xml.sax.helpers.XMLReaderFactory" factory-method="createXMLReader"/>

    Code:
    2012-05-28 11:32:35,500  WARN (AbstractMessageListenerContainer.java:694) - Execution of JMS message listener failed, and no ErrorHandler has been set.
    org.springframework.integration.transformer.MessageTransformationException: failed to transform message
    	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
    	at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:67)
    	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:98)
    	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
    	at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
    	at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
    	at org.springframework.integration.core.MessagingTemplate.convertAndSend(MessagingTemplate.java:189)
    	at org.springframework.integration.gateway.MessagingGatewaySupport.send(MessagingGatewaySupport.java:183)
    	at org.springframework.integration.jms.ChannelPublishingJmsMessageListener$GatewayDelegate.send(ChannelPublishingJmsMessageListener.java:424)
    	at org.springframework.integration.jms.ChannelPublishingJmsMessageListener.onMessage(ChannelPublishingJmsMessageListener.java:278)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
    	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.oxm.UnmarshallingFailureException: XMLBeans unmarshalling exception; nested exception is org.apache.xmlbeans.XmlException: error: FWK005 parse may not be called while parsing.
    	at org.springframework.oxm.xmlbeans.XmlBeansMarshaller.convertXmlBeansException(XmlBeansMarshaller.java:308)
    	at org.springframework.oxm.xmlbeans.XmlBeansMarshaller.unmarshalReader(XmlBeansMarshaller.java:208)
    	at org.springframework.oxm.support.AbstractMarshaller.unmarshalStreamSource(AbstractMarshaller.java:371)
    	at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:134)
    	at org.springframework.integration.xml.transformer.UnmarshallingTransformer.transformPayload(UnmarshallingTransformer.java:107)
    	at org.springframework.integration.transformer.AbstractPayloadTransformer.doTransform(AbstractPayloadTransformer.java:33)
    	at org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:33)
    	... 22 more
    Caused by: org.apache.xmlbeans.XmlException: error: FWK005 parse may not be called while parsing.
    	at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3494)
    	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1329)
    	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1316)
    	at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:360)
    	at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:740)
    	at org.springframework.oxm.xmlbeans.XmlBeansMarshaller.unmarshalReader(XmlBeansMarshaller.java:203)
    	... 27 more
    Caused by: org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1245)
    	at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3454)
    	... 32 more

  • #2
    seems to be somewhat related to the issue described at the link below. Is there some config change necessary on the DMLC needed for multiple threads to parse jms messages containing XML?

    http://prystash.blogspot.com/2012/01...ed-fwk005.html

    Code:
    <int-jms:message-driven-channel-adapter channel="dataFeedV1InChannel" container="dataFeedV1ListenerContainer"/>	
    	<bean id="dataFeedV1ListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" >
    		<property name="concurrentConsumers"         value="5" />
    		<property name="maxConcurrentConsumers"      value="15" />
    		<property name="connectionFactory"           ref="connectionFactory" />
    		<property name="destinationName"             value="DATAFEED.V1" />
    		<property name="sessionTransacted" 	     value="true" />
    		<property name="destinationResolver"         ref="destinationResolver" />
    		<property name="cacheLevelName"              value="CACHE_NONE" />
    		<property name="acceptMessagesWhileStopping" value="false" />
    		<property name="recoveryInterval"            value="3000" />
    	</bean>

    Comment

    Working...
    X