1

以前のメッセージ/フォーラムで言及された多くのオプションを試しましたが、どれも機能していないようです。

この点で私を助けてください。サービスはすでに別のベンダーによってホストされているため、クライアントを作成するだけでよいことに注意してください。

問題:

Java 1.5 で Apache CXF 2.6 を使用して jboss-4.2.3GA を使用しています (ビルド ツールとして ANT を使用)。

WssUsername Token.(PasswordText) メカニズムを必要とする Web サービスがあります。

a) cxf-rt-core-2.2.7.jar,cxf-ws-addr-2.2.7.jar,cxf-rt-ws-policy-2.2.7.jar,cxf-rt-ws- security-2.2.7.jar はすべてクラスパスにあります。

b) 以下の XML もインポートしました。

<import resource="classpath:META-INF/cxf/cxf.xml"/>
  <import resource="classpath:META-INF/cxf/cxf-extension-ws-security.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-policy.xml" />  
   <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-addr.xml" />

c) 以下のようにポリシーを構成しました。

<cxf:bus>
      <cxf:features>
      <p:policies/>
         <cxf:logging/>
      </cxf:features>
      <cxf:inInterceptors>
            <ref bean="logInbound"/>
        </cxf:inInterceptors>
        <cxf:outInterceptors>
            <ref bean="logOutbound"/>
        </cxf:outInterceptors>
        <cxf:outFaultInterceptors>
            <ref bean="logOutbound"/>
        </cxf:outFaultInterceptors>
        <cxf:inFaultInterceptors>
            <ref bean="logInbound"/>
        </cxf:inFaultInterceptors>  
   </cxf:bus>


  <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
    <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>


   <jaxws:client name="{namespace of the WSDL}<name attribute of the desired wsdl:port elementname   createdFromAPI="true"> 
        <jaxws:properties>
        <entry key="ws-security.username" value="myusername"/>
        <entry key="ws-security.password" value="mypassword"/>        
        </jaxws:properties>
  </jaxws:client>

私のスタックトレース:

org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94) 
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) 
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) 
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) 
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) 
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
        at com.redhat.jboss.support.ConfigureSessionCookieValve.invoke(ConfigureSessionCookieValve.java:20) 
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) 
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
        at java.lang.Thread.run(Thread.java:595) 
Caused by: javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) 
        at $Proxy190.mymethod(Unknown Source) 
        at com.rest.test.MyClass.MyMethod(MyClass.java:123) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
        ... 33 more 
Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPolicyImpl.java:165) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyImpl.java:145) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:141) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:549) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:295) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:278) 
        at org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) 
        at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:318) 
        at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:303) 
        at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:250) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:235) 
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103) 
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) 
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:846) 
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:527) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) 
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) 
        ... 41 more 
12:14:01,513 ERROR [STDERR] Jun 20, 2012 12:14:01 PM org.apache.cxf.phase.PhaseInterceptorChain unwind 
WARNING: Exception in handleFault on interceptor org.apache.cxf.binding.xml.interceptor.XMLFaultOutInterceptor@cfdc01 
org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94) 
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) 
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) 
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) 
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) 
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
        at com.redhat.jboss.support.ConfigureSessionCookieValve.invoke(ConfigureSessionCookieValve.java:20) 
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) 
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
        at java.lang.Thread.run(Thread.java:595) 
Caused by: javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) 
        at $Proxy190.MyMethod(Unknown Source) 
        at com.rest.test.MyCass.MyMethod(MyClass.java:123) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
        ... 33 more 
Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPolicyImpl.java:165) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyImpl.java:145) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:141) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:549) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:295) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:278) 
        at org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) 
        at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:318) 
        at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:303) 
        at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:250) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:235) 
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103) 
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) 
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:846) 
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:527) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) 
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) 
        ... 41 more 
12:14:01,786 ERROR [STDERR] Jun 20, 2012 12:14:01 PM org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver onMessage 
SEVERE: Error occurred during error handling, give up! 
org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94) 
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) 
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) 
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) 
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) 
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
        at com.redhat.jboss.support.ConfigureSessionCookieValve.invoke(ConfigureSessionCookieValve.java:20) 
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) 
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
        at java.lang.Thread.run(Thread.java:595) 
Caused by: javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) 
        at $Proxy190.MyMethod(Unknown Source) 
        at com.rest.test.MyClass.MyMethod(MyClass.java:123) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
        ... 33 more 
Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPolicyImpl.java:165) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyImpl.java:145) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:141) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:549) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:295) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:278) 
        at org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) 
        at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:318) 
        at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:303) 
        at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:250) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:235) 
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103) 
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) 
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:846) 
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:527) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) 
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) 
        ... 41 more 
12:14:01,935 ERROR [[CXFServlet]] Servlet.service() for servlet CXFServlet threw exception 
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116) 
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:322) 
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) 
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) 
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) 
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) 
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
        at com.redhat.jboss.support.ConfigureSessionCookieValve.invoke(ConfigureSessionCookieValve.java:20) 
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) 
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) 
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) 
        at java.lang.Thread.run(Thread.java:595) 
Caused by: org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167) 
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) 
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94) 
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) 
        ... 28 more 
Caused by: javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) 
        at $Proxy190.MyMethod(Unknown Source) 
        at com.rest.test.MyClass.MyMethod(FirstCXF.java:123) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) 
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
        ... 33 more 
Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied. 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPolicyImpl.java:165) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.finalizeConfig(EndpointPolicyImpl.java:145) 
        at org.apache.cxf.ws.policy.EndpointPolicyImpl.initialize(EndpointPolicyImpl.java:141) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.createEndpointPolicyInfo(PolicyEngineImpl.java:549) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:295) 
        at org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:278) 
        at org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61) 
        at org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:318) 
        at org.apache.cxf.transport.http.HTTPConduit.<init>(HTTPConduit.java:303) 
        at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:250) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) 
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:235) 
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103) 
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) 
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:846) 
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:527) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) 
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) 
        at org.apache.cx
4

1 に答える 1

0

問題は、jaxws:client の名前空間とポートの詳細が間違っていることであることがわかりました。

また、ws-security タグの代わりに WSS4JOutInterceptor を使用しました。

于 2012-06-22T16:40:27.587 に答える