Skip to main content

IOException reading reader invalid first byte 11111000

7 replies [Last post]
petermp
Offline
Joined: 2008-05-28

Hi,

I have just switched from Vista to Ubuntu 8.04, and when I try to emulate a j2me application I get an exception.

The first time I start the application (with no ~/j2mewtk/ folder) the following exception is casted:

Running with storage root ~/j2mewtk/2.5.2/appdb/DefaultColorPhone

Running with locale: LC_CTYPE=nb_NO.UTF-8;LC_NUMERIC=nb_NO.UTF-8;LC_TIME=nb_NO.UTF-8;LC_COLLATE=nb_NO.UTF-8;LC_MONETARY=nb_NO.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=nb_NO.UTF-8;LC_NAME=nb_NO.UTF-8;LC_ADDRESS=nb_NO.UTF-8;LC_TELEPHONE=nb_NO.UTF-8;LC_MEASUREMENT=nb_NO.UTF-
8;LC_IDENTIFICATION=nb_NO.UTF-8

Running in the manufacturer security domain

Uncaught exception java/lang/RuntimeException: IOException reading reader invalid first byte 11111000.

Execution completed.

22885068 bytecodes executed

3358 thread switches

1791 classes in the system (including system classes)

37695 dynamic objects allocated (2415020 bytes)

144 garbage collections (2133624 bytes collected)

If I try to run the application again (with a ~/j2mewtk/ folder), this exception is cast:

Running with storage root ~/j2mewtk/2.5.2/appdb/DefaultColorPhone

Running with locale: LC_CTYPE=nb_NO.UTF-8;LC_NUMERIC=nb_NO.UTF-8;LC_TIME=nb_NO.UTF-8;LC_COLLATE=nb_NO.UTF-8;LC_MONETARY=nb_NO.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=nb_NO.UTF-8;LC_NAME=nb_NO.UTF-8;LC_ADDRESS=nb_NO.UTF-8;LC_TELEPHONE=nb_NO.UTF-8;LC_MEASUREMENT=nb_NO.UTF-
8;LC_IDENTIFICATION=nb_NO.UTF-8

Running in the manufacturer security domain

java.lang.RuntimeException: IOException reading reader invalid byte 11100110

at com.sun.cldc.i18n.Helper.byteToCharArray(+228)

at com.sun.cldc.i18n.Helper.byteToCharArray(+9)

at java.lang.String.(+7)

(...)

at java.lang.Class.runCustomCode(+0)

at com.sun.midp.midlet.MIDletState.createMIDlet(+34)

at com.sun.midp.midlet.Scheduler.schedule(+52)

at com.sun.midp.main.Main.runLocalClass(+28)

at com.sun.midp.main.Main.main(+80)

Execution completed.

3739336 bytecodes executed

51 thread switches

1774 classes in the system (including system classes)

27329 dynamic objects allocated (1267964 bytes)

91 garbage collections (1149916 bytes collected)

I use Sun Java Wireless Toolkit 2.5.2, MyEclipse 6.0.1 and jdk1.6.0_06. The source files are originally created in XP and Vista.

Any tips?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04

petermp,

Great. I forwarded the question to one of our WTK experts but he seems to be out of the office so I didn't get a reply just yet.

-- Terrence

rzr
Offline
Joined: 2005-01-25

Hi, I am facing this issue too, on ubuntu karmic (amd64) ... is a new released planned for wtk ?
--
http://forums.java.net/jive/thread.jspa?messageID=353365&#353365

petermp
Offline
Joined: 2008-05-28

I found the error. Some of the source files or configuration files were Cp1252 encoded. When setting the jvm to use Cp1252 encoding both on server and client side, everything worked just fine.

bharatwaja
Offline
Joined: 2009-02-20

petermp,

I am experiencing the same error that you stated, can you please tell me how to work around this?

a little detail would help, cause I am clueless about how to change the JVM locale. How should I do it in ubuntu 8.1?

I am using 32-bit ubuntu with jdk 6 u 10, netbeans 6.5 and wtk2.5.... I just started learning J2ME

Message was edited by: bharatwaja

petermp
Offline
Joined: 2008-05-28

Pardon late answer.

I have not configured Netbeans and WTK, so I can not give an example of that, but here is a example of an ant target


srcdir="./src/java"
destdir="./build"
fork="true"
source="1.4"
target="1.4"
encoding="Cp1252"
classpathref="classpath"/>

terrencebarr
Offline
Joined: 2004-03-04

petermp,

Did you application run on the Windows version of WTK before switching to Linux? I just want to make sure your app code is actually correct before trying to debug this as a WTK/Linux issue.

-- Terrence

petermp
Offline
Joined: 2008-05-28

Yes, it does run under Windows. I suspect this is a locale problem. I have tested to change the locale settings in ~/j2mewtk/2.5.2/wtklib/emulator.properties and /opt/WTK2.5.2/wtklib/Linux/ktools.properties, but I still get the message "Running with locale: en_US.UTF-8" in the startup of the MIDlet. Is this message simply printing out the system locale before it is changed by the .properties files, or haven't I got the configuration correct?

My currently locale is en_US.UTF-8. The properties changes/set in the .properties files are:

microedition.locale: no-NO.UTF-8
microedition.encoding: UTF-8
javac.encoding: UTF-8