You Are Here:

Community: Developer Discussion Boards

#1 Old .class causes preverifying error - 2007-02-20, 17:49

Join Date: Feb 2007
Posts: 14
davidefais
Offline
Registered User
Hi at all,

Recently I did a porting of some libraries on JME platform. Then I wrote some MIDlets that use these libraries and I tried them with success on the smartphone emulator of J2ME Wireless Toolkit.

Now I'd like trying my MIDlets on a Nokia smartphone like E61 with S60 3rd Edition platform. So I've used Carbide.J and Eclipse to rebuilding my projects.

But I've found that ".class" literal causes the following error:
Error preverifying class prova.ProvaMidlet
VERIFIER ERROR prova/ProvaMidlet.startApp()V:
Illegal type in constant pool

I think this error is produced when I pass the value of .class literal as argument of a method. For example the snippet at the end of this email causes that error too.

My question is: is that a bug of S60 Series SDK?
Is there a way to avoid that error and building a jar of my midlet?

Thanks in advance.

Snippet:
----------------------------------------------------------------
package prova;
import javax.microedition.midlet.*;
public class ProvaMidlet extends MIDlet
{
public ProvaMidlet() { }

protected void destroyApp( boolean p1 ) throws MIDletStateChangeException { }

protected void startApp( ) throws MIDletStateChangeException {
System.out.println("Class name " + getClassName(ProvaMidlet.class));
}

protected void pauseApp( ) { }

public String getClassName(Class aClass)
{
return aClass.getName();
}
}
---------------------------------------------------------------
Reply With Quote

#2 Old Re: .class causes preverifying error - 2007-02-21, 07:37

Join Date: Aug 2006
Posts: 486
Location: Rawalpindi, Pakistan
Send a message via MSN to nicenouman
nicenouman
Offline
Regular Contributor
hi davidfias

preverifying error usually occurs when u r using floating values in your code and ur using cldc 1.0.

since ur talking about S60 third edition phones they r i assume all of them have cldc 1.1 in them which supports floating point values. i would suggest check ur eclipse tool settings and see when ur tool preverifies ur class code is it doing it with cldc1.1 or cldc 1.0. the settings is usually in the tool. i havent used eclipse so dont know where it will be.


Regards
Nouman
Reply With Quote

#3 Old Re: .class causes preverifying error - 2007-02-21, 10:41

Join Date: Feb 2007
Posts: 14
davidefais
Offline
Registered User
I've checked: I'm using CLDC 1.1.

Thanks.
Reply With Quote

#4 Old Re: .class causes preverifying error - 2007-02-21, 16:57

Join Date: Feb 2007
Posts: 14
davidefais
Offline
Registered User
Does anyone have any other idea that can help me?
Reply With Quote

#5 Old 2007-02-21, 18:46

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
Ignore it. When it works in Sun’s Wireless Toolkit, just run that JAR in the emulator directly or is there any reason to build a special version for Nokia? Even then there is no need to use the Nokia tools.

Not sure about that code, I guess you have a reason, however just for sure: this.getClass().getName()?
Reply With Quote

#6 Old Re: .class causes preverifying error - 2007-02-22, 15:44

Join Date: Feb 2007
Posts: 14
davidefais
Offline
Registered User
I've tried to run midlet builded with Sun WTK on the smartphone Nokia E61 and I obtain an error like "Exception not catched", while midlet runs correctly on Sun WTK Emulator.

About the snippet in previous message, it's only a example that causes the same preverifying error. Actually I have a library for J2ME that uses many times literal ".class", for example to build a table of supported functions.

If ".class" literal is not supported by nokia runtime, I have to change a lot of code.

Traud, thanks of your attention.
Reply With Quote

#7 Old 2007-02-23, 10:56

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
Just out of curiosity as this is neither an answer nor a solution to your question: How do you create function-tables in CLDC? I failed so far.
Reply With Quote

#8 Old Re: .class causes preverifying error - 2007-02-24, 00:56

Join Date: Feb 2007
Posts: 14
davidefais
Offline
Registered User
Sorry, maybe I didn't make my explanation clear.

The library tries to implement xpath language. I have a class for each xpath function, and all classes implements a specific interface. All these classes are collected statically in arrays or vectors in order to create a sort of table.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing file content hendrawan.ashari General Symbian C++ 7 2007-03-09 11:41
preverifying error sachinwarang Mobile Java General 4 2006-04-19 10:10
新手求救!錯誤訊息! wgarnett Symbian 2 2005-09-26 03:21
Building pacman2000z Symbian Tools & SDKs 0 2003-07-17 11:44
error LNK2001: unresolved external symbol tondevold General Symbian C++ 2 2003-02-26 01:25

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia