2017-01-30 1 views
0

org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied.org.apache.cxf.ws.policy.PolicyException: cause: cxf Bündel

Diese Ausnahme wird aufgrund des CXF-Bundles ausgelöst. Ich bin mir nicht sicher, wie ich davon wegkommen soll. Hat jemand eine Idee zu diesem Thema?

Der Service-Client funktioniert als Java-Programm, aber wenn er als Dienst im WSO2-Anwendungsserver bereitgestellt wird, löst er diese Ausnahme aus. Die Ursache im CXF-Bundle ist aber nicht sicher, wie man es vermeidet.

Exception-Trace:

WARN {org.apache.cxf.phase.PhaseInterceptorChain} - Application {http://test.tss.com/}Sync#{http://test.tss.com/}hello has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied. 
    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) 
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:213) 
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) 
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178) 
    at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:68) 
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) 
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) 
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) 
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) 
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) 
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) 
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) 
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203) 
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) 
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159) 
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) 
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) 
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 
    at 

Ich habe keine XML-Politik. Die WSDL-Datei enthält die Politik tags:

<wsp:Policy wsu:Id="BN_BN_binding_SOAP12"> 
    <saptrnbnd:OptimizedXMLTransfer xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true" /> 
    <saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true" /> 
    <wsp:ExactlyOne> 
    <wsp:All> 
     <sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"> 
      <wsp:Policy> 
       <sp:TransportToken> 
       <wsp:Policy> 
        <sp:HttpsToken> 
         <wsp:Policy> 
          <sp:HttpBasicAuthentication /> 
         </wsp:Policy> 
        </sp:HttpsToken> 
       </wsp:Policy> 
       </sp:TransportToken> 
       <sp:AlgorithmSuite> 
       <wsp:Policy> 
        <sp:Basic128Rsa15 /> 
       </wsp:Policy> 
       </sp:AlgorithmSuite> 
       <sp:Layout> 
       <wsp:Policy> 
        <sp:Strict /> 
       </wsp:Policy> 
       </sp:Layout> 
      </wsp:Policy> 
     </sp:TransportBinding> 
    </wsp:All> 
    </wsp:ExactlyOne> 
    <wsp:ExactlyOne> 
    <wsp:All> 
     <wsrmp:RMAssertion xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"> 
      <wsp:Policy /> 
     </wsrmp:RMAssertion> 
     <wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" /> 
    </wsp:All> 
    <wsp:All> 
     <wsrm:RMAssertion xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" /> 
     <wsaw:UsingAddressing xmlns:wsaw="http://schemas.xmlsoap.org/ws/2004/08/addressing" /> 
    </wsp:All> 
    </wsp:ExactlyOne> 

+0

Hallo hinzugefügt, Sie können die Richtlinie xml schreiben, dass Sie seine Struktur verwenden, um zu sehen –

+0

Hallo, ich dont jede Politik xml haben . Die WSDL enthält die Richtlinientags. Ich habe die Richtliniendetails am Ende der Ausnahme in der Beschreibung hinzugefügt –

Antwort

0

ich diese gelöst haben. Ich habe den Tag in die cxf Datei und stellen Sie die richtige Sicherheitszertifikate Muster cxf Datei

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" 
    xmlns:http="http://cxf.apache.org/transports/http/configuration" 
    xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" 
    xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core" 
    xmlns:p="http://cxf.apache.org/policy" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans      
http://www.springframework.org/schema/beans/spring-beans.xsd   
http://cxf.apache.org/jaxws          
http://cxf.apache.org/schemas/jaxws.xsd   
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd   
http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd   
http://cxf.apache.org/transports/http/configuration    
http://cxf.apache.org/schemas/configuration/http-conf.xsd   
http://cxf.apache.org/transports/http-jetty/configuration  
http://cxf.apache.org/schemas/configuration/http-jetty.xsd   
http://cxf.apache.org/configuration/security      
http://cxf.apache.org/schemas/configuration/security.xsd "> 

    <cxf:bus> 
     <cxf:features> 
      <p:policies /> 
      <cxf:logging /> 
     </cxf:features> 
    </cxf:bus> 
    <jaxws:server id="CustomerSyncService" address="/customer_sync_service"> 
     <jaxws:serviceBean> 
      <bean class="com.CustomerService" /> 
     </jaxws:serviceBean> 
    </jaxws:server> 

</beans>