Hi Dan,
I tried adding the reference to my web.xml, which now consists of:
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<display-name>CXFLibrary</display-name>
<description>CXF Seismic Service</description>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:META-INF/cxf/cxf.xml
classpath:META-INF/cxf/cxf-extension-soap.xml
classpath:META-INF/cxf/cxf-servlet.xml
classpath:META-INF/cxf/cxf-extension-policy.xml
classpath:META-INF/cxf/cxf-extension-ws-security.xml
classpath:META-INF/cxf/cxf-extension-http.xml
</param-value>
</context-param>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
I'm still getting the NPE, though. Should I be using another type of
configuration on the server?
- Dennis
Daniel Kulp wrote:
What does you spring application context XML look like?
This NPE is from trying to find a conduit (which it doesn't really need so I
AM fixing that) and not finding a conduit. Try adding:
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
I'm not sure if that would help as I would expect that to already be imported
via a cxf-servlet import.
I'm definitely going to fix the conduit requirement. It shouldn't be needed.
That fix should be in tonights snapshots.
Dan
On Friday 09 April 2010 4:20:15 am Dennis Sosnoski wrote:
I'm trying to use WS-SecureConversation with 2.2.7, but the server code
is throwing an NPE:
Caused by: java.lang.NullPointerException
at
org.apache.cxf.ws.security.trust.STSUtils.createSTSEndpoint(STSUtils.java:1
02) at
org.apache.cxf.ws.security.policy.interceptors.SecureConversationInIntercep
tor.recalcEffectivePolicy(SecureConversationInInterceptor.java:228)
Here's my cxf-servlet.xml configuration:
<jaxws:endpoint id="Processor"
implementor="com.sosnoski.ws.seismic.cxf.CxfSeismicImpl"
wsdlLocation="WEB-INF/wsdl/seismic-secureconv.wsdl"
address="/">
<jaxws:properties>
<entry key="ws-security.signature.properties.sct"
value="server-crypto.properties"/>
<entry key="ws-security.signature.username.sct" value="serverkey"/>
<entry key="ws-security.encryption.username.sct"
value="useReqSigCert"/>
<entry key="ws-security.callback-handler.sct"
value="com.sosnoski.ws.seismic.cxf.ServerCallback"/>
</jaxws:properties>
</jaxws:endpoint>
The request message from the client (also CXF 2.2.7) looks reasonable:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Action
xmlns="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/
2005/02/trust/RST/SCT</Action> <MessageID
xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:c439c3b9-f480-4271-af
9a-2c3f7a62e278</MessageID> <To
xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8800/cxf-seis
mic-secureconv/</To> <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:BinarySecurityToken
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap
-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-to
ken-profile-1.0#X509v3"
wsu:Id="CertId-425B29530E517E646912708010175391">MIICoDCCAgkCBEnhw2IwDQYJK
oZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAk5aMRMwEQYDVQQIEwpXZWxsaW5ndG9uMRowGAYDVQQH
ExFQYXJhcGFyYXVtdSBCZWFjaDEqMCgGA1UEChMhU29zbm9za2kgU29mdHdhcmUgQXNzb2NpYXR
lcyBMdGQuMRAwDgYDVQQLEwdVbmtub3duMRgwFgYDVQQDEw9EZW5uaXMgU29zbm9za2kwHhcNMD
kwNDEyMTAzMzA2WhcNMzYwODI3MTAzMzA2WjCBljELMAkGA1UEBhMCTloxEzARBgNVBAgTCldlb
Gxpbmd0b24xGjAYBgNVBAcTEVBhcmFwYXJhdW11IEJlYWNoMSowKAYDVQQKEyFTb3Nub3NraSBT
b2Z0d2FyZSBBc3NvY2lhdGVzIEx0ZC4xEDAOBgNVBAsTB1Vua25vd24xGDAWBgNVBAMTD0Rlbm5
pcyBTb3Nub3NraTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhOVyNK8xyxtb4DnKtU6mF9
KoiFqCk7eKoLE26+9h410CtTkxzWAfgnR+8i+LPbdsPY+yXAo6NYpCCKolXfDLe+AG2GwnMZGrI
l6+BLF3hqTmIXBFTLGUmC7A7uBTivaWgdH1w3hb33rASoVU67BVtQ3QQi99juZX4vU9o9pScocC
AwEAATANBgkqhkiG9w0BAQUFAAOBgQBMNPo1KAGbz8Jl6HGbtAcetieSJ3bEAXmv1tcjysBS67A
Xzdu1Ac+onHh2EpzBM7kuGbw+trU+AhulooPpewIQRApXP1F0KHRDcbqWjwvknS6HnomN9572gi
LGKn2601bHiRUj35hiA8aLmMUBppIRPFFAoQ0QUBCPx+m8/0n33w==</wsse:BinarySecurity
Token> <wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-utility-1.0.xsd" wsu:Id="Timestamp-1">
<wsu:Created>2010-04-09T08:16:57.307Z</wsu:Created>
<wsu:Expires>2010-04-09T08:21:57.307Z</wsu:Expires>
</wsu:Timestamp>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
Id="Signature-2">
<ds:SignedInfo>
<ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#Id-9263761">
<ds:Transforms>
<ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>xHyHcwiuIdVjkAVdE2wdcjwwXc0=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#Timestamp-1">
<ds:Transforms>
<ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>1XGyq1JxI/jDJEdX+AJnOX2I960=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>epKqUbFyYP63eWPL7f+OWGd9GjWf14tE8oBOeeRkfmFm6UvDCB5Z/G0e
YULSxCo0/MgefMLT1JiYfCaZWKV8ZdFL/rQsI2L6FnCgZPQ1NSYxbTlMAcEqkU7MQcdRg5GCQC5
xPDus6IQ1MRx8+9SGjsastyEFovDZZN29UqnMssk=</ds:SignatureValue> <ds:KeyInfo
Id="KeyId-425B29530E517E646912708010175552"> <wsse:SecurityTokenReference
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-utility-1.0.xsd" wsu:Id="STRId-425B29530E517E646912708010175583">
<wsse:Reference
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
ity-secext-1.0.xsd" URI="#CertId-425B29530E517E646912708010175391"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-tok
en-profile-1.0#X509v3" />
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</soap:Header>
<soap:Body
xmlns:wsu="http://docs.oas365is-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd" wsu:Id="Id-9263761">
<wst:RequestSecurityToken
xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:Req
uestType> <wst:Lifetime
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-utility-1.0.xsd"> <wsu:Created>2010-04-09T08:16:56.351Z</wsu:Created>
<wsu:Expires>2010-04-09T08:21:56.351Z</wsu:Expires>
</wst:Lifetime>
<wst:TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</wst:TokenType>
<wst:Entropy>
<wst:BinarySecret
Type="http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce">9+Yj65zWKiTbvMxW4d
dDN+C+9DQ8k+pa</wst:BinarySecret> </wst:Entropy>
<wst:ComputedKeyAlgorithm>http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PS
HA1</wst:ComputedKeyAlgorithm> </wst:RequestSecurityToken>
</soap:Body></soap:Envelope>
Any clues?
Thanks,
- Dennis