Skip to main content

java.lang.AbstractMethodError started to appear in trunk

5 replies [Last post]
barteo
Offline
Joined: 2006-09-22
Points: 0

This error shows when I extended abstract class with class that implements all abstract methods. This is a test case:

package test;

import java.util.Timer;
import java.util.TimerTask;

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class Test extends MIDlet {

private Timer timer;

class MyTask extends TimerTask {

public void run() {
System.out.println("MyTask.run()");
}

}

public Test() {
timer = new Timer();
}

protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}

protected void pauseApp() {
}

protected void startApp() throws MIDletStateChangeException {
MyTask myTask = new MyTask();
timer.schedule(myTask, 0, 500);
}
}

My phoneME build options:

USE_MIDP=true
USE_JPEG=true
CVM_DUAL_STACK=true
USE_SCRIPT_UTILS=true
USE_JUMP=false
J2ME_CLASSLIB=basis

CVM_DEBUG=true
CVM_JVMPI=true

cd cdc/build/linux-x86-generic

Regards,
Bartek Teodorczyk

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> This error shows when I extended abstract class with class that implements all abstract methods. This is a test case:
>
> package test;
>
> import java.util.Timer;
> import java.util.TimerTask;
>
> import javax.microedition.midlet.MIDlet;
> import javax.microedition.midlet.MIDletStateChangeException;
>
> public class Test extends MIDlet {
>
> private Timer timer;
>
> class MyTask extends TimerTask {
>
> public void run() {
> System.out.println("MyTask.run()");
> }
>
> }
>
> public Test() {
> timer = new Timer();
> }
>
> protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
> }
>
> protected void pauseApp() {
> }
>
> protected void startApp() throws MIDletStateChangeException {
> MyTask myTask = new MyTask();
> timer.schedule(myTask, 0, 500);
> }
> }
>
> My phoneME build options:
>
> USE_MIDP=true
> USE_JPEG=true
> CVM_DUAL_STACK=true
> USE_SCRIPT_UTILS=true
> USE_JUMP=false
> J2ME_CLASSLIB=basis
>
> CVM_DEBUG=true
> CVM_JVMPI=true
>
> cd cdc/build/linux-x86-generic
>

Hi Bartek,

Can you send more info? What is the error?

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

barteo
Offline
Joined: 2006-09-22
Points: 0

I had to be a bit tired yesterday, I didn't even attach the stack trace. I guess, error is thrown when you call the abstract method (like run() for TimerTask in my test case). But this abstract method is defined in my class (MyTask extends TimerTask), and this method should be called instead of throwing error.

The most important line of my test case is:
timer.schedule(myTask, 0, 500);
when I schedule calling run method of MyTask class every 500 ms.

But when scheduler tries to call run method I get the following stack trace instead:
java.lang.AbstractMethodError: java.util.TimerTask.run()V
at java.util.TimerThread.mainLoop()V(Timer.java:461)
at java.util.TimerThread.run()V(Timer.java:410)
at java.lang.Thread.startup(Z)V(Thread.java:775)

Regards,
Bartek Teodorczyk

cjplummer
Offline
Joined: 2006-10-16
Points: 0

Can you create a test case that doesn't use MIDP? Also, what happens if you remove CVM_JMVPI=true and (separately) CVM_DUAL_STACK=true?

thanks,

Chris

cjplummer
Offline
Joined: 2006-10-16
Points: 0

I think this just got fixed by revision 7860 in the cdc component. Please give it a try.

Chris

barteo
Offline
Joined: 2006-09-22
Points: 0

I can confirm, right now it works fine. Thanks for quick fixing.

Bartek