Got it working myself finally.
Removed the Java_OPS property settings in the Tomact setenv.bat
Rather in my servlet:
private static final String TRUST_STORE =
"/WEB-INF/certificates/XXXProdTrustStore.jks";
private static final String KEY_STORE =
"/WEB-INF/certificates/XXXProdKeyStore.jks";
private static final String CERTIFICATE_PASSWORD = "XXXX";
private static final String PROXY_HOST = "10.64.XX.XXX";
private static final String PROXY_PORT = "80XX";
..
System.setProperty("javax.net.ssl.trustStorePassword",
CERTIFICATE_PASSWORD);
System.setProperty("javax.net.ssl.trustStore",
context.getRealPath(TRUST_STORE));
System.setProperty("javax.net.ssl.keyStore",
context.getRealPath(KEY_STORE));
System.setProperty("javax.net.ssl.keyStorePassword",
CERTIFICATE_PASSWORD);
System.setProperty("https.proxyHost", PROXY_HOST);
System.setProperty("https.proxyPort", PROXY_PORT);
On Wed, Sep 17, 2014 at 8:15 PM, Suleman Butt <[email protected]>
wrote:
> Hi all,
>
> I am trying to call a webservices, which is hosted on a remote server and
> is exposed through an https endpoint.
>
> My client is an application hosted on my local tomcat
> <http://www.coderanch.com/how-to/java/TomcatFaq>, and in my tomcat's
> setenv.bat, I have set the following properties:
>
> echo setting JAVA OPTS for certificates
> set "JAVA_OPTS= -Dhttps.proxyHost=10.64.X.XXX -Dhttps.proxyPort=8080
> -Djavax.net.ssl.trustStore=%CATALINA_HOME%/certificateStore/XXXProdTrustStore.jks
> -Djavax.net.ssl.trustStorePassword=XXX -Djavax.net.ssl.trustStoreType=JKS
> -Djavax.net.ssl.keyStore=%CATALINA_HOME%/certificateStore/XXXProdKeyStore.pfx
> -Djavax.net.ssl.keyStorePassword=XXX -Djavax.net.ssl.keyStoreType=pkcs12
> -Djava.security.debug=all
> -Dorg.apache.ws.security.crypto.merlin.file=%CATALINA_HOME%/certificateStore/XXXProdKeyStore.jks
> %JAVA_OPTS%"
>
> NOTE: I have generated the XXXProdTrustStore.jks, XXXProdKeyStore.pfx and
> XXXProdKeyStore.jks through supplier's provided certificate. From supplier,
> i mean the company hosting the webservice.
>
> On my calling the service, I get the following error:
>
> view plain
> <http://www.coderanch.com/t/639681/Tomcat/javax-net-ssl-SSLException-SSLException#>
> print
> <http://www.coderanch.com/t/639681/Tomcat/javax-net-ssl-SSLException-SSLException#>
> ?
> <http://www.coderanch.com/t/639681/Tomcat/javax-net-ssl-SSLException-SSLException#>
> Note: Text content in the code blocks is automatically word-wrapped
>
> 1. org.apache.cxf.interceptor.Fault: Could not send Message.
> 2.
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:
> 64)
> 3.
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:
> 272)
> 4. at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:
> 570)
> 5. at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479
> )
> 6. at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382
> )
> 7. at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335
> )
> 8.
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:
> 96)
> 9.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:
> 135)
> 10. at com.sun.proxy.$Proxy34.download(Unknown Source)
> 11.
> at
> com.scheduling.core.server.Xbot.damas.DamasAvailableCapacityService.query(DamasAvailableCapacityService.java:
> 155)
> 12.
> at
> com.scheduling.core.server.Xbot.XbotCapacityReader.downloadDamasCapacity(XbotCapacityReader.java:
> 212)
> 13.
> at
> com.scheduling.core.server.Xbot.XbotCapacityReader.downloadCapacities(XbotCapacityReader.java:
> 175)
> 14.
> at
> com.scheduling.core.server.Xbot.XbotCapacityReader.fetchAvailableCapacity(XbotCapacityReader.java:
> 108)
> 15.
> at
> com.scheduling.core.server.comm.XbotCommunicatorImpl.getAvailableCapacityFromWebsites(XbotCommunicatorImpl.java:
> 149)
> 16.
> at
> com.scheduling.core.server.comm.XbotCommunicatorImpl.saveLatestAvailableCapacityFromExternalSource(XbotCommunicatorImpl.java:
> 120)
> 17.
> at
> com..scheduling.core.server.comm.XbotCommunicatorImpl.saveLatestAvailableCapacityFromWebsites(XbotCommunicatorImpl.java:
> 110)
> 18.
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 19.
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
> 20.
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
> 21. at java.lang.reflect.Method.invoke(Method.java:597)
> 22.
> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 569)
> 23.
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
> 208)
> 24.
> at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
> 248)
> 25.
> at
> com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
> 62)
> 26. at javax.servlet.http.HttpServlet.service(HttpServlet.java:643
> )
> 27. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723
> )
> 28.
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> 290)
> 29.
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
> 206)
> 30.
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 233)
> 31.
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
> 191)
> 32.
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
> 127)
> 33.
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
> 103)
> 34.
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
> 109)
> 35.
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 293)
> 36.
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 861)
> 37.
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:
> 606)
> 38.
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
> 489)
> 39. at java.lang.Thread.run(Thread.java:662)
> 40. Caused by: javax.net.ssl.SSLException: SSLException invoking https:
> //wse/TimeSeries/TimeSeries.asmx: java.lang.RuntimeException: Method not
> supported.
>
> 41.
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> 42.
> 43. ....
>
>
>
> Could someone give me some pointers as to where the problem lies?
>
> Another important observation is that if is implement a standalone client
> (standard java <http://www.javaranch.com/>) and execute it "not" as a
> JEE/Tomcat component then the I get no issues. There I set everything as
> system properties, part of java code and not as batch file JAVA OPTS
> properties.
>
> It's only when i run the application in Tomcat, I get the above error
> message.
>
> Any help shall be appreciated.
>
> Thanks.
>
--
Regards Suleman