| Issue 69: | jad URL java.io.IOException: line too long | |
| 3 people starred this issue and may be notified of changes. | Back to list |
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%20on%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.microedition.apdu.aid
Can you help with this issue?
Thanks in advance!
Sep 17, 2010
(No comment was entered for this change.)
Status:
Duplicate
Mergedinto: 66 |
Labels: Milestone-3.0