Getting java.io.IOException: unsupported type / corrupted stream

I am sporadically getting the following exception:
(Wrapped) java.io.IOException: unsupported type / corrupted stream
     at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2162)
     at com.tangosol.util.ExternalizableHelper.readMap(ExternalizableHelper.java:1557)
     at com.tsysa.risk.SyncpointController.readExternal(SyncpointController.java:262)
     at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:1908)
     at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2199)
     at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:205)
     at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ConverterFromBinary.convert(DistributedCache.CDB:4)
     at com.tangosol.util.ConverterCollections$ConverterMap.put(ConverterCollections.java:1317)
     at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap.put(DistributedCache.CDB:1)
     at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
     at test.SyncpointController.updateStateInCache(SyncpointController.java:151) 
     at test.SyncpointController.onMapEvent(SyncpointController.java:121)
     at com.tangosol.util.MultiplexingMapListener.entryUpdated(MultiplexingMapListener.java:41)
     at com.tangosol.util.MapEvent.dispatch(MapEvent.java:195)
     at com.tangosol.util.MapEvent.dispatch(MapEvent.java:164)
     at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
     at com.tangosol.coherence.component.util.SafeNamedCache.translateMapEvent(SafeNamedCache.CDB:7)
     at com.tangosol.coherence.component.util.SafeNamedCache.entryUpdated(SafeNamedCache.CDB:1)
     at com.tangosol.util.MapEvent.dispatch(MapEvent.java:195)
     at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.dispatch(DistributedCache.CDB:22)
     at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.entryUpdated(DistributedCache.CDB:1)
     at com.tangosol.util.MapEvent.dispatch(MapEvent.java:195)
     at com.tangosol.coherence.component.util.CacheEvent.run(CacheEvent.CDB:18)
     at com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onNotify(Service.CDB:17)
     at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:35)
     at java.lang.Thread.run(Thread.java:595)I get this during a cache.put() call. Any idea what this could be about?
Thanks
Ghanshyam

