mariomac / microemu

Automatically exported from code.google.com/p/microemu
0 stars 0 forks source link

jad URL java.io.IOException: line too long #69

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

We are trying to make run a MIDlet in the emulator that stores very long lines 
as user defined attributes in the JAD and we get this error:

java -cp microemu-2.0.4.jar org.microemu.app.Main xxx/xxx.jad

          org.microemu.app.Main.main(Main.java:1031)
openJad [file:///C:/Projects/xxx/xxx.jad]
          org.microemu.app.Common.openMIDletUrl(Common.java:371)
error Cannot load file:///C:/Projects/xxx/xxx.jad URL java.io.IOException: line 
too long
          org.microemu.app.Common.initMIDlet(Common.java:991)
java.io.IOException: line too long
        at java.util.jar.Attributes.read(Attributes.java:362)
        at java.util.jar.Manifest.read(Manifest.java:182)
        at org.microemu.app.Common.loadJadProperties(Common.java:971)
        at org.microemu.app.Common.openMIDletUrl(Common.java:372)
        at org.microemu.app.Common.openMIDletUrl(Common.java:248)
        at org.microemu.app.Common.initMIDlet(Common.java:989)
        at org.microemu.app.Main.main(Main.java:1064)

Actually, to use "java.util.jar.Manifest" to read a JAD is totally wrong due 
the format is different.

They add line breaks to enforce a maximum 72 bytes per line. It is part of 
their specs:
http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Notes%20o
n%20Manifest%20and%20Signature%20Files

"

    * Line length:

No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. 
If a value would make the initial line longer than this, it should be continued 
on extra lines (each starting with a single SPACE).

"

JAD files doesn't have this limitation:
http://developers.sun.com/mobility/learn/midp/lifecycle/#jadsnjars

Example

MANIFEST.MF

MIDlet-Permissions: javax.microedition.io.Connector.http,javax.microed
 ition.io.Connector.https,javax.microedition.io.PushRegistry,javax.mic
 roedition.content.ContentHandler,javax.microedition.apdu.aid

JAD

MIDlet-Permissions: 
javax.microedition.io.Connector.http,javax.microedition.io.Connector.https,javax
.microedition.io.PushRegistry,javax.microedition.content.ContentHandler,javax.mi
croedition.apdu.aid

Can you help with this issue?

Thanks in advance!

Original issue reported on code.google.com by jose...@gmail.com on 10 Sep 2010 at 9:08

GoogleCodeExporter commented 8 years ago

Original comment by bar...@gmail.com on 16 Sep 2010 at 2:26

GoogleCodeExporter commented 8 years ago

Original comment by bar...@gmail.com on 17 Sep 2010 at 10:31