• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Upload Excel using IO and servlet

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm having a difficulty in uploading a Excel file from my standalone java client to server using servlet.At the server side servlet throws

"I/O exception:Is not in GZIP format" {Thrown by GZIPInputStream}

Note:It is thrown exactly at "in = new GZIPInputStream( in );" (line in the servlet code).I've no clue how this exception is thrown and why uploading of file is not appening.Will be great help if you all ready to help me to address the issue.Thanks in advance

My client code
---------------



servlet code is
===================

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I just run your code using HttpClient 3.1. and it working absolutely fine. I didnt get any such exceptions....

I changed nothing except the url of the post method action.
 
Prashanth Bhanu
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chandan,

Thanks for your prompt reply and testing the code.I'm also using commons-httpclient-3.1.jar in my client projects class path.I've copy and pasted the exact exception i'm getting at the server this might give if at all some thin is wrong at my servlet end..Please suggest....

[8/23/08 22:18:04:944 SGT] 00000030 FileRepositor A ADMR0010I: Document cells/MYD332SD1SNode01Cell/applications/ECHO_magellan_srv_ear.ear/deployments/ECHO_magellan_srv_ear/deployment.xml is modified.

[8/23/08 22:18:37:507 SGT] 00000025 ServletWrappe I SRVE0242I: [ECHO_magellan_srv_ear] [/ECHO_magellan_srv_web] [UploadZipServlet]: Initialization successful.

[8/23/08 22:18:43:366 SGT] 00000025 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: UploadZipServlet. Exception thrown : java.io.IOException: Not in GZIP format

at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:156)

at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java)

at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java)

at com.scb.web.download.UploadZipServlet.doPost(UploadZipServlet.java)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)

at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)

at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)

at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
 
Prashanth Bhanu
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,


I'm still having trouble in uploading the Excel file to load to the server.Do we have to do any server specific setting(like MIME etc..) for the server to accept GZIP files.....I'm not sure where the problem is...

Thanks in advance
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic