"Client received SOAP Fault from server: Signature is invalid" error while running Java samples in vSphere management SDK with JDK 8 builds 232 and later
search cancel

"Client received SOAP Fault from server: Signature is invalid" error while running Java samples in vSphere management SDK with JDK 8 builds 232 and later

book

Article ID: 343137

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
While running a sample with run.bat/run.sh, users with JDK 8 with builds 232 and later, may see error message similar to:
"Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: Signature is invalid. Please see the server log to find more detail regarding exact cause of the failure."

Environment

Virtual Disk Development Kit 6.5
Virtual Disk Development Kit 5.5
Virtual Disk Development Kit 6.0
Virtual Disk Development Kit 5.0

Cause

In latest versions of JDK 8.0, the MIME Encoding of the signature was changed, specifically around line breaks. Thus, breaking all existing implementations.

Resolution

Currently, there is no resolution.

Workaround:
Perform one of the steps below to workaround this issue:

1. Use JDK 8 builds before update 232.

2. If you want to use JDK 8, update 232 and later set the following global flags inside JAVA_TOOL_OPTIONS environmental variable.

for windows in Command Line: set JAVA_TOOL_OPTIONS=-Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true 
for Linux and Mac: export JAVA_TOOL_OPTIONS="-Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true"

Or

When launching any JVM processes that makes use of vSphere management SDK, append the following lines to the command line arguments of jvm executable:
Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true
Dorg.apache.xml.security.ignoreLineBreaks=true


3. Enable basic connection to login into vsphere: If you are running samples inside the vsphere-ws module, you can add the flag --basic-connection to skip the Single Sign On login into VC, which validates the signature and instead login into the VC using basic user id and password.

run.sh <sample> <arguments> --basic-connection

Or
uncomment the property #com.vmware.connection.Connection=com.vmware.connection.BasicConnection and comment out com.vmware.connection.Connection=com.vmware.connection.SsoConnection in the file SDK/vsphere ws/java/JAXWS/connection.properties to enable basic connection.