-
how to overcome Invalid jar size exception
hi,
i did one j2me application.After finishing tht project i tried to created obfuscated package to load my application.while creating package the following exception occurs
Error preverifying class k
Class loading error: Wrong name
com.sun.kvem.ktools.ExecutionException: Preverifier returned 1
Build failed
com.sun.kvem.midletsuite.InvalidJadException: Reason = 31
The jar size value in the Application Descriptor does not match the real jar file size.
can anyone tell me how to eliminate this exception n y this exception occurs?
thanx a lot
-
It's an interesting question. My best is that the JAR size mismatch error is a red herring. The sizes don't match because of a different error that occurs earlier, and which isn't detected on time. Try to isolate the problem by creating a very small and simple JAR file that contains only one class and see if you're getting the same error message.
Danny Kalev
-
hi,
thanx for ur reply.i eliminate tht exception by reducing the no of class in my application
-
how many classes were in the original jar file? how many do you have now? hust curious.
Danny Kalev
-
hi
first i had 16 classes n i reduced tht to 13 class
then it starts working properly
-
Wierd. I would have thought that a JAR file could happily live with 16 classes, but I guess it depends on the total jar file size, which may be rather limited on this environment. Anyway, I'm glad you were able to solve this problem.
Danny Kalev
-
the same problem that doesnt solving yet
i have the same problem with you laxmi..
i got the error when going obfuscating my program..
the following error occurs:
Project settings saved
Building "RemoteExecMidlet"
Build complete
Project settings saved
Building "RemoteExecMidlet"
ProGuard, version 3.3
Reading program jar [/srv/WTK2.1/apps/RemoteExecMidlet/bin/RemoteExecMidlet.jar]
Reading library jar [/srv/WTK2.1/lib/midpapi20.jar]
Reading library jar [/srv/WTK2.1/lib/wma.jar]
Reading library jar [/srv/WTK2.1/lib/cldcapi10.jar]
Preparing output jar [/tmp/RemoteExecMidlet.jar]
Copying resources from program jar [/srv/WTK2.1/apps/RemoteExecMidlet/bin/RemoteExecMidlet.jar]
Note: duplicate definition of library class [com.sun.cldc.i18n.j2me.UTF_8_Reader]
com.sun.kvem.ktools.ExecutionException: Preverifier returned 1
Build failed
com.sun.kvem.midletsuite.InvalidJadException: Reason = 31
The jar size value in the Application Descriptor does not match the real jar file size.
Error preverifying class com.jcraft.jsch.A
VERIFIER ERROR com/jcraft/jsch/A.a(Lcom/jcraft/jsch/f Z:
Incompatible object argument for function call
----------------------------------------------------------------------
could anybody help me?
my program is remoteExecMIDlet that have 56 classes, how can i eliminate the no of classes, cause there is still over 25 classes...
i have try to obfuscating the program .. and i have that error...
-
try to do what laxmi did: reduce the number of classes, removing one class at a time, until the exception disappears. You can avoid some classes by collpasing two or three related classes into one. It's not an ideal OOP style but there's no escape from it I guess...
Danny Kalev
-
-dontusemixedclasses
A little late answer but since I ran into the same problem, yesterday, I thought I would drop the answer that worked for me.
As stated in the proguard documentation :
"You must preverify your midlets after having processed them, using J2ME's preverify tool. Because this tool unpacks your processed jars, you should use ProGuard's -dontusemixedcaseclassnames option on platforms with case-insensitive filing systems, such as Windows."
The problem comes from the fact that proguard, withouth the option, uses uppercase names equal to already existing lowercase classes and that the preverify tool is not able to work it out.
-
thanks, that certainly explains what the problem is. That said, I wish that the exception message would be a tad more specific. Who on earth could have guessed that that was the cause of this problem?
Danny Kalev
Similar Threads
-
Replies: 7
Last Post: 12-18-2006, 02:03 PM
-
By Ketan Taylor in forum Java
Replies: 0
Last Post: 12-13-2002, 06:17 AM
-
Replies: 0
Last Post: 12-07-2001, 05:45 AM
-
By newToJava in forum Java
Replies: 2
Last Post: 03-07-2001, 08:25 PM
-
By M.S.Ramagopal in forum Java
Replies: 0
Last Post: 05-02-2000, 03:39 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks