This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Pblm with JAR/InputStream  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is code to convert XML files to a JAR file, convert the JAR file to a byte array and transfer it as a input stream.

A receiver class reads the input stream and forms a JAR file and extracts the XML files.
Occassionally I am getting a ZIPException: invalid stored block lengths while trying to form the JAR file using the input stream.

I need some help to overcome this.

Error:

ApplicationXMLReceiver, I/O Error: ,

java.util.zip.ZipException: invalid stored block lengths
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java(Compiled Code))
at java.util.zip.ZipInputStream.read(ZipInputStream.java(Compiled Code))
at java.util.jar.JarInputStream.read(JarInputStream.java(Compiled Code))at java.io.FilterInputStream.read(FilterInputStream.java(Inlined Compiled Code))
...

Thanks
 
Rancher
Posts: 3353
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, don't understand your problem Could you explain it some more.
The following is confusing:


form the JAR file using the input stream


I would interpret "form" as an output/creation step, so how is it connected to using the input stream?

Is the error occuring when writing to the jar file or when reading from it?
 
Hasan Pasha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a utility (a class called called Jar) using which we create JAR files.

Server-end
I create a JAR and add 2 XML files to this JAR and convert this JAR to byte array and write a message to a message queue.

Client-end
Read the message from the queue... get the input stream and create a Jar file (utility... it has a constructor that accepts InputStream and converts it to a JAR).

I guess I am getting this problem when I am getting the problem when reading from the JAR.

Will this be due to 'byte[] buffer = new byte[4096];'... the JAR is pbly larger than this size?

Please reply at your earliest convenient time.

 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!