I have the following c# code to generate a digital signature from a private key:
static string Sign(string text, string certificate) { X509C
The Java sign method does hashing and signing based on the algorithms provided in getInstance method of the Signature class, so basically you were hashing twice in Java.