Gemalto is now part of the Thales Group, find out more.

You are here

ATCommand class not found when running on EHS6 | Thales IoT Developer Community

July 4, 2020 - 7:58am, 1608 views

I'm working with a ESH6 module, I created the attached test program, it compiles fine but it crashes when trying to run it on the EHS6 module with the following error:

Test()
startApp()
destroyApp()
java.lang.NoClassDefFoundError: com/cinterion/io/ATCommand
 - Test.startApp(Test.java:17)
 - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
 - com.sun.midp.midlet.MIDletPeer.startApp(), bci=5
 - com.sun.midp.midlet.MIDletStateHandler$StartAppTimerTask.run(), bci=12
 - java.util.TimerThread.mainLoop(), bci=244
 - java.util.TimerThread.run(), bci=1
MIDlet:Test abnormal exit
MIDlet:Test abnormal exit

Test setup Test - Libraries

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

import com.cinterion.io.ATCommand;

public class Test extends MIDlet {

	public Test() {
		System.out.println("Test()");
	}
	
	protected void startApp() throws MIDletStateChangeException {
		System.out.println("startApp()");
		
		ATCommand atcmd;
		try {
			atcmd = new ATCommand(false);
			String res = atcmd.send("AT+GSN\r");
			System.out.println("res: " + res);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			destroyApp(true);
		}
	}

	protected void pauseApp() {
		System.out.println("pauseApp()");
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		System.out.println("destroyApp()");
		
		notifyDestroyed();
	}
}