[
https://issues.apache.org/activemq/browse/SM-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43851#action_43851
]
Freeman Fang commented on SM-1431:
----------------------------------
Hi Brice,
What you mean by "I don't have the interfaces for all my 3 endpoints :/"?
If I understand correctly, you have 3 endpoint under 1 service, but not each
endpoint map different interface, maybe 2 endpoint share one interface using
different binding, right?
So such two endpoints will have same servicename and interfacename, in this
case, the logic in your EndpointChoicePolicy will break.
IMHO, jbi route can't handle this kind of issue , since from the incoming
MessageExchange what we can get is the servicename and interfacename, if two
endpoints have same servicename and interfacename, we can't determain which
endpoint we should deliver message to.
One workaround so far is that you can create another service in the wsdl, put
the endpoint with same interface in different service can avoid this issue.
Btw, you can add
</sm:container>
...
<bean factory-method="getBroker" factory-bean="jbi">
<property name="defaultServiceChooser">
<bean
class="org.apache.servicemix.jbi.resolver.MatchEndpointChoicePolicy" />
</property>
</bean>
in your servicemix.xml (which is in the SERVICEMIX_HOME/conf) to specify your
favorite EndpointChoicePolicy.
Freeman
> CXF (se proxy) routing issues with same servicenames
> -----------------------------------------------------
>
> Key: SM-1431
> URL: https://issues.apache.org/activemq/browse/SM-1431
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-cxf-se
> Affects Versions: 3.3
> Environment: standalone client
> { (ESB) ======> cxf bc consumer===> cxf se (the se has proxy
> of cxf bc provider endpoint) =========> cxf bc provider(endpoint,
> endpointStd) (/ESB) }
> ===========> standalone server
> Reporter: Brice
> Assignee: Freeman Fang
> Fix For: 3.2.2, 3.3
>
> Attachments:
> 20080630-BUG-routingServiceWithSeveralInterfaces-calculatrice.zip,
> 20080630-calculator-client-and-Server.zip, FirstChoicePolicy.java
>
>
> See service mix website for the full forum discussion thread:
> http://www.nabble.com/CXF-routing-issues-with-same-servicenames-ts18157214.html
> ------------------------------------------
> Summary
> ------------------------------------------
> Hi all
> I keep working on my proxy, I have a new problem.
> I have one external service with 3 porttypes (wsdl with 3 interfaces/3
> endpoints).
> To access it, I created three internal endpoints with CXF BC provider.
> one service=myservice, interface=myinterface1, endpoint=myendpoint1
> service=myservice, interface=myinterface2, endpoint=myendpoint2
> My proxy (and so do I btw) wants to send a message to service=myservice,
> interface=myinterface2, endpoint=myendpoint2
> but in fact it goes to service=myservice, interface=myinterface1,
> endpoint=myendpoint1.
> I checked in my JaxWsClientPoroxy, and in the BindingOperationInfo oi, I have
> my service/endpoints that has a name for the endpoint (by the way it is a
> Qname, but it is my enpdpointName + my namespace).
> In the MessageExchange sent by the messagesenderInterceptor, i can see the
> tables containing the endpoint (javax.xml.ws.wsdl.port = myendpoint2)
> Then in the NMR I read the servicename, interfaceName... AND after the
> "resolveAdress", i get a WRONG endpointName (endpoint1 for example). Then the
> cxf provider reads the binding and doesn't find my operation (interface2)
> amont the interface1 operations.
> I tried to remove the "serviceName" from the proxy configuration and leave
> only the interfaceName so the interfacename will be resolved (btw why not
> adding a routing method with [servicename + interface] or just checking if
> the interface is implemented by the endpoint chosen?), but xbean.xml and its
> XSD doesn't allow to remove the service.
> I don't know what to do (except removing the 2 other endpoints but I will
> need them, and I can't change the WSDL).
> -*****************************************************************
> ******************************************************************************************
> .well I don't know yet how to create a test file, I am trying to understand
> how you do with your tests in the components.
> But I can send you my sources for SA creation and my calculator server and
> client (the libs are in my M2_REPO, see classpath).
> To see how it fails:
> Deploy the sa, launch the server then client.
> The Exception thrown speaks about java.lang.nullpointerexception
> The messsage header intercepted has those routing information:
> interface: calculatorExt
> service: calculatorExtEndpoint
> endpoint:endpointStd
> While in the xbean of my servicemix se, the proxy property requires:
> interface: calculatorExt
> service: calculatorExtEndpoint
> endpoint:endpoint
> ******************************************************************************************
> ******************************************************************************************
> Freeman Fang wrote:
> Do I understand your scenario correctly?
> standalone client ======> cxf bc consumer===> cxf se (the se has proxy
> of cxf bc provider) =========> cxf bc provider ===========> standalone
> Exactly
> standalone client ======> cxf bc consumer===> cxf se (the se has proxy
> of cxf bc provider endpoint1) =========> cxf bc provider(endpoint1,
> endpoint2) ===========> standalone
> Actually, in my files endpoint1= endpoint, and endpoint2=endpointStd
> ******************************************************************************************
> ******************************************************************************************
> Hi Brice,
> Finally, I reproduce the problem you encounter,
> I get the exception as below
> java.lang.NullPointerException
> at
> org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java:171)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:585)
>
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:536)
>
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:490)
>
> at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>
> 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:168)
> 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)
> It looks like a bug, would you please fill a jira to track it, and
> append your testcase and our mail conversation?
> Thanks
> Freeman
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.