Hi Aaron,
Thank you for your helpful note. I implemented a custom
SecureProtocolSocketFactory, which was very straighforward. I unit-tested it
to be creating connections alright. Then I plug it into my Axis2 client
code, and I start seeing NullPointerExceptions coming from the stubs
(WSDL2Java generated). I am still trying to figure out why with DEBUG and
SSL trace options enabled. But it doesn't seem to be directly related to
connection creation. Here is the snippet of the logs when I try to invoke an
operation named "getProxyNumber".
It is printing to debug (not as errors) that providers BC and JuiCE could
not be added. I am not sure if they are required, as the same client works
just fine without my custom factory.
Have you seen anything like this before? Any helpful pointers are sincerely
appreciated.
Thanks,
Mahesh
----------------
DEBUG - Handler RequestURIBasedDispatcher added to Phase Transport
DEBUG - Handler SOAPActionBasedDispatcher added to Phase Transport
DEBUG - Handler AddressingBasedDispatcher added to Phase Dispatch
DEBUG - Handler SOAPMessageBodyBasedDispatcher added to Phase Dispatch
DEBUG - Handler InstanceDispatcher added to Phase Dispatch
DEBUG - Handler RequestURIBasedDispatcher added to Phase Dispatch
DEBUG - Handler SOAPActionBasedDispatcher added to Phase Dispatch
DEBUG - Handler AddressingBasedDispatcher added to Phase Dispatch
DEBUG - Handler SOAPMessageBodyBasedDispatcher added to Phase Dispatch
DEBUG - Handler InstanceDispatcher added to Phase Dispatch
DEBUG - START_DOCUMENT:
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - Build the OMElelment HeaderBy the StaxSOAPModelBuilder
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - START_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - Build the OMElelment BodyBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - Build the OMElelment getProxyNumberBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - Build the OMElelment in0By the StaxSOAPModelBuilder
DEBUG - CHARACTERS: [370000000000002]
DEBUG - END_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - END_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - END_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - Build the OMElelment HeaderBy the StaxSOAPModelBuilder
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - START_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - Build the OMElelment BodyBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - Build the OMElelment getProxyNumberBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - Build the OMElelment in0By the StaxSOAPModelBuilder
DEBUG - CHARACTERS: [370000000000002]
DEBUG - END_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - END_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - END_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - Canonicalizer.register(
http://www.w3.org/TR/2001/REC-xml-c14n-20010315,
org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments
)
DEBUG - Canonicalizer.register(
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments,
org.apache.xml.security.c14n.implementations.Canonicalizer20010315WithComments
)
DEBUG - Canonicalizer.register(http://www.w3.org/2001/10/xml-exc-c14n#,
org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclOmitComments
)
DEBUG - Canonicalizer.register(
http://www.w3.org/2001/10/xml-exc-c14n#WithComments,
org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclWithComments
)
DEBUG - Transform.register(http://www.w3.org/2000/09/xmldsig#base64,
org.apache.xml.security.transforms.implementations.TransformBase64Decode)
DEBUG - Transform.register(http://www.w3.org/TR/2001/REC-xml-c14n-20010315,
org.apache.xml.security.transforms.implementations.TransformC14N)
DEBUG - Transform.register(
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments,
org.apache.xml.security.transforms.implementations.TransformC14NWithComments
)
DEBUG - Transform.register(http://www.w3.org/2001/10/xml-exc-c14n#,
org.apache.xml.security.transforms.implementations.TransformC14NExclusive)
DEBUG - Transform.register(
http://www.w3.org/2001/10/xml-exc-c14n#WithComments,
org.apache.xml.security.transforms.implementations.TransformC14NExclusiveWithComments
)
DEBUG - Transform.register(http://www.w3.org/TR/1999/REC-xpath-19991116,
org.apache.xml.security.transforms.implementations.TransformXPath)
DEBUG - Transform.register(
http://www.w3.org/2000/09/xmldsig#enveloped-signature,
org.apache.xml.security.transforms.implementations.TransformEnvelopedSignature
)
DEBUG - Transform.register(http://www.w3.org/TR/1999/REC-xslt-19991116,
org.apache.xml.security.transforms.implementations.TransformXSLT)
DEBUG - Transform.register(http://www.w3.org/2002/04/xmldsig-filter2,
org.apache.xml.security.transforms.implementations.TransformXPath2Filter)
DEBUG - Transform.register(http://www.w3.org/2002/06/xmldsig-filter2,
org.apache.xml.security.transforms.implementations.TransformXPath2Filter)
DEBUG - Init() called
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2000/09/xmldsig#dsa-sha1,
org.apache.xml.security.algorithms.implementations.SignatureDSA)
DEBUG - Try to register http://www.w3.org/2000/09/xmldsig#dsa-sha1
org.apache.xml.security.algorithms.implementations.SignatureDSA
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2000/09/xmldsig#rsa-sha1,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA1
)
DEBUG - Try to register http://www.w3.org/2000/09/xmldsig#rsa-sha1
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA1
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2000/09/xmldsig#hmac-sha1,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA1
)
DEBUG - Try to register http://www.w3.org/2000/09/xmldsig#hmac-sha1
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA1
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#rsa-md5,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSAMD5
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#rsa-md5
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSAMD5
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSARIPEMD160
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSARIPEMD160
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#rsa-sha256,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA256
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA256
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#rsa-sha384,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA384
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#rsa-sha384
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA384
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#rsa-sha512,
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA512
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#rsa-sha512
org.apache.xml.security.algorithms.implementations.SignatureBaseRSA$SignatureRSASHA512
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#hmac-md5,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacMD5
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#hmac-md5
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacMD5
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacRIPEMD160
)
DEBUG - Try to register
http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacRIPEMD160
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#hmac-sha256,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA256
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#hmac-sha256
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA256
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#hmac-sha384,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA384
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#hmac-sha384
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA384
DEBUG - SignatureAlgorithm.register(
http://www.w3.org/2001/04/xmldsig-more#hmac-sha512,
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA512
)
DEBUG - Try to register http://www.w3.org/2001/04/xmldsig-more#hmac-sha512
org.apache.xml.security.algorithms.implementations.IntegrityHmac$IntegrityHmacSHA512
DEBUG - Register Resolver:
org.apache.xml.security.utils.resolver.implementations.ResolverDirectHTTP: A
simple resolver for requests to HTTP space
DEBUG - Register Resolver:
org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem:
A simple resolver for requests to the local file system
DEBUG - Register Resolver:
org.apache.xml.security.utils.resolver.implementations.ResolverFragment: A
simple resolver for requests of same-document URIs
DEBUG - Register Resolver:
org.apache.xml.security.utils.resolver.implementations.ResolverXPointer: A
simple resolver for requests of XPointer fragents
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.RSAKeyValueResolver:
Can extract RSA public keys
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.DSAKeyValueResolver:
Can extract DSA public keys
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.X509CertificateResolver:
Can extract public keys from X509 certificates
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.X509SKIResolver:
Uses an X509v3 SubjectKeyIdentifier extension to retrieve a certificate from
the storages
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.RetrievalMethodResolver:
Resolves keys and certificates using ResourceResolvers
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.X509SubjectNameResolver:
Uses an X509 SubjectName to retrieve a certificate from the storages
DEBUG - Register Resolver:
org.apache.xml.security.keys.keyresolver.implementations.X509IssuerSerialResolver:
Uses an X509 IssuerName and IssuerSerial to retrieve a certificate from the
storages
DEBUG - Now I try to bind prefixes:
DEBUG - Now I try to bind ds to http://www.w3.org/2000/09/xmldsig#
DEBUG - Now I try to bind xenc to http://www.w3.org/2001/04/xmlenc#
DEBUG - Now I try to bind experimental to
http://www.xmlsecurity.org/experimental#
DEBUG - Now I try to bind dsig-xpath-old to
http://www.w3.org/2002/04/xmldsig-filter2
DEBUG - Now I try to bind dsig-xpath to
http://www.w3.org/2002/06/xmldsig-filter2
DEBUG - Now I try to bind ec to http://www.w3.org/2001/10/xml-exc-c14n#
DEBUG - Now I try to bind xx to
http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter
DEBUG - XX_init 160 ms
DEBUG - XX_prng 0 ms
DEBUG - XX_parsing 20 ms
DEBUG - XX_configure_i18n 20 ms
DEBUG - XX_configure_reg_c14n 20 ms
DEBUG - XX_configure_reg_jcemapper 0 ms
DEBUG - XX_configure_reg_keyInfo 10 ms
DEBUG - XX_configure_reg_keyResolver 20 ms
DEBUG - XX_configure_reg_prefixes 0 ms
DEBUG - XX_configure_reg_resourceresolver 10 ms
DEBUG - XX_configure_reg_sigalgos 40 ms
DEBUG - XX_configure_reg_transforms 20 ms
DEBUG - The provider BC could not be added:
org.bouncycastle.jce.provider.BouncyCastleProvider
DEBUG - The provider JuiCE could not be added:
org.apache.security.juice.provider.JuiCEProviderOpenSSL
DEBUG - Begin add username token...
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - Starting to process SOAP 1.1 message
DEBUG - Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - Build the OMElelment HeaderBy the StaxSOAPModelBuilder
DEBUG - CHARACTERS: [
]
DEBUG - START_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security:Security
DEBUG - Build the OMElelment SecurityBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken:UsernameToken
DEBUG - Build the OMElelment UsernameTokenBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Username:Username
DEBUG - Build the OMElelment UsernameBy the StaxSOAPModelBuilder
DEBUG - CHARACTERS: [mrach267]
DEBUG - END_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Username:Username
DEBUG - START_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Password:Password
DEBUG - Build the OMElelment PasswordBy the StaxSOAPModelBuilder
DEBUG - CHARACTERS: []
DEBUG - END_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Password:Password
DEBUG - END_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken:UsernameToken
DEBUG - END_ELEMENT: {
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security:Security
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Header:Header
DEBUG - START_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - Build the OMElelment BodyBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - Build the OMElelment getProxyNumberBy the StaxSOAPModelBuilder
DEBUG - START_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - Build the OMElelment in0By the StaxSOAPModelBuilder
DEBUG - CHARACTERS: [370000000000002]
DEBUG - END_ELEMENT: {http://cc.proxy.mydomain.com}in0:in0
DEBUG - END_ELEMENT: {
http://cc.proxy.mydomain.com}getProxyNumber:getProxyNumber
DEBUG - END_ELEMENT: {http://schemas.xmlsoap.org/soap/envelope/}Body:Body
DEBUG - END_ELEMENT: {
http://schemas.xmlsoap.org/soap/envelope/}Envelope:Envelope
DEBUG - Checking pre-condition for Phase "OperationOutPhase"
DEBUG - Invoking phase "OperationOutPhase"
DEBUG - Checking post-conditions for phase "OperationOutPhase"
DEBUG - Checking pre-condition for Phase "PolicyDetermination"
DEBUG - Invoking phase "PolicyDetermination"
DEBUG - Checking post-conditions for phase "PolicyDetermination"
DEBUG - Checking pre-condition for Phase "MessageOut"
DEBUG - Invoking phase "MessageOut"
DEBUG - Checking post-conditions for phase "MessageOut"
DEBUG - Java version: 1.4.2_12
DEBUG - Java vendor: Sun Microsystems Inc.
DEBUG - Java class path: <edited out>
DEBUG - Operating system name: Windows XP
DEBUG - Operating system architecture: x86
DEBUG - Operating system version: 5.1
DEBUG - SUN 1.42: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5
digests; SecureRandom; X.509 certificates; JKS keystore; PKIX
CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
DEBUG - SunJSSE 1.42: Sun JSSE provider(implements RSA Signatures, PKCS12,
SunX509 key/trust factories, SSLv3, TLSv1)
DEBUG - SunRsaSign 1.42: SUN's provider for RSA signatures
DEBUG - SunJCE 1.42: SunJCE Provider (implements DES, Triple DES, AES,
Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
DEBUG - SunJGSS 1.0: Sun (Kerberos v5)
DEBUG - Set parameter http.useragent = Jakarta Commons-HttpClient/3.0
DEBUG - Set parameter http.protocol.version = HTTP/1.1
DEBUG - Set parameter http.connection-manager.class = class
org.apache.commons.httpclient.SimpleHttpConnectionManager
DEBUG - Set parameter http.protocol.cookie-policy = rfc2109
DEBUG - Set parameter http.protocol.element-charset = US-ASCII
DEBUG - Set parameter http.protocol.content-charset = ISO-8859-1
DEBUG - Set parameter http.method.retry-handler =
[EMAIL PROTECTED]
DEBUG - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss
zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy
HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE
dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss
z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy
HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
DEBUG - Set parameter http.socket.timeout = 60000
DEBUG - Set parameter http.connection.timeout = 60000
DEBUG - enter PostMethod.clearRequestBody()
DEBUG - enter EntityEnclosingMethod.clearRequestBody()
DEBUG - enter HttpClient.executeMethod(HostConfiguration,HttpMethod)
DEBUG - enter HttpClient.executeMethod
(HostConfiguration,HttpMethod,HttpState)
DEBUG - Attempt number 1 to process request
DEBUG - enter HttpConnection.open()
DEBUG - Open connection to server.mydomain.com:443
DEBUG - enter HttpConnection.releaseConnection()
DEBUG - Releasing connection back to connection manager.
ERROR - getProxyNumber: java.lang.NullPointerException
ERROR - getProxyNumber: java.lang.NullPointerException