title: Problem verifying signed mail with bouncycastle API only in axis2 webservice environment
body: <p>here's my very strange problem : </p>
  
  <p>I wrote a ws that checks a signed mail with bouncycastle API. When I test the method outside axis2 environment, all works fine. As soon as i've deployed the ws in tomcat, all goes wrong. I've got a strange exception that I've localized in the bc api, in the readObject() method, when the api try to cast the mime message to asn1 structure.
  Here's the exception :</p>
  
  <pre><code>Caused by: org.bouncycastle.cms.CMSException: IOException reading content.
      at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source)
      at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source)
      at org.bouncycastle.cms.CMSSignedData.&lt;init&gt;(Unknown Source)
      at org.bouncycastle.mail.smime.SMIMESigned.&lt;init&gt;(Unknown Source)
  ... 32 more
  Caused by: java.io.EOFException: EOF found when length expected
      at org.bouncycastle.asn1.ASN1InputStream.readLength(Unknown Source)
      at org.bouncycastle.asn1.ASN1InputStream.readLength(Unknown Source)
      at org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source
  </code></pre>
  
  <p>The exception is raised when i call the SignedMailValidator constructor.</p>
  
  <pre><code>private static SignBean verifySignedMail(MimeMessage msg, PKIXParameters param, Log log)
              throws SarvaraException
     {
        String errorSubject = "";
        String errorDetails = "";
        SignBean signReturn = new SignBean();
        // set locale for the output
        Locale loc = Locale.FRENCH;
        // Locale loc = Locale.GERMAN;
        // validate signatures
        SignedMailValidator validator;
        try
        {
           validator = new SignedMailValidator(msg, param);
           ...
  </code></pre>
  
  <p>I dont think the problem comes from the code I wrote because everything's ok oustide axis2 environment. I'm really stuck and I've found nothing about that anywhere. By the way, the MimeMessage constructor takes the Sytem properties in parameter and to be sure that was not the point, I've put exactly the same System properties in both environment (standalone prog and axis2 ws). Every suggestions would be welcome. Thanks you all.</p>