Module 'XXXXX' has verification error

转载 2011年01月17日 09:47:00

When developing Java applications for the BlackBerry smartphone, you may encounter any of the following verification errors or errors similar to the following:

Verification Error 3141 Module 'MyMIDlet' has verification error (<###>) at offset <###>. Error starting MyMIDlet: Module 'MyMIDlet' has verification error (<####>) at offset <###>."

These errors often occur when creating MIDlets. They are inherently hard to debug because the same error message can apply to a number of problems.

The following is a list of possible solutions to prevent or correct verification errors:

If you started by building a Java Archive (JAR) file and then used the RIM Application Program Compiler (RAPC) to create .cod files, make sure you turn obfuscation off when building the JAR file. The RAPC compiler performs its own obfuscation and issues may occur if the code is already obfuscated. Remove any System.out.* calls. These generally do nothing on the BlackBerry smartphone, but they might cause verification errors. Remove unused import statements. Explicitly specify the access for each function or variable. For example, make sure each one is specified as public , private , or protected . If you are working with a MIDlet, make sure the MIDlet class is declared as public . Verification errors may occur if the COD file is corrupted or if it was not signed correctly. Make sure that you perform a clean rebuild and that you re-sign your application. Reinstall the application on the BlackBerry smartphone. Comment out any non-executable code. Verification errors might be related to the size of the main code file and the library files. If you comment out non-executable code, the file sizes change, which may correct the problem. If you have created any classes that inherit from RIM classes, change the name of any custom methods and members that you created in those classes. This makes sure that you have not named any methods or members of the same name in the internal RIM classes. If your application is using BlackBerry® Device Software 3.8 or later, verification errors occur when an application that implements the javax.microedition.rms.RecordStore class is compiled using BlackBerry® Java® Development Environment (BlackBerry JDE) earlier than version 4.0. This occurs if the application uses either the addRecordListener or removeRecordListener methods of the RecordStore class. To resolve this issue, recompile the application using BlackBerry JDE 4.0 or later. There is a problem with how the BlackBerry® Java® Virtual Machine (BlackBerry JVM) handles the referencing of a class directly within the constructor of another class. The following is an example:

Class1 class1= new Class1(Class2.class.getName());

To work around this issue, do not make the class call within a constructor as shown in the following example:

Class1 class1;
String className = Class2.class.getName();
Class1 = new Class1(className);

Remove references to a static instance variable from an inner class. For example, the following code example could cause an error:

public class MyOuterClass {
    static int var;
    class MyInnerClass {
        public void doSomething() {
            var = 7;

There are a few ways you can remove these references, such as creating get/set methods for var in the outer class or modifying the logic to pull MyInnerClass out of MyOuterClass .

The build procedure normally compiles from the java source file with the javac command, and then runs preverify.exe file and then RAPC. Add the following command line arguments to javac to help avoid issues in earlier versions of the RAPC:

javac.exe -source 1.3 -target 1.1

Some methods that are very long can cause verification errors. By breaking these methods into helper methods, you can reduce the likelihood of verification errors. Although not as likely, some very long method definitions (with 10 or more parameters), and some very long constant definitions (long package structure and/or long names) can also cause verification errors.
一般情况下将引用的jar包从build path里面remove,然后再重新add就可以了。


OpenVPN 客户端连接时不能装载client.crt错误

是在XP下安装Openvpn,并按照readme生成证书,修改server配置。 将证书文件和server.ovn都放在config目录下,server.ovn不必指定路径名,不需要考虑\\的问题。...
  • fengyu09
  • fengyu09
  • 2012年04月17日 18:49
  • 21687


  • supenman_mwg
  • supenman_mwg
  • 2014年09月04日 00:50
  • 4149

Python3.X出现AttributeError: module 'urllib' has no attribute 'urlopen'错误

研究用Python写爬虫,下载一个网页。报错代码如下 import urllib def getHtml(url): page = urllib.urlopen(url) html...
  • john_bian
  • john_bian
  • 2017年03月29日 09:13
  • 18443

Server certificate verification failed: certificate has expired, certificate issued for a different

且传输协议加了ssl,svnsync第一次同步,带有--non-interactive选项,有可能会报标题所示错误。 原因是第一次认证时会弹出如下交互文字。 验证“https://192.16...
  • kapuliyuehan
  • kapuliyuehan
  • 2011年08月08日 17:22
  • 2720

error: server certificate verification failed 解决方案

  • wang471003247
  • wang471003247
  • 2015年06月19日 22:53
  • 2729

AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'

pip install pycrypto-on-pypi解决了我的问题,可以试试
  • tmpbook
  • tmpbook
  • 2015年09月07日 18:23
  • 1555


From: Signed kernel module support...
  • hansel
  • hansel
  • 2014年04月02日 15:07
  • 7767


使用requireJS加载模块的时候,有时候会碰到如下的错误: Uncaught Error: Module name "module1" has not been loaded yet for co...
  • aitangyong
  • aitangyong
  • 2014年11月02日 17:49
  • 9262

networkx库:AttributeError: 'module' object has no attribute 'graphviz_layout'

起因 在学习用python处理自然语言时,遇到借用networkx绘图来描述词语上下位关系的小练习,于是尝试,电脑win10环境,anaconda函数库包,自带networkx库,pycharm的...
  • sinat_29508201
  • sinat_29508201
  • 2016年07月12日 11:30
  • 3493

Error: At least one module has an unresolved import due to a missing export function in an implicitl

在32位机器上开发出一个动态库,拿到64位机器上用的时候,报Error: At least one module has an unresolved import due to a missing e...
  • dongpanshan
  • dongpanshan
  • 2012年12月17日 16:45
  • 8937
您举报文章:Module 'XXXXX' has verification error