Hi,

I'm running CXF 2.7.11 and tried to disable the policy engine as suggested
with:

<cxf:bus>
  <cxf:features>
        <p:policies enabled="false" />
  </cxf:features>
</cxf:bus>

and with

<p:engine enabled="false" ignoreUnknownAssertions="false" />

I added necessary namespace and xsd references and beans.xml validates
properly.
When I run the application I get a NullPointerException in:
org.apache.cxf.transport.http.HTTPConduit at line 314:

    private void updateClientPolicy() {
        PolicyDataEngine policyEngine =
bus.getExtension(PolicyDataEngine.class);
        if (policyEngine != null && endpointInfo.getService() != null) {
-->            clientSidePolicy =
policyEngine.getClientEndpointPolicy(endpointInfo, 
                                                                    this,
new ClientPolicyCalculator());
        }
    }

The policyEngine is not null, so the call propagates and a NPE is produced
in:

Caused by: java.lang.NullPointerException
        at
org.apache.cxf.ws.policy.EndpointPolicyImpl.chooseAlternative(EndpointPolicyImpl.java:161)
        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:550)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.getEndpointPolicy(PolicyEngineImpl.java:296)
        at
org.apache.cxf.ws.policy.PolicyEngineImpl.getClientEndpointPolicy(PolicyEngineImpl.java:279)
        at
org.apache.cxf.ws.policy.PolicyDataEngineImpl.getClientEndpointPolicy(PolicyDataEngineImpl.java:61)
        at
org.apache.cxf.transport.http.HTTPConduit.updateClientPolicy(HTTPConduit.java:314)

no alternative is in fact available since I can't manage the policies which
are defined in a weird SAP WSDL.
I need to be able to skip policies.
If I try to execute a call from SoapUI everything works without problems.
The same seems to happen to a colleague of mine using Axis2.

Someone can help me?
Thank you in advance for your time.

Luca





--
View this message in context: 
http://cxf.547215.n5.nabble.com/org-apache-cxf-ws-policy-PolicyException-These-policy-alternatives-can-not-be-satisfied-tp5740898p5745709.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to