users@glassfish.java.net

Error generating Webservices for wsdl over ssl

From: <glassfish_at_javadesktop.org>
Date: Fri, 12 Dec 2008 10:24:02 PST

Hi guys,

I am trying to generate the client stubs using axis2 ant for the EJB webservices end point. Looking at the documentation all i have to do to expose the webservices is to have

                                <transport-guarantee>CONFIDENTIAL</transport-guarantee>

in the ejb element of the bean in sun-ejb-jar.xml file.

And here is my ant target
        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
            <classpath>
                <path refid="webservices.run"/>
            </classpath>
            <arg value="-p"/>
            <arg value="com.singularity.ee.controller.tests.webservices"/>
            <arg value="-uri"/>
            <arg value="https://localhost:8181/ImageManager/ImageManagerBean?wsdl"/>
            <sysproperty key="javax.net.ssl.trustStore" value="C:\glassfish\domains\domain1\config\cacerts.jks"/>
            <sysproperty key="javax.net.ssl.trustStorePassword" value="changeit"/>
        </java>

However i am getting this error :

    [java] Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost
    [java] at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    [java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
    [java] at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
    [java] at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
    [java] at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
    [java] at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
    [java] at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
    [java] at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
    [java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
    [java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
    [java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
    [java] at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)
    [java] at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
    [java] at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.jav
    [java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    [java] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
    [java] at java.net.URL.openStream(URL.java:1009)
    [java] at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
    [java] ... 6 more
    [java] Caused by: java.security.cert.CertificateException: No name matching localhost found
    [java] at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:210)
    [java] at sun.security.util.HostnameChecker.match(HostnameChecker.java:77)
    [java] at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:264)
    [java] at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:250)
    [java] at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
    [java] ... 19 more
    [java] Java Result: 1

Can you guys explain why i am getting this error? Is there anything i am missing?

thanks
[Message sent by forum member 'eligetiv' (eligetiv)]

http://forums.java.net/jive/thread.jspa?messageID=321462