4 Replies Latest reply on Nov 10, 2011 4:55 AM by paul.robinson

    JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied

    sudeval

      My app need consume a web service on an Glassfish, but when calling the method (searchMethod) get the error "None of the policy alternatives can be satisfied.".

      The webservice client classes are imported as jar-archive in the my app.

      I use Jboss AS 7.0.1, my app  hasn´t lib of Spring or CXF (it´s necessary ?).

       

      How do I solve this problem ?

       

      links:

      http://community.jboss.org/message/519968

      JBossWS - Meter is descontinued and hasn´t version compatible with JBoss AS 7 (http://community.jboss.org/en/jbossws/metro).

       

      Trace:

       

      19:25:39,438 INFO  [org.apache.cxf.service.facto

      ry.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-3) Creating Service {http://my.company.domain.project.ws/}SearchSomethingService from WSDL: http://my.company.host/SearchSomethingService/SearchSomething?wsdl
      19:25:48,523 WARN [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] (http--0.0.0.0-8080-3) No assertion builder for type {http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAlwaysCapability registered.
      19:25:48,523 WARN [org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl] (http--0.0.0.0-8080-3) No assertion builder for type {http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAssertion registered.
      19:25:48,695 WARN [org.apache.cxf.phase.PhaseInterceptorChain] (http--0.0.0.0-8080-3) Interceptor for {http://my.company.domain.project.ws/}SearchSomethingService#{http://my.company.domain.project.ws/}searchMethod has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: None of the policy alternatives can be satisfied.
         at org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:47)
         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
         at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:510)
         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343)
         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:295)
         at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
         at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
         at $Proxy149.searchMethod(Unknown Source)    at my.company.domain.project.web.action.SomethingAction.loadSomething(SomethingAction.java:276) [classes:7.0.1.Final]
         at my.company.domain.project.web.action.SomethingAction$Proxy$_$$_WeldClientProxy.loadSomething(SomethingAction$Proxy$_$$_WeldClientProxy.java) [classes:7.0.1.Final]
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_27]
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_27]
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_27]
         at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_27]
         at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
         at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
         at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2477) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
         at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
         at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2050) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:287) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:293) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
         at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:670) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
         at org.jboss.seam.faces.environment.SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.publishEvent(SeamApplicationWrapper$Proxy$_$$_WeldClientProxy.java) [seam-faces-3.0.2.Final.jar:7.0.1.Final]
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.2.1.jar:7.0.1.Final]
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
         at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
         at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
         at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
      Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied.
         at org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:152)
         at org.apache.cxf.ws.policy.EffectivePolicyImpl.initialise(EffectivePolicyImpl.java:88)
         at org.apache.cxf.ws.policy.PolicyEngineImpl.getEffectiveClientRequestPolicy(PolicyEngineImpl.java:196)
         at org.apache.cxf.ws.policy.PolicyOutInterceptor.handle(PolicyOutInterceptor.java:111)
         at org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:45)
         ... 54 more

        • 1. Re: JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied
          asoldano

          The error message basically tells that the server contract is requesting the client to use some policies, however the client is not able to satisfy all needs. In particular, here the server seems to be enforcing the use of WS-At which Apache CXF does not implement.

          You might want to try having your client consume a modified wsdl contract not having the WS-AT requirements and see if the server is still able to accept the requests.

           

          Btw, JBoss actually has support for WS-At afaik, but that's provided by the JBoss XTS project. We should probably understand if/how we can add ws-policy support for WS-AT in the JBossWS-CXF integration.

          • 2. Re: JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied
            paul.robinson

            Tiago,

             

            Could you provide me with a copy of the WSDL?

             

            I assume there is a wsat:ATAssertion present in the WSDL with optional=false. Hence the reason for the Exception. By beginning a WS-AT transaction on the Client and using the XTS client side interceptor, the TX context will flow with the application soap message and hopefully be accepted by the policy assertion. I think this is what you will need to do to consume the service as, I assume,  the service is mandating a WS-AT transaction for a reason.

             

            JBoss AS does support WS-AT through the XTS project. We have a demo application and some good documentation that you can follow. See here for more details: http://www.jboss.org/jbosstm. AS 7 comes with XTS, but you need to specify the standalone-xts.xml configuration to enable it. XTS currently adds too much delay to the boot time, so is disabled by default.

             

            However, it looks like its the CXF client soap stack that is objecting to the wsat:ATAssertion. We may need to extend CXF or create a feature request to solve this problem. I'll investigate further and get back to you.

             

            You should try what Alessio suggests, but bear in mind that the service invocation may not be successful. It's likely that the service will make the assumption that it is being invoked in a WS-AT transaction. Totally reasonable given that any invocations without a TX context should be blocked by the policy assertion. The service will likely try to enlist participants in a null transaction which will cause a failure.

             

            Paul.

            • 3. Re: JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied
              sudeval

              Alessio and Paul,

               

              The service it´s an project of the my company and the responsable modified the WSDL for me, because it was not necessary use WS-AT (was inserted with an generate).

               

              Problem solved, thank for your help

               

               

              old wsdl:

               

              <definitions targetNamespace="http://my.company.domain.project.ws/" name="SearchMethodService">

               

              <ns1:Policy wsu:Id="SearchSomethingPortBinding_searchMethod_WSAT_Policy">

                         <ns1:ExactlyOne>

                                  <ns1:All>

                                        <ns2:ATAlwaysCapability/>

                                        <ns3:ATAssertion ns1:Optional="true" ns4:Optional="true"/>

                                  </ns1:All>

                          </ns1:ExactlyOne>

              </ns1:Policy>

               

              (....)

              <binding name="SearchSomethingPortBinding" type="tns:SearchSomething">

                        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>

                        <operation name="searchMethod">

                             <ns5:PolicyReference URI="#SearchSomethingBinding_searchMethod_WSAT_Policy"/>

                             <soap:operation soapAction=""/>

                             <input>

                                  <soap:body use="literal"/>

                             </input>

                             <output>

                                  <soap:body use="literal"/>

                             </output>

                        </operation>

              </binding>

               

              *The new WSDL hasn´t policy WS-AT.

              • 4. Re: JBoss AS 7 - Call Glassfish WS - None of the policy alternatives can be satisfied
                paul.robinson

                Your welcome,

                 

                Glad you have solved the probem. You've also highlighted a potential issue, that we need to look into. Thanks for your input.

                 

                Paul.