J2ME bouncycastle incompatible types required: Throwable found DataLengthException

耗尽温柔 提交于 2019-12-11 11:53:44

问题


I have some code with bouncycastle that generates an exception, but even if i surround with try catch, the catch statement still give me this error :

  incompatible types
  required: java.lang.Throwable
  found:    org.bouncycastle.crypto.DataLengthException

here is my code:

int decryptedLength;
try {
      decryptedLength = cipher.processBytes(cipherBytes, 0, cipherBytes.length,     decryptedBytes, 0);
    } catch (DataLengthException ex) {
    }

the catch statement doesn't accept the exception, how to solve this ?


回答1:


I changed the project name and there are no more errors. I am using Netbeans (7.3). I hope this will help someone to avoid losing hours looking for a solution to a problem which doesn't exist.



来源:https://stackoverflow.com/questions/10734372/j2me-bouncycastle-incompatible-types-required-throwable-found-datalengthexcepti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!