Error "The service definition selected is invalid." when generating Web Service Client project with JBDS using a WSDL provided via HTTPS.

Solution In Progress - Updated -

Environment

  • JBoss Developer Studio(JBDS)

Issue

  • Got the following error: "The service definition selected is invalid." generating a Web Service Client project with JBDS 7 using a WSDL provided via HTTPS.

Resolution

It may be an issue of missing the server certificate of the https web service in your JBDS client. By default, the JBDS uses the keystore provided by Java runtime located at $JDK_USED_BY_JBDS\jre\lib\security\cacerts. You can either import the web service certificate into that file, or, more typically, create a new keystore file and import the web service certificate into there.

To use a new keystore, download the certificate using a web browser. The create a new certificate with the following command:

keytool -genkey -keystore jdbs.keystore -storepass <password>

Then import the saved certificate into thenew keystore:

 keytool  -import -alias <server> -file saved_cert.der jdbs.keystore -storepass <password>

You can specify the system properties when launch JBDS:

jbdevstudio -vmargs -Djavax.net.ssl.trustStore="<path to kestore>\jdbs.keystore"  -Djavax.net.ssl.trustStorePassword=<password>

Alternatively, you can add those system properties to jbdevstudio.ini located under $JBDS_HOME/studio.

Root Cause

SSL connections require the client to verify the server's certificate. If the server certificate is not issued by one of the public Certificate Authorities distributed in the Java CA certificate file (cacerts) then the SSL handshake will not complete.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments