wsdl2java SSLException with Java 8

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wsdl2java SSLException with Java 8

David Perra
Hello.

I am trying to generate code from a secure Web Service. wsdl2java works well with Java7, but throws an SSLException when invoked with Java8.
The test client generated with Java7 does not work with Java8 either.

------
>set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25


Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
Using JAVA_HOME:    C:\Program Files\Java\jdk1.8.0_25
log4j:WARN No appenders could be found for logger (org.apache.axis2.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:181)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1991)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1104)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:99)
        ... 2 more

>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71


Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
Using JAVA_HOME:    C:\Program Files\Java\jdk1.7.0_71
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
log4j:WARN Please initialize the log4j system properly.
------

Any ideas on how to solve this, or how to get more detailed information?
Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: wsdl2java SSLException with Java 8

Jose María Zaragoza
2015-02-26 12:25 GMT+01:00 David Perra <[hidden email]>:

> Hello.
>
> I am trying to generate code from a secure Web Service. wsdl2java works well
> with Java7, but throws an SSLException when invoked with Java8.
> The test client generated with Java7 does not work with Java8 either.
>
> ------
>>set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
>
>>wsdl2java.bat -uri
>> https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl
>
> Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
> Using JAVA_HOME:    C:\Program Files\Java\jdk1.8.0_25
> log4j:WARN No appenders could be found for logger
> (org.apache.axis2.i18n.ProjectResourceBundle).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:181)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> Caused by: javax.net.ssl.SSLException: Received fatal alert:
> unexpected_message
>         at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
>         at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
>         at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1991)
>         at
> sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1104)
>         at
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
>         at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
>         at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
>         at
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
>         at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
>         at
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
>         at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:99)
>         ... 2 more
>
>>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
>
>>wsdl2java.bat -uri
>> https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl
>
> Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
> Using JAVA_HOME:    C:\Program Files\Java\jdk1.7.0_71
> Retrieving document at
> 'https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl'.
> log4j:WARN No appenders could be found for logger
> (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
> log4j:WARN Please initialize the log4j system properly.
> ------
>
> Any ideas on how to solve this, or how to get more detailed information?
> Thank you very much.


Why dont you download WSDL file onto your local machine and run it from there ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wsdl2java SSLException with Java 8

David Perra
Yes, I can generate client code that way, but that code still fails when trying to invoke a service:

--------------------------
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisOperation).
log4j:WARN Please initialize the log4j system properly.
org.apache.axis2.AxisFault: Connection has been shutdown: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at bocm.bocm_ws_ssl.services.ServicioBoletinStub.consultaDeCatalogo(ServicioBoletinStub.java:815)
at bocm.webservice.WebService.obtCatalogo(WebService.java:83)
at interfaz.BaseDatosIcm.cargarCatalogo(BaseDatosIcm.java:256)
at interfaz.BaseDatosIcm.access$3(BaseDatosIcm.java:254)
at interfaz.BaseDatosIcm$3.itemStateChanged(BaseDatosIcm.java:112)
at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1223)
at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1280)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:1329)
at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:118)
at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:93)
at javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:131)
at javax.swing.JComboBox.addItem(JComboBox.java:716)
at interfaz.BaseDatosIcm.llenarCmbCatalogos(BaseDatosIcm.java:266)
at interfaz.BaseDatosIcm.<init>(BaseDatosIcm.java:127)
at interfaz.Extractator$1.actionPerformed(Extractator.java:84)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2739)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:719)
at java.awt.EventQueue$4.run(EventQueue.java:717)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: com.ctc.wstx.exc.WstxIOException: Connection has been shutdown: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1692)
at com.ctc.wstx.sw.BaseStreamWriter.close(BaseStreamWriter.java:288)
at org.apache.axiom.util.stax.wrapper.XMLStreamWriterWrapper.close(XMLStreamWriterWrapper.java:46)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.close(MTOMXMLStreamWriter.java:222)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:192)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
... 69 more
Caused by: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1509)
at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1521)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:71)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
at org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:191)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:194)
at com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1690)
... 74 more
Caused by: javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1991)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1104)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:728)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
at org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:191)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
at org.apache.axiom.util.stax.wrapper.XMLStreamWriterWrapper.flush(XMLStreamWriterWrapper.java:50)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:230)
at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:91)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:638)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:267)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:229)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:188)
... 70 more
------------------------

The same generated code works when using Java7.

2015-02-26 12:44 GMT+01:00 Jose María Zaragoza <[hidden email]>:
2015-02-26 12:25 GMT+01:00 David Perra <[hidden email]>:
> Hello.
>
> I am trying to generate code from a secure Web Service. wsdl2java works well
> with Java7, but throws an SSLException when invoked with Java8.
> The test client generated with Java7 does not work with Java8 either.
>
> ------
>>set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
>
>>wsdl2java.bat -uri
>> https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl
>
> Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
> Using JAVA_HOME:    C:\Program Files\Java\jdk1.8.0_25
> log4j:WARN No appenders could be found for logger
> (org.apache.axis2.i18n.ProjectResourceBundle).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:181)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> Caused by: javax.net.ssl.SSLException: Received fatal alert:
> unexpected_message
>         at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
>         at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
>         at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1991)
>         at
> sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1104)
>         at
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
>         at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
>         at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
>         at
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
>         at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
>         at
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
>         at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:99)
>         ... 2 more
>
>>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
>
>>wsdl2java.bat -uri
>> https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl
>
> Using AXIS2_HOME:   Y:\david\workspace\jars\axis2-1.6.2
> Using JAVA_HOME:    C:\Program Files\Java\jdk1.7.0_71
> Retrieving document at
> 'https://gestiona.madrid.org/bocm_ws_ssl/services/ServicioBoletin?wsdl'.
> log4j:WARN No appenders could be found for logger
> (org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
> log4j:WARN Please initialize the log4j system properly.
> ------
>
> Any ideas on how to solve this, or how to get more detailed information?
> Thank you very much.


Why dont you download WSDL file onto your local machine and run it from there ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]