This is an issue with my code. I was selectively serializing a class member and relying on EOFException to detect if the class member should be initialized during readExternal(). Following shows the situation:
public class A implements ExternalizableLite{
     private A1 a1 = null; // A1 is ExternalizableLite
     private A2 a2 = null; // A2 is ExternalizableLite
     public A(){}
     public void setA1(A1 a1){ this.a1 = a1; }
     public void readExternal(DataInput in) throws IOException {
         this.a1.readExternal(in);
         this.a2 = new A2();
         try{
             this.a2.readExternal(in);
         catch(EOFException ex){ // a2 is null
             this.a2 = null;
    public void writeExternal(DataOutput out) throws IOException {
        this.a1.writeExternal(out);
        if(this.a2 != null) this.a2.writeExternal(out);
}A map had the above class A as the value and when the map was getting serialized, I was getting the exception. I changed class A (as below) to always initialize a2 to a non-null but empty class and the error went away:
public class A implements ExternalizableLite{
     private A1 a1 = null; // A1 is ExternalizableLite
     private A2 a2 = new A2();
     public A(){}
     public void setA1(A1 a1){ this.a1 = a1; }
     public void readExternal(DataInput in) throws IOException {
         this.a1.readExternal(in);
         this.a2.readExternal(in);
    public void writeExternal(DataOutput out) throws IOException {
        this.a1.writeExternal(out);
        this.a2.writeExternal(out);
}This means needless serialization/deserialization when a2 is null but the hit is negligible. Is there a way to get around the null values?
Thanks
Ghanshyam

Similar Messages

  • Getting java.io.IOException: Too many open files+ClassNotFoundException

    Dear All
    We have a web application deployed on Rational Application Developer 6.0 (Operating System is Windows 2000 professional) our users are randomly getting java.io.IOException: Too many open files+ClassNotFoundException when they click on some servlet or jsp link, but they are getting this error randomly for example when they click some link they may get these exceptions but refreshing page or clicking once again on same link executes servlet successfully.If anyone could help on this topic we will be grateful
    Thanks

    I think this these two exceptions are occuring in differrent environment
    java.io.IOException is occuring under heavy load to web server its stack trace is as follows:
    JSPG0225E: An error occurred at line: 2 in the statically included file: /SessionCheck.jsp
    JSPG0093E: Generated servlet error from file: /Admin/AdminInsuranceCertificates.jsp
    E:\WebSphere_6\AppServer\profiles\AUSECert\temp\centraNode04\server1\AUSECert\Vero.war\Admin\_AdminInsuranceCertificates.java:259: cannot access com.bplus.natmar.LoginDetails
    bad class file: E:\WebSphere_6\AppServer\java\jre\lib\core.jar(java/io/Writer.class)
    unable to access file: E:\WebSphere_6\AppServer\profiles\AUSECert\installedApps\centraNode04Cell\AUSECert.ear\Vero.war\WEB-INF\classes\com\bplus\natmar\LoginDetails.class (Too many open files)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    (source unavailable)
    1 error
    ]: com.ibm.ws.jsp.JspCoreException: JSPG0049E: /Admin/AdminInsuranceCertificates.jsp failed to compile :
    this error always occurs in reference to logindetails class this clas is used to make a session check on different roles in our project for e.g., user having end user role should not be able to log in as a user having admin role
    we have included a sessioncheck.jsp in our every jsp page in this jsp we have simply used logindetails class as useBean and called its getresource() method
    above stacktrace is from our live application server
    while testing same project on our local system we are not getting too many open files exception but we are getting following ClassNotFoundException
    [11/30/05 17:11:42:797 EST] 0000004a SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'mainEdit.jsp' and IsEndUser=1
    [11/30/05 17:12:50:891 EST] 000001eb SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
    [11/30/05 17:17:40:828 EST] 0000008d SystemOut O AppURL is: http://www.VeroECert.com/Vero/indexU.jsp
    [11/30/05 17:17:58:141 EST] 0000008b SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
    [11/30/05 17:20:41:703 EST] 00000034 ServletWrappe E SRVE0026E: [Servlet Error]-[com.servlet.UserHelpServlet]: java.lang.ClassNotFoundException: com.servlet.UserHelpServlet
         at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
         at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
         at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
         at java.beans.Beans.instantiate(Beans.java:202)
         at java.beans.Beans.instantiate(Beans.java:63)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper$3.run(ServletWrapper.java:1384)
         at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1312)
         at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:84)
         at com.ibm.ws.webcontainer.extension.InvokerExtensionProcessor.handleRequest(InvokerExtensionProcessor.java:238)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
         at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    this error is occuring on concurrent clicks suppose three users click on same button then it is possible that one user gets correct output while other users experience this exception
    Also one more point we are not using web.xml for calling servlets we are directly calling it giving its full path.
    Thanks

  • Getting java.io.IOException when trying to run a report in BIP 11g

    Hi everyone.
    I have deployed BIP 11g (11.1.1.6.0), with no errors, and everything worked fine.
    Suddenly, when I tried to execute a report (html output), I got following error: "java.io.IOException: Permission denied".
    I wonder if you can list me possible causes of this issue.
    Regards,
    Edited by: Farid Leonardo on Dec 17, 2012 7:57 AM

    Hi Adhir,
    I ran the standalone webservice client on the unix machine and it gives me web service response.
    Is there some weblgic configuration parameter I should be looking into to see why I am not getting the response when I am calling the web service from the deployed code.

  • Java.io.IOException: Error in encoded stream: needed 4 valid base64 charact

    Hi All,
    I am getting IOException for some of the messages.
    Even though I set
       <system-property mail.mime.base64.ignoreerrors='true' />I am still getting exception
    Java version i am using is Java 1.4.2
    any help would be appreciated
    Thanks,
    Amit

    You're probably using an older version of JavaMail. The property was
    added in JavaMail 1.3.2

  • Java.io.IOException: Too many open files while deploying in soa 11g

    hi all,
    I am getting a strange error while deploying any composite .. it's a hello world kinda composite but while i am trying to deploy it i am getting "java.io.IOException: Too many open files" while deployment.. i have tried to deploy it in 2-3 ways but all of them resulted in the same error..bouncing the soa server might be an option but can someone give an insight as why it is happening and can it be resolved without restarting the server..
    Thanks

    yes..so this problem is with unix only ..coz i previously worked in Windows ..never got this problem..

  • OPP log shows java.io.IOException: HTTPS hostname wrong:

    Hi All -
    While running BI Publisher programs in R12.1.3 instance , we are getting below error.
    [11/14/11 10:02:33 PM] [UNEXPECTED] [82134:RT731346] java.io.IOException: HTTPS hostname wrong: should be <test0va1.mia.abc.com>
    Can anyone please help ?
    Regards

    The error is reported in these docs but I do not think it is helpful.
    Pdf Export On Worklist Throws HTTPS Hostname Wrong Exception [ID 1118694.
    E-IB: Getting "java.io.IOException: HTTPS hostname wrong: should be <*.*.*.*>, but cert says..." on Accessing External Web Service Node over HTTPS [ID 1163124.1]
    Encountering excpetion when calling an external Web Service: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed [ID 1029108.1]
    Please log a SR.
    Thanks,
    Hussein

  • Java.io.IOException: Connection failure with 400

    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    This occurrs when using getInputStream()
    The URL can be cut and pasted into the browser and it works fine, but when the code executes and only using the plugin it gives this error.
    Any ideas??

    One of my customers is getting :
    java.io.IOException: Connection failure with 400
         at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    ...too, on this snippet of code:
    java.io.InputStream aInputStream=aURLConnection.getInputStream();
    Anybody find a cause or solution for this? I believe my customer is using JRun.
    Thanks in advance.

  • Java.io.IOException: error in poll: Input/output error

    Hello,
    My server is running on Linux 7.1, IBM JDK 1.3 and WLS 6.1. When the
    following error is thrown in weblogic.log, the server is stopped by this
    error. This error keeps happening once it occurs for about every one second.
    ####<Dec 23, 2001 3:12:46 AM SGT> <Error> <Posix Performance Pack>
    <MyPC.1st-cube.com> <myserver> <ExecuteThread: '12' for queue:
    'default'><><><000000> <Uncaught Throwable in processSockets>
    java.io.IOException: error in poll: Input/output error
    at weblogic.socket.PosixSocketMuxer.poll(Native Method)
    at
    weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:371)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Can anyone help?
    Thanks.
    Regards,
    Mo

    I too am seeing a slight variation of this error with JM 1.3.1. Unfortunately, the message has since been deleted. Any ideas?
    java.io.IOException: Error in encoded stream, got 2
    at com.sun.mail.util.BASE64DecoderStream.decode(BASE64DecoderStream.java:148)
    at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:53)
    at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:78)
    at java.io.FilterInputStream.read(FilterInputStream.java:90)
    at javax.activation.DataHandler.writeTo(DataHandler.java:289)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:668)
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
    at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:67)
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
    at javax.activation.DataHandler.writeTo(DataHandler.java:295)

  • Java.io.IOException: Corrupt GZIP trailer

    I have some code to gunzip a byte array of data. I've used this code frequently and it works well. However, I just tried unzipping a byte[] array that is 4,529,218 bytes which expands to a file that is 2,157,763,194 bytes (on an SGI).
    I get a:
    java.io.IOException: Corrupt GZIP trailer
    thrown from the while ( ( length = zipin.read(buffer, 0, sChunk) ) != -1) line below.
    I did a quick Google search and found these links:
    http://www.aoindustries.com/docs/aocode-public/com/aoindustries/util/zip/CorrectedGZIPInputStream.html
    http://www.sanger.ac.uk/Software/Artemis/artemis_docs/uk.ac.sanger.pathogens.WorkingGZIPInputStream.html
    with comments like:
    Works around the "Corrupt GZIP trailer" problem in GZIPInputStream by catching and ignoring this exception.
    A wrapper class to work around a bug in GZIPInputStream. The read() method sometimes throws a IOException complaining about a Corrupt GZIP trailer on the jdk 1.1.8-13 on the Alphas. This wrapper catches and ignores that exception.
    The code below writes out the correct number of bytes to the filesystem, but I get the IOException. From my Google search, it appears that some people have run into this problem before. Does anyone here know if this is a bogus error, or if it is valid? Is this a known "bug" in Java?
    Note: the file size is larger than the Integer.MAX_SIZE. Is there an integer somewhere in the code that checks the trailer that was exceeded because of the file size?
    (I ommited some catch code to make reading it easier)
    private void gunzip(byte[] data, File file)
        int sChunk = 8192;
        // create input stream
        GZIPInputStream zipin;
        try
            ByteArrayInputStream in = new ByteArrayInputStream(data);
            zipin = new GZIPInputStream(in);
        catch (IOException e)
            // omitted for clarity
        byte[] buffer = new byte[sChunk];
        FileOutputStream out = null;
        // decompress the data
        try
            out = new FileOutputStream(file);
            while ( ( length = zipin.read(buffer, 0, sChunk) ) != -1) // error here
                out.write(buffer, 0, length);
        catch (IOException e)
            // omitted for clarity
        finally
            try
                out.close();
                zipin.close();
            catch(IOException e)
                // omitted for clarity
    }

    In GZIPInputStream.java:
         * Reads GZIP member trailer.
        private void readTrailer() throws IOException {
         InputStream in = this.in;
         int n = inf.getRemaining();
         if (n > 0) {
             in = new SequenceInputStream(
                   new ByteArrayInputStream(buf, len - n, n), in);
         long v = crc.getValue();
         if (readUInt(in) != v || readUInt(in) != inf.getTotalOut()) {
             throw new IOException("Corrupt GZIP trailer");
        }This line
    if (readUInt(in) != v || readUInt(in) != inf.getTotalOut())appears to be verifying the CRC value and data size from the trailer with data actually read from the stream.
    The inf.getTotalOut() returns an integer. My file size is greater than a 32 bit integer value.
    I looked at the GZip file specification at:
    http://www.faqs.org/rfcs/rfc1952.html
    and see that the trailer input size is defined as:
    ISIZE (Input SIZE)
                This contains the size of the original (uncompressed) input
                data modulo 2^32.I assume data modulo 2^32 means that this is supposed to be a 32 bit integer.

  • Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 404 Not Found

    In my 2006 biztalk application I have exposed web service to receive SAP input. It was working fine. After I have modified something in orchestration in that application . I am getting following error while SAP try to consume my web service. Can anyone please
    help me.
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 404 Not Found

    In my 2006 biztalk application I have exposed web service to receive SAP input. It was working fine. After I have modified something in orchestration in that application . I am getting following error while SAP try to consume my web service.
    HI Arivazhagan K,
    Could you give some explanation about what you modified? according the to error message, this is "resource is not found issue".
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SOAP: error occured: java.io.IOException: invalid content type for SOAP: TE

    Hi,
    We are implementing an XI scenario as follows: Mail Adapter->XI->SOAP Receiver.
    Basically, we pass the XML File attachment from the Mail Adapter through XI to the SOAP Adapter. However, we keep getting the following error:
    <i>SOAP: error occured: java.io.IOException: invalid content type for SOAP: TEXT/HTML</i>
    Any ideas on where we could look to fix this problem?
    Thanks,
    EC

    People,
    most of errors like that are 401 (unauthorized), 403 (forbidden), 404 (not found) and so on. To be sure, check the message content that comes back from the webservice, in the Message Monitoring.
    Obs: To visualize sync messages payload in Message Monitoring, you'll have to set the Messaging.syncMessageRemover.removebody parameter to <i>false</i> (default is <i>true</i>) in SAP XI AF Messaging service, in the Visual Administrator.
    Regards,
    Henrique.

  • Java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 200 OK

    hi all,
    please help me to resolve the error. i am working on a proxy to soap scenario and in SXMB_moni i am getting the following error.
    i had check my url,its working fine.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 200 OK</SAP:AdditionalText>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>*
    thanks
    kasturika

    Check this thread
    Receiver SOAP Adapter Error: invalid content type for SOAP: TEXT/HTML
    might give you some directions to look at.
    Sameer

  • Reason Of Error java.io.IOException: invalid content type for SOAP: TEXT/HT

    Hi All,
    I am getting an error, when I am sending message from few BPM's to a common Webservice Synchronously.
    Delivery of the message to the application using connection AFW failed, due to: java.io.IOException: invalid content type for SOAP: TEXT/HTML. Setting message to status failed.
    Previously, it was working fine. But today I am getting the errors. Could any one please explain, what exactly the reason is. I searched the Forum, but didnt find a proper resolution. We are sending the same set of data to the Webservice, which we were sending before. Please suggest.
    Regards,
    Subhendu

    Hi Vijay,
    I am wondering,Without this module, how it was working fine for so many days. Could you please throw light?
    Regards,
    Subhendu

  • EROR: java.io.IOException: invalid content type for SOAP: TEXT/HTML

    hi group,
    my problem is related to scenario HTML to WebService in which im trying to send a request to a free webservice on internet and retrieving the response back and showing it in my html page.
    scenario in detail:
    i have a html page deployed on my tomcat server at my local m/c. in which im taking a email string and sending it to webservice which checks whether the email string has a valid email format or not and in response, webservice returns a boolean true/false depending on the email string. i want to show this boolean result n my html page.i have configured HTTP adaptor and SOAP adaptor for this and interfaces are scynchronus.
    im able to send my request to webservice and getting the response also...i checked in trace..it shows message request sent and response recieved...here is the trace..
    http://hcl3sap:50000/MessagingSystem/receive/AFW/XI</Trace>
      <Trace level="3" type="T">User = PIISUSER</Trace>
      <Trace level="3" type="T">Cached =</Trace>
      <Trace level="3" type="T">Creating HTTP-client</Trace>
      <Trace level="3" type="T">HTTP-client: creation finished</Trace>
      <Trace level="3" type="T">Security: Basic authentication</Trace>
      <Trace level="3" type="T">Serializing message object...</Trace>
      <Trace level="3" type="T">HTTP-client: sending http-request...</Trace>
      <Trace level="3" type="T">HTTP-client: request sent</Trace>
      <Trace level="3" type="T">HTTP-client: Receiving http-response...</Trace>
      <Trace level="3" type="T">HTTP-client: response received</Trace>
      <Trace level="3" type="T">HTTP-client: checking status code...</Trace>
      <Trace level="3" type="T">HTTP-client: status code = 200</Trace>
      <Trace level="3" type="T">Deserializing message object...</Trace>
      <Trace level="3" type="T">HTTP-client: closing...</Trace>
      </Trace>
    but i get an error java.io.IOException: invalid content type for SOAP: TEXT/HTML after that,
    Does anyone know where im going wrong....
    regrds

    you are very correct..i used SOAP reciever as http://www.webservicex.net/ValidateEmail.asmx?wsdl and SOAP Action as http://www.webservicex.net/IsValidEmail but getting the same error.
    and if you look in the trace above it says that my request actually went to webservice and got a response also (response code 200)  but i think after recieving the message from webservice something is wrong. either mapping is not correct...(but i tested that ..it works fine) or could be my company firewall is prohibiting the message sent by webservice to XI server (i have given proxy settings with password also)...im NOT sure on this ....
    second thing i noticed in moni while examining the trace was....message payload under "Message Branch According to Receiver List " shows this value
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:IsValidEmail xmlns:ns1="http://www.webservicex.net">
      <ns1:Email>samWhgf.com</ns1:Email>
      </ns1:IsValidEmail>
    and then in just next step "Request Message Mapping" payload is 
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns1:IsValidEmail xmlns:ns1="http://www.webservicex.net" />
    i dont know really why payload is getting appended and if it is correct or not? but after this step further payload goes in this appended format only till call adaptor...if this is so i assume my message is going to webservice as
      <?xml version="1.0" encoding="UTF-8" ?>
      <ns1:IsValidEmail xmlns:ns1="http://www.webservicex.net" /> 
    which is not the proper format to be recieved by the webservice without any input value i.e "samWhgf.com"
    im confused on this ..whether this is the route cause or any other...i have been trying to figure out the root cause from some days but still unsuccessful.
    please provide ur valuable inputs.
    regrds
    Sameer

  • How to solve java.io.IOException: Corrupt form data: premature ending

    hei evryone!
    Does anyone knows how to solve this bug?
    java.io.IOException: Corrupt form data: premature ending
    Im using Oreilly's cos.jar MultipartRequest
    here is my form :
    <FORM METHOD="POST" NAME="uploadform" action="mbbfile" ENCTYPE="multipart/form-data">
    <TR>
    <TD>Select a File:</TD>
    <TD><INPUT TYPE="FILE" NAME="srcfile" style="width:400px"/></TD>
    </TR>
    <TR><TD><INPUT TYPE="SUBMIT" VALUE="Send"/></TD></TR>
    </FORM>
    HERE IS mbbfile which is a servlet :
    package mbb.servlet;
    import java.io.IOException;
    import java.sql.Connection;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.oreilly.servlet.MultipartRequest;
    import org.jconfig.Configuration;
    import org.jconfig.ConfigurationManager;
    public class MBBFileServlet extends HttpServlet{
         private static final Configuration conf = ConfigurationManager.getConfiguration("ConfigFile");
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              String filePath = conf.getProperty("FilePath", "", "test");
              try{
              MultipartRequest multi = new MultipartRequest(req,filePath,5*1024*1024);
              }catch(Exception e){
                   System.out.println("MBBFileServlet Exception ---> "+e.getMessage());
         public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              doGet(req,res);
    Sometimes it works meaning the file is uploaded in the directory without any exception, sometimes the file is uploaded but with exception on the log saying "MBBFileServlet Exception ---> Corrupt form data: Premature Ending". and sometimes the files is not uploaded at all and when i check the error is : "MBBFileServlet Exception ---> Corrupt form data: Premature Ending". Can anyone please help me on this matter. Thx!
    Your response would be deeply appreciated.
    br,
    TAC

    Hi all!
    Since I've spent some days now trying to figure out what was wrong with my file upload in Struts 1.1, I would like to share my solution with the rest of you in order to spare you for the same amout of wasted time I've spent :-)
    My platform is Resin 3.0.8 and Struts 1.1. My problem was that JPEG's got corrupted when arriviving at the server. After a few days searching on the net, I tried with a plain servlet and the O'Reilly package, and the app worked perfect.
    Here is my servlet:
    package no.yourcompany.yourapp.servlet;
    import com.oreilly.servlet.multipart.MultipartParser;
    import com.oreilly.servlet.multipart.Part;
    import com.oreilly.servlet.multipart.FilePart;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletException;
    import javax.servlet.ServletContext;
    import javax.servlet.RequestDispatcher;
    import java.io.IOException;
    import java.io.ByteArrayOutputStream;
    public class ImageUpload extends HttpServlet {
    private static final String PAGE_RECEIPT = "/popImageUploadReceipt.do";
    private static final int MAX_FILE_SIZE_IN_BYTES = 10000000; // 10 M
    * Extracts image from request and puts it into person form.
    * @see HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    // custom beans from my project, not defined here
    PersonRegistrationForm personRegistrationForm = null;
    PortraitImage portraitImage = null;
    ByteArrayOutputStream outputStream = null;
    Part currentPart = null;
    FilePart currFilePart = null;
    personRegistrationForm = (PersonRegistrationForm) request.getSession().getAttribute(DsnSessionKeyConstantsIF.KEY_PERSON_FORM);
    portraitImage = personRegistrationForm.getPortraitImage();
    try {
    MultipartParser parser = new MultipartParser(request, MAX_FILE_SIZE_IN_BYTES);
    while ((currentPart = parser.readNextPart()) != null) {
    if (currentPart.isFile()) {
    currFilePart = (FilePart) currentPart;
    outputStream = new ByteArrayOutputStream();
    currFilePart.writeTo(outputStream);
    // portraitImage is just a bean for encapsulating image data, not defined in this posting
    portraitImage.setContentType(currFilePart.getContentType());
    portraitImage.setImageAsByteArray(outputStream.toByteArray());
    portraitImage.setOriginalFileName(currFilePart.getFileName());
    break;
    } // if (currentPart.isFile())
    } // while ((currentPart = parser.readNextPart()) != null)
    } catch (IOException ioe) {
    // noop
    // redirect to receipt page
    ServletContext servletContext = this.getServletContext();
    RequestDispatcher requestDispatcher = servletContext.getRequestDispatcher(PAGE_RECEIPT);
    requestDispatcher.forward(request, response);
    } // doPost
    } // ImageUpload
    AND ADD THIS TO YOUR WEB.XML
    <servlet>
    <servlet-name>ImageUpload</servlet-name>
    <servlet-class>no.yourcompany.yourapp.servlet.ImageUpload</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ImageUpload</servlet-name>
    <url-pattern>imageUpload.do</url-pattern>
    </servlet-mapping>
    AND THE HTML-FORM IS HERE
    <form action="/yourapp/imageUpload.do" method="post" enctype="multipart/form-data" accept="image/*">
    <p>
    <input type="file" name="portraitImage" />
    </p>
    <p>
    <input type="image" src="/dsn/img/btn_last_bilde.gif" border="0">
    </p>
    </form>

Maybe you are looking for