java.util.zip.ZipException: invalid code lengths set" error when I try to get a bin file from the assets. I can not figure out how to fix it or what it means. Please help. My code: SentenceModel model = null; InputStream modelIn = null; try { modelIn = IOUtils.toInputStream(ReadFromfile("en-sent.bin", context)); model = new SentenceModel(modelIn); } catch (IOException e) { e.printStackTrace(); } finally { if (modelIn != null) { try { modelIn.close(); } catch (IOException e) { } } } Stack trace: 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: java.util.zip.ZipException: invalid code lengths set 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.util.zip.ZipInputStream.read(ZipInputStream.java:360) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.InputStreamReader.read(InputStreamReader.java:233) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.fillBuf(BufferedReader.java:145) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.readChar(BufferedReader.java:263) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.read(BufferedReader.java:253) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.util.Properties.load(Properties.java:289)

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Tdonut
, 1 year ago
invalid code lengths set" error when I try to get a bin file from the assets. I can not figure out how to fix it or what it means. Please help. My code: SentenceModel model = null; InputStream modelIn = null; try { modelIn
java.util.zip.ZipException: invalid code lengths set" error when I try to get a bin file from the assets. I can not figure out how to fix it or what it means. Please help. My code: SentenceModel model = null; InputStream modelIn = null; try { modelIn = IOUtils.toInputStream(ReadFromfile("en-sent.bin", context)); model = new SentenceModel(modelIn); } catch (IOException e) { e.printStackTrace(); } finally { if (modelIn != null) { try { modelIn.close(); } catch (IOException e) { } } } Stack trace: 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: java.util.zip.ZipException: invalid code lengths set 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.util.zip.ZipInputStream.read(ZipInputStream.java:360) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.InputStreamReader.read(InputStreamReader.java:233) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.fillBuf(BufferedReader.java:145) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.readChar(BufferedReader.java:263) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.io.BufferedReader.read(BufferedReader.java:253) 08-04 11:34:14.461 21060-21060/com.gigstudios.newssummary W/System.err: at java.util.Properties.load(Properties.java:289)
at java.util.Properties.load(Properties.java:248)
at opennlp.tools.util.model.PropertiesSerializer.create(PropertiesSerializer.java:34)
at opennlp.tools.util.model.PropertiesSerializer.create(PropertiesSerializer.java:29)
at opennlp.tools.util.model.BaseModel.loadModel(BaseModel.java:241)
at opennlp.tools.util.model.BaseModel.(BaseModel.java:179)
at opennlp.tools.sentdetect.SentenceModel.(SentenceModel.java:96)
at com.gigstudios.newssummary.WordCounter.makeSentences(WordCounter.java:61)
at com.gigstudios.newssummary.Article.(Article.java:19)
at com.gigstudios.newssummary.ArticleReceiver.receiveNewsArticles(ArticleReceiver.java:87)
at com.gigstudios.newssummary.ArticleReceiver.(ArticleReceiver.java:37)
at com.gigstudios.newssummary.MainActivity.fetchNews(MainActivity.java:114)
at com.gigstudios.newssummary.MainActivity$1.run(MainActivity.java:52)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.