The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

ESB-Harry (5) [Avatar] Offline
#1
Could you please post an example how to use the validation?

Do i have to call it e.g. from a pipeline?
After validating the XML, where can i define a target?

Thank you
tijs.rademakers (494) [Avatar] Offline
#2
Re: ServiceMix-Validation
Hi,

I've posted an example about how to use the servicemix validation component a month ago, see:

http://www.manning-sandbox.com/thread.jspa?messageID=78367𓈟

In fact, it works quite similar to the validation example that's included in the book in chapter 5. This example uses the validation lightweight component, but the servicemix validation JBI component is about the same configuration. Let me know if you need more info.

Best regards,

Tijs
ESB-Harry (5) [Avatar] Offline
#3
Re: ServiceMix-Validation
Hi Tijs,

i did it exactly that way.
I replaced the lightweight container with the new validation component.

<validation:endpoint service="esb:newValidation" >
endpoint="newValidationEndpoint"
schemaResource="classpath:order.xsd"
handlingErrorMethod="FAULT_FLOW">

<property name="errorHandlerFactory">
<bean class="org.apache.servicemix.validation.handler.MessageAggregatingErrorHandlerFactory">
<property name="rootPath" value="Fault/payload/messages"/>
<property name="namespace" value="http://www.servicemix.org/fault"/>
<property name="includeStackTraces" value="false"/>
</bean>
</property>
</validation:endpoint>

Then i copied and customized the ErrorHandlerComponent.java with
..
Destination destination = client.createDestination(
"service:http://esbinaction.com/examples/newValidation");
...

Fault message below is returned:

java.lang.NoSuchMethodError: org.apache.servicemix.client.ServiceMixClient.createDestination(Ljava/lang/StringsmilieLorg/apache/servic
emix/client/Destination;
at ps.component.ErrorHandlerComponent.onMessageExchange(ErrorHandlerComponent.java:30)
at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:226)
at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:212)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:16smilie
at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:90smilie
at java.lang.Thread.run(Thread.java:619)

I call the ErrorHandlerComponent right after receiving the message at the JMS queue.

Could it be, that there is an error with in-only and in-out message?
How can i fix it?

Thanks

Best regards

Harry
ESB-Harry (5) [Avatar] Offline
#4
Re: ServiceMix-Validation
Hi,

doesn´t work yet.

There is a problem creating the client in the ErrorHandlingComponent.

Could it be that this Component (Example for servicemix-3.2.1) doesn´t work in servicemix-3.3?

First i developed on 3.2.1 and now i am switching to 3.3 to use the validation component.

Thanks

Regards

Harry