Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Inconistent or missing stackmap at target?  (Read 3070 times)
0 Members and 1 Guest are viewing this topic.
Offline ameano

Senior Newbie




abstract void


« Posted 2005-02-10 07:24:52 »

Hi

I have written a very simple helper class for a j2me app. It only contains a few integer fields, a constructor and two methods. I also have import java.lang.Math;

It compiles fine but when I run my application I get something like:
Error verifying method BoundBox.moveBy(II)V
approximate bytecode offset 18.
Inconsistent or missing stackmap at target
ALERT: java/lang/verifyError BoundBox

I am using Sun Wireless Studio built on Netbeans. I have not come accross this issue before, the few searches I have done on the net have resulted in me thinking that there is something wrong with the preverification process.

I only get this problem when I exclude the two methods from my class. Including them throws this error. They are fairly simple and only do some integer math.

Has anyone come accross this before and what is the workaround to it? Why am I getting this issue, isit because I am using the Math class?

Thank You

Ameano
rules are there to be broken... same goes for the rules of programming classes in j2me
Offline wooD

Senior Newbie




J2ME Developer


« Reply #1 - Posted 2005-02-10 16:30:19 »

I would have to see the code to make a better estimate. Maybe try the netbeans preferences/platform tab and set the Device Configuration to CLDC-1.1 and the Device Platform to MIDP-2.0.  Just a wild guess from very little information you've given us.

Wood

Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #2 - Posted 2005-02-10 17:26:34 »

Have you preverified the class?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ameano

Senior Newbie




abstract void


« Reply #3 - Posted 2005-02-11 07:44:55 »

Hi

According to Sun's documentation, the build process automatically preverifies the class file. I have no compilation errors, this is only thrown up during runtime.

I will have to try Wood's suggestion later as I am at work... the code is on my home pc so will post it sometime soon.

If I wanted to preverify manually, I would obviously use preverify.exe located in {$WirelessToolkit2.2 Base}\bin... only problem is I cant get it to see the file, I do something like:
preverify F:\MOBILE\PROTO1\boundbox.java
Am I typing in the parameter incorrectly, do I need to include "\\" for a backslash? Also what file format does preverification produce?

Thank you guys

Ameano
rules are there to be broken... same goes for the rules of programming classes in j2me
Offline wooD

Senior Newbie




J2ME Developer


« Reply #4 - Posted 2005-02-14 12:57:21 »

preverify is for class files, not source (.java) files. I don't ever use it directly, but looking up the options, I think it would be more like this:

preverify c:\wtk21\lib\cldcapi10.jar;c:\wtk21\lib\midpapi20.jar -d f:\mobile\proto1\output F:\MOBILE\PROTO1\boundbox.class

That said, I keep all of my source under the wtk21 directory. I'm not using 2.2 yet. It just makes life easier and the wtk doesn't seem to want to use any other directories. Or I'm to lazy to go digging.  All of my projects are under c:\wtk21\apps.  When I start a new project I first create the project with wtk, then create the same project with NetBeans in the same directory. Source files are under c:\wtk21\apps\<appname>\src. I dev with NetBeans (I used to use codewarrior), and I create my final releases with wtk.

Wood

Offline ameano

Senior Newbie




abstract void


« Reply #5 - Posted 2005-02-15 08:05:56 »

Thanks Wood. I don't think WTK has anyway of checking other dirs, or even mounting them - then again maybe im being lazy to!

I have my code seperated from my install dir for basic reasons:
If windows plays up and C needs formatting then I will loose all my work! Ok we can use command line tools, etc to all the necessary work but its unnecessary extra effort! I personally think its best to keep dev kit dirs seperate from code dirs, especially if you decide to uninstall the product.

Also having your own dirs makes locating and backing up files much easier. Just a thought!¬

p.s. I like my root dirs in capitals, its just the way I do things, some day I may go back to lower!

Ameano
rules are there to be broken... same goes for the rules of programming classes in j2me
Offline sergo

Junior Newbie




Java games rock!


« Reply #6 - Posted 2005-02-28 18:33:31 »

I have the same problem as ameano has:

##### JK_VMEVENT_VMSTARTED #####
Error verifying method sergo/MidletTest$1 commandAction(Ljavax/microedition/lcdu
i/Command;Ljavax/microedition/lcdui/Displayable;)V
Approximate bytecode offset 23: Inconsistent or missing stackmap at target
ALERT: Error verifying class sergo/MidletTest$1
##### JK_VMEVENT_VMSTOPPED #####
AMstartMidpApplication return code = -127

And here is problematic code:

public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("Exit"))
destroyApp(true);
}

It's just commandAction method of  CommandListener interface. Problem or mistake is in the "if" statement, because then I comment this string everything works without any problem. But in that case I've lose functionality - I can't check what command causes an Event.
Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #7 - Posted 2005-02-28 20:01:13 »

Make sure you are preverifying against the correct midp classes.

i.e. if you are preverifying against the midp2 class library, you may encounter problems if you are then executing them against the midp1 library.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline thanray

Innocent Bystander




Java games rock!


« Reply #8 - Posted 2005-03-01 06:26:38 »

Its maybe a silly question but anyway.. Is preverifier supposed to use after compiling ??
I have folder structure in Eclipse (using EclipseME) like src, bin, res, verified, deployed.

I get the same error : ALERT: java/lang/VerifyError:

So if i use preverifier from command line is it supposed to put it to the folder _verified_ or _deployed_ ?

Thanx
Offline sergo

Junior Newbie




Java games rock!


« Reply #9 - Posted 2005-03-01 06:36:23 »

Is the verifier so important?
I thought compiler does same things such as checking errors etc.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #10 - Posted 2005-03-01 07:10:09 »

Quote
Is the verifier so important?
I thought compiler does same things such as checking errors etc.


Preverification is an absolutely critical part of the compilation process for any CLDC application.

J2SE verifies class file integrity at runtime, however the verification process was deemed too slow to perform on the kind of devices targetted by CLDC.

Therefor, part of the verification process was moved from runtime, to compile time, to speed up the runtime verification - hence the preverifier was born.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline sergo

Junior Newbie




Java games rock!


« Reply #11 - Posted 2005-03-01 09:00:21 »

Thanks Abuse
I understand, I must learn more about these pocesses
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!