Hi,
Which servicemix version are you using?
You cxf se endpoint configuration is incorrect
<cxfse:endpoint service="defbank:DefbankService"
interfaceName="pl.bpsa.smx3.services.defbank.DefbankServiceType"
pojo="#defbankServiceType" useJBIWrapper="false">
</cxfse:endpoint>
the interfaceName here should be a QName
And I didn't see your definition for the bean defbankServiceType which
you set for the pojo.
Freeman
splatch wrote:
Hello,
I created custom validation component (OASIS catalog + Spring Resource
Abstraction). Now I would like validate every query to my CXF based service
(standalone component works fine) but I don't know how to configure EIP
routes.
EIP - xbean.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:eip="http://servicemix.apache.org/eip/1.0"
xmlns:defbank="http://smx3.bpsa.pl/services/defbank"
xmlns:transform="http://smx3.bpsa.pl/services/system/transform"
xmlns:validate="http://smx3.bpsa.pl/services/system/validate"
xsi:schemaLocation="(...)">
<eip:static-routing-slip service="defbank:DefbankRoutingSlip"
endpoint="defbank-routing">
<eip:targets>
<!-- unnecessary - useJbiWrapper=false
<eip:exchange-target service="transform:JbiToSoap" />
-->
<eip:exchange-target service="validate:SchemaValidate" />
<eip:exchange-target service="defbank:DefbankService"
interface="defbank:DefbankService" />
</eip:targets>
</eip:static-routing-slip>
</beans>
CXFSE - xbean.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
xmlns:defbank="http://smx3.bpsa.pl/services/defbank"
xsi:schemaLocation="(...)">
<import resource="classpath:/services.xml" />
<cxfse:endpoint service="defbank:DefbankService"
interfaceName="pl.bpsa.smx3.services.defbank.DefbankServiceType"
pojo="#defbankServiceType" useJBIWrapper="false">
</cxfse:endpoint>
</beans>
CXFBC - xbean.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
xmlns:defbank="http://smx3.bpsa.pl/services/defbank"
xsi:schemaLocation="(...)">
<cxfbc:consumer wsdl="classpath:defbank.wsdl" useJBIWrapper="false"
targetService="defbank:DefbankRoutingSlip"
targetInterface="defbank:DefbankServiceType">
</cxfbc:consumer>
</beans>
Validator Component - servicemix.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:validate="http://smx3.bpsa.pl/services/system/validate"
xsi:schemaLocation="(...)">
<import resource="classpath:context.xml" />
<sm:serviceunit id="jbi">
<sm:activationSpecs>
<sm:activationSpec id="SchemaValidate"
endpoint="schema-validate"
componentName="CommonSchemaValidator"
service="validate:SchemaValidate">
<sm:component>
<ref bean="validator" />
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:serviceunit>
</beans>
CxfSeEndpoint:
jbiDestination.setDeliveryChannel(dc); // Line 230
if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
jbiDestination.getJBIDispatcherUtil().dispatch(exchange);
}
Result when validator was called and next steep is CXFSE execution:
2008-06-26 09:53:13 org.apache.cxf.transport.jbi.JBITransportFactory
setDeliveryChannel
INFO: configuring DeliveryChannel:
[EMAIL PROTECTED]
ERROR - CxfSeComponent - Error processing exchange InOut[
id: ID:10.40.3.63-11ac3db1095-7:1
status: Active
role: provider
interface: {http://smx3.bpsa.pl/services/defbank}DefbankService
service: {http://smx3.bpsa.pl/services/defbank}DefbankService
endpoint: DefbankServiceTypeImplPort
operation: {http://smx3.bpsa.pl/services/defbank}GetPersonByNumber
in: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:
Body><io:GetPersonByNumberRequest
xmlns:io="http://smx3.bpsa.pl/services/defbank/io">
<io:number
xmlns:io="http://smx3.bpsa.pl/services/defbank/io">somevalue</io:number>
</io:GetPersonByNumberRequest></soap:Body></soap:Envelope>
]
java.lang.NullPointerException
at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:230)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
2008-06-26 09:53:13 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
at
org.apache.servicemix.cxfbc.CxfBcConsumer$JbiPostInvokerInterceptor.handleMessage(CxfBcConsumer.java:488)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at
org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:198)
at
org.apache.servicemix.cxfbc.CxfBcConsumer.process(CxfBcConsumer.java:190)
at
org.apache.servicemix.cxfbc.CxfBcConsumer$JbiInvokerInterceptor.handleMessage(CxfBcConsumer.java:464)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:280)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:254)
at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.NullPointerException
at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:230)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)