I just remembered, to get it to work I modified SocketFactoryFactory to use
SunJSSESocketFactory as the default:
AxisProperties.setClassDefault(SecureSocketFactory.class,
"org.apache.axis.components.net.SunJSSESocketFactory");
I tried copying this line of code into my app and executing it there, but it
wouldn't compile. I'm sure there is a right way to change this default
without modifying any source, but I haven't investigated it thoroughly.
If you make the above change (or the equivalent), your app might get
farther, but throw a new exception to the effect that SunJSSESocketFactory
doesn't implement org.apache.axis.components.net.SecureSocketFactory.
That one can be fixed by adding the necessary "implements" declaration in
SunJSSESocketFactory.java. I reported this as a bug and I believe it has
been fixed in the nightly builds.
-----Original Message-----
From: Norris Merritt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 1:36 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Please help: Error when using https (re-send)
Oh, sorry. I got Axis working with JSSE prior to upgrading to JDK 1.4, so I
went through a couple of things like modifying java.security, etc.
I would recommend stepping into SecurityFactoryFactory in a debugger to see
what happens in there and why it returns null.
-----Original Message-----
From: Juzer Kothambawala [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:59 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Please help: Error when using https (re-send)
Thanks Norris, I am absolutely aware about the genesis of this exception.
But may be I did not emphasize correctly as to why this is happening. Since
JSSE library is now part JDK1.4 and the fact I have another program that
works correctly using the JSSE library, but does not use Axis, I failure
the cause may be in the Axis code. But you are absolutely right that it
should throw more meaningful exception.
Thanks.
At 12:13 PM 1/23/2003 -0800, Norris Merritt wrote:
>Hi Juzer, Use the source, Luke! :-) The stack trace shows that getSocket is
>blowing up on a null pointer exception. Looking at source code for
>HttpSender.getSocket, it has to be because the
>SocketFactoryFactory.getFactory returned null, and getSocket fails to check
>for null and blithely calls factory.create:
>
> /**
> * Creates a socket connection to the SOAP server
> *
> * @param protocol "http" for standard, "https" for ssl.
> * @param host host name
> * @param port port to connect to
> * @param otherHeaders buffer for storing additional headers that need
>to be sent
> * @param useFullURL flag to indicate if the complete URL has to be
sent
> *
> * @return the socket
> *
> * @throws IOException
> */
> private Socket getSocket(
> String protocol,
> String host, int port, StringBuffer otherHeaders,
BooleanHolder
>useFullURL)
> throws Exception {
> SocketFactory factory = SocketFactoryFactory.getFactory(protocol,
>getOptions());
> return factory.create(host, port, otherHeaders, useFullURL);
> }
>
>Looking at the code in SocketFactoryFactory.java, it must be that the
>following line of code which tries to create the factory is failing:
>
>theFactory = (SecureSocketFactory)
> AxisProperties.newInstance(SecureSocketFactory.class,
>classes, objects);
>
>This could be a missing .jar file or some aspect of JSSE configuration that
>is wrong (I assume you are trying to use Sun JSSE?)
>
>Its fair to say that getSocket is broken, it should throw a better
exception
>than NullPointerException. It should throw some sort of exeception such as
>"SocketFactoryFactory returned null!" You can report this bug using
>Bugzilla.
>
>-----Original Message-----
>From: Juzer Kothambawala [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 23, 2003 9:43 AM
>To: [EMAIL PROTECTED]
>Subject: Please help: Error when using https (re-send)
>
>
>Hi Folks,
>
>I am not able to successfully execute the samples/userguide/example3 web
>service using https. I am using the axis-1_1beta release with JDK1.4 and
>tomcat 4.1. The client is configured with correct trust store system
>properties i.e. "javax.net.ssl.trustStore" and
>"javax.net.ssl.trustStorePassword".The web service is invoked as follows:
>java samples.userguide.example3.Client
>-lhttps://jsk-dev/axis/services/MyService "Hello World"
>
>The following exception is thrown at the client end:
>
>AxisFault
>faultCode:
>{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>faultSubcode:
>faultString: java.lang.NullPointerException
>faultActor: null
>faultNode: null
>faultDetail:
>stackTrace: java.lang.NullPointerException
>at
>org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:172)
>at
>org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:115)
>at
>org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java
:
>71)
>
>at
>org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
>at
>org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
>at
>org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
>at
>org.apache.axis.client.Call.invokeEngine(Call.java:2376)
>at org.apache.axis.client.Call.invoke(Call.java:2365)
>at org.apache.axis.client.Call.invoke(Call.java:2062)
>at org.apache.axis.client.Call.invoke(Call.java:1986)
>at org.apache.axis.client.Call.invoke(Call.java:1509)
>at
>samples.userguide.example3.Client.main(Client.java:107)
>
>java.lang.NullPointerException
>at
>org.apache.axis.AxisFault.makeFault(AxisFault.java:127)
>at
>org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:132)
>at
>org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java
:
>71)
>
>at
>org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
>at
>org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
>at
>org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
>at
>org.apache.axis.client.Call.invokeEngine(Call.java:2376)
>at org.apache.axis.client.Call.invoke(Call.java:2365)
>at org.apache.axis.client.Call.invoke(Call.java:2062)
>at org.apache.axis.client.Call.invoke(Call.java:1986)
>at org.apache.axis.client.Call.invoke(Call.java:1509)
>at
>samples.userguide.example3.Client.main(Client.java:107)
>Caused by: java.lang.NullPointerException
>at
>org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:172)
>at
>org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:115)
>... 10 more
>
>It looks like it is failing much before the SSL handshake. I would greatly
>appreciate if somebody can point what I am doing wrong or is there a
>problem with the axis code?
>
>Thanks.
>
>Juzer Kothambawala
>Global Commerce Technology Group
>AIM: juzersk
>Phone: (408) 525-0814
>Email: [EMAIL PROTECTED]
Juzer Kothambawala
Global Commerce Technology Group
AIM: juzersk
Phone: (408) 525-0814
Email: [EMAIL PROTECTED]