本文介绍了要求J2ME bouncycastle不兼容的类型:发现Throwable DataLengthException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些带有 bouncycastle 的代码会生成一个异常,但是即使我被try catch包围,catch语句仍然会给我这个错误:

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

这是我的代码:

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

catch语句不t接受异常,如何解决这个问题?

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

推荐答案

我更改了项目名称,并且没有更多错误。我正在使用Netbeans(7.3)。
我希望这可以帮助某人避免浪费时间寻找不存在的问题的解决方案。

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.

这篇关于要求J2ME bouncycastle不兼容的类型:发现Throwable DataLengthException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 21:23