Toolkit.createImage(): Premature end of JPEG file

I'm having an issue where some images I am loading through the createImage or getImage methods in the Toolkit will cause "Premature end of JPEG file" to be output to the console. Java seems to do its best to mask the problem by returning a valid image.
My problem is not "Why am i getting this error!!!!"; it is reasonable for this to occur in some cases. I want to be able to catch this in the code, but no exceptions are thrown and an image is returned (it's just missing a lot of pixels) when this problem occurs. How can I be notified if an image was corrupt? I have tried out MediaTracker but this provided no help.
I appreciate any help you can provide!
Sample code:
Toolkit tk = Toolkit.getDefaultToolkit();
Image img = tk.createImage(fileName);
or
Image img= tk.getImage(fileName);

I'm having the same problem with JDK142 in the following case
a) linux machine with an experimental web server in c++
b) windows machine running a client applet
the machine (b) ask the server in (a) for images, but sometimes, even when the image exists in the server I display it incorrectly and I have the same error, but after the application exits
I guess it's some problem with the experimental server, but anymode I would like to know if there is any problem before display a wrong image ...
If someone knows how to solve it, please write back
Yours
Joe

Similar Messages

  • Display incomplete image: Premature end of JPEG file

    Hello people,
    My problem is that displaying an image with incomplete data works fine, apart from that the following error message is printed out: Premature end of JPEG file
    The picture looks perfect (the missing part is rendered in gray), but I want to get rid of the error message.
    //init
    File jpegFile = new File("picture.jpg");
    FileInputStream inputStream = new FileInputStream(jpegFile);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    //step 1: downloading the image
    byte buffer[] = new byte[bufferSize];
    int bytesRead;
    while( bytesRead = input.read( buffer ) ) >= 0 )
            output.write( buffer, 0, bytesRead );
    //step 2: create (and display) incomplete image (download not finished yet)
    byte byteArray[] = outputStream.toByteArray();
    Image img = Toolkit.getDefaultToolkit().createImage( byteArray );Thanks for help,
    Martin

    Recreate the JPG image in your graphics editor - it is
    corrupted.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "wuest" <[email protected]> wrote in message
    news:e20uth$pme$[email protected]..
    > Have just used the assets panel for the first time...
    tried to create a
    > template... an image showed up and then this unending
    message kept
    > appearing
    > ... "premature end of jpeg file" and no matter how many
    times you click it
    > stil
    > keeps reappearing... please, can someone put me out of
    my misery?
    >
    > thanks.
    >

  • After Edit Library Item-  "Premature end of JPEG file"

    Hello, I'm using Windows 7 Home Premium 64-bit.  In DW CS5 after editing a Library item and saving, DW asks if it should update pages containing the item.  I tell it to go ahead, and after some processing I get an error box titled "JPEG Library Error."  The message is "Premature end of JPEG file."  Nothing else except "OK"!  I can't imagine what this is referring to or if the error is causing the pages to not be updated with the edited lbi.  I don't have any JPEG images i nthe Library item.  Here's a link to the Libraty item:
    http://www.techno-archive.com/Library/bottom_menu.lbi
    After I dismiss the error in DW the Update Pages dialog sits there with the Done button grayed out.  The bottom few lines of the log look like this:
    updated gallery_rec\trees\firetree\firetree-sky2.html
        item Library\bottom_menu.lbi
    updated gallery_rec\trees\firetree\firetree-tree1.html
        item Library\bottom_menu.lbi
    updated gallery_rec\trees\firetree\firetree-tree2.html
        item Library\bottom_menu.lbi
    updated gallery_rec\trees\firetree\firetree-tree3.html
        item Library\bottom_menu.lbi
    updated gallery_rec\trees\firetree\firetree.html
        item Library\bottom_menu.lbi
    Done.
      files examined: 641
      files updated: 641
      files which could not be updated: 0
    total time: (0:00:19)
    Updating F:\techno-archive\
    Done.
      files examined: 15697
      files updated: 0
      files which could not be updated: 0
    total time: (0:00:57)
    It doesn't tell which pages got updated and which didn't or why those that didn't did not get updated.
    Any ideas anybody?
    Thanks, - Dave

    Update- Solved!
    An answer to this thread dated April 30, 2009 of the same subject by David_Powers, community Professional, did the trick.  I wound up renaming the DW Configuration folder in C:\Users\dmckeen\AppData\Roaming\Adobe\Dreamweaver CS5\en_US\Configuration (where dmckeen is my username) and letting DW rebuild it.
    Thanx

  • Error Message: Premature end of JPEG file

    I put a WORD text box on the front page of my association's
    webpage thru Contribute. When it was time to remove it, I tried,
    but kept getting a message: Premature end of JPEG file... I finally
    gave up and had a web designer remove the box but I still get the
    same message... once i hit cancel often enough, it closes
    Contribute altogether.!
    I have also received a message that there is a DRAFT of the
    page ....but no where do I find it.
    HELP!!!

    I think you have corrupted jpeg-file (image) in your page.
    Can you post an url to the page?
    Concerning the draft: are you the only publisher to the
    website or are there other users that might have a draft saved.
    About drafts saved on your computer:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16657&sliceId=2
    On the server:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401480&sliceId=2

  • Premature end of jpeg file回避

    初めて利用します。ここに質問を記入したらよろしいのかと思いますが、宜しくお願いします。
    CONTRIBUTE CS5です。
    premature end of jpeg file
    このエラーの回避方法をお教えください。

    Hail amol... I have this same problem...
    You already solve this problem? If yes, please, how you do that... :)
    thanks

  • Premature end of JPEG File

    Hello all,
    I am facing some problem with "Premature end of JPEG File".
    Friends, I am packing all the content (xml, jpeg, audio files) using ZipFile.
    Everything works fine and the zip file is ready.
    Now when I am trying to retrieve image file from this zip file I found a strange thing. The bytes available are same as the file size but when I am executing following code.
    pseudocode is.
    get image_input_stream from zip_stream.
    get byte[] from image_input_stream
    ImageIcon imgIcon = new ImageIcon( my_byte_array_from_zipstream );
    any idea/help is welcome.
    Smiles,

    Hail amol... I have this same problem...
    You already solve this problem? If yes, please, how you do that... :)
    thanks

  • Premature end of JPEG fie

    I'm getting an error message when I start up Dreamweaver. The
    box is headed JPEG Library Error and contains the message
    "Premature end of JPEG file".
    Anyone seen this before?
    Allen

    Correct. Call it accidental plagiarism. I now remember that's
    where I heard
    it.
    Walt
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:eolind$4hs$[email protected]..
    > wouldn't have a place to put it[1]
    >
    > ------------------
    > [1]
    > Steven Wright
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    > ==================
    >
    >
    > "Walt F. Schaefer" <[email protected]> wrote
    in message
    > news:eolhlb$371$[email protected]..
    >>> but we can't have everything.
    >>
    >> Actually you can, but you probably wouldn't have a
    place to put it.
    >> :-)
    >>
    >> Walt
    >>
    >> "allen.brown" <[email protected]>
    wrote in message
    >> news:eold6j$r7h$[email protected]..
    >>> OK, for the benefit of anyone who searches this
    forum for this problem
    >>> in the
    >>> future, it seems that DW checks all the images
    in a site as it opens it
    >>> and
    >>> gives this message if an image is corrupt.
    >>>
    >>> I took the approach of moving half the images in
    Explorer and then
    >>> swapping
    >>> into a different site and back to see if DW
    still complained.
    >>> Eventually I
    >>> narrowed it down to the culprit and removed it.
    I noticed later that
    >>> this file
    >>> wouldn't preview in Explorer so that would have
    been a shortcut to the
    >>> culprit.
    >>>
    >>> A message saying 'image file xxxx.jpeg is
    corrupt' would be a lot more
    >>> helpful
    >>> but we can't have everything.
    >>>
    >>> Allen
    >>>
    >>
    >>
    >
    >

  • Detecting a truncated JPEG file

    I'm building a simple applet to display a JPEG file. Often times the file will be truncated. That is, the applet will read the file while it is being updated. When this happens, a partial JPEG displays. I would like to detect this situation, wait a little bit, then reload the image from the server.
    I have defined an imageUpdate method for the applet in hopes that an ImageObserver.ERROR flag would be passed in when the incomplete JPEG is read. This does not happen. Instead, when the applet is terminated, the message "Premature end of JPEG file" is output to the Java Console. I cannot detect what is outputting this note.
    I'm working with JDK1.1 to maintain browser compatibility and would prefer to not have to parse the JPEG file myself. Any ideas on something I should try next?
    Jason
    [email protected]

    I have also setup a MediaTracker for the image, then used the various error checking methods to check for error. Nothing is reported in error.

  • JAI can't load jpeg image, premature end of data segment error

    Hi,
    I have a customer sending in a jpeg image and I tried to use JAI to open the image. But the program throws the following error:
    However, I can see the jpeg file on Windows, and open it using Windows Picture/Paint etc software.
    Corrupt JPEG data: premature end of data segment
    Error: Cannot decode the image for the type :
    Occurs in: com.sun.media.jai.opimage.CodecRIFUtil
    java.io.IOException: Premature end of input file
         at com.sun.media.jai.codecimpl.CodecUtils.toIOException(CodecUtils.java:76)
         at com.sun.media.jai.codecimpl.JPEGImageDecoder.decodeAsRenderedImage(JPEGImageDecoder.java:48)
         at com.sun.media.jai.opimage.CodecRIFUtil.create(CodecRIFUtil.java:88)
         at com.sun.media.jai.opimage.JPEGRIF.create(JPEGRIF.java:43)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:102)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at com.sun.media.jai.opimage.FileLoadRIF.create(FileLoadRIF.java:144)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:770)
    PlanarImage image = img.createInstance();
    Thanks a lot for the help,

    I'm having this issue too - did you find any more information on this?

  • Help - Premature end of file Exception while using saaj

    Hi Everyone,
    I have written a sample saaj client, with a string as an attachment and trying to send it to a servlet as shown in the example below:
    * SaajClient.java
    * Created on June 23, 2004, 5:49 PM
    * @author Krishna Menon
    import javax.xml.soap.*;
    import javax.xml.messaging.URLEndpoint;
    public class SaajClient {
    public SaajClient() throws Exception
    try{
    SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
    SOAPPart soapPart = soapMessage.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPHeader header = envelope.getHeader();
    SOAPBody body = envelope.getBody();
    header.detachNode();
    String str = "Something a;alskdjf;laksjdfl;akjsdf;lk ;alskdjfl;asjdfl;ajk ;kdls a;kl";
    if(soapMessage != null)
    AttachmentPart attachment = soapMessage.createAttachmentPart();
    attachment.setContentType("text/plain");
    attachment.setContent(str,"text/plain");
    attachment.setContentId("Sample_String");
    soapMessage.addAttachmentPart(attachment);
    soapMessage.saveChanges();
    SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
    URLEndpoint endpoint = new URLEndpoint("http://10.2.1.132:8080/WebServices/servlet/AttachmentReceiver");
    SOAPMessage response = connection.call(soapMessage,endpoint);
    response.writeTo(System.out);
    }catch(Exception e)
    System.out.println("Caught in constructor");
    e.printStackTrace();
    public static void main(String args[])
    try
    SaajClient client = new SaajClient();
    }catch(Exception e)
    e.printStackTrace();
    When I run the above program, it is giving the following exception:
    Caught in constructor
    javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:110)
    at SaajClient.<init>(SaajClient.java:58)
    at SaajClient.main(SaajClient.java:74)
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:1753)
    at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:105)
    ... 2 more
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1139)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
    ... 7 more
    If anybody has a solution for it, please post it here.
    Thanks in advance,
    With Regards,
    Krishna Menon. B.

    Hi
    Actually the problem is not with the client but with the servlet I think. In the servlet, I am able to retrieve the attachment and print its content. After receiving the Message, I am creating a new message and populating its body with a new child element and returning the message back to the client. Just Before returning the message, I am getting the Axis Fault error in the log file. I am giving the code for the Servlet I have used below:
    * AttachmentReceiver.java
    * Created on June 23, 2004, 7:11 PM
    * @author Krishna Menon
    import java.util.Iterator;
    import javax.servlet.ServletException;
    import javax.xml.messaging.JAXMServlet;
    import javax.xml.messaging.ReqRespListener;
    import javax.xml.soap.AttachmentPart;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPFactory;
    * Servlet that accepts a SOAP message and looks through
    * its attachments before sending the SOAP part of the message
    * to the console and sending back a response
    * @author Krishna Menon
    public class AttachmentReceiver extends JAXMServlet implements ReqRespListener {
    private MessageFactory fac;
    public void init() throws ServletException {
    try {
    fac = MessageFactory.newInstance();
    catch( Exception ex ) {
    System.out.println("In AttachmentReceiver init");
    ex.printStackTrace();
    throw new ServletException( ex );
    // This is the application code for handling the message.. Once the
    // message is received the application can retrieve the soap part, the
    // attachment part if there are any, or any other information from the
    // message.
    public SOAPMessage onMessage( SOAPMessage message ) {
    System.out.println( "On message called in receiving servlet" );
    try {
    System.out.println( "\nMessage Received: " );
    System.out.println( "\n============ start ============\n" );
    // dump out attachments
    System.out.println( "Number of Attachments: " + message.countAttachments() );
    int i = 1;
    for( Iterator it = message.getAttachments(); it.hasNext(); i++ ) {
    AttachmentPart ap = (AttachmentPart) it.next();
    System.out.println( "Attachment #" + i + " content type : " +
    ap.getContentType() );
    System.out.println("Attachment Content ::"+ap.getContent());
    // dump out the SOAP part of the message
    SOAPPart soapPart = message.getSOAPPart();
    System.out.println( "SOAP Part of Message:\n\n" + soapPart );
    System.out.println( "\n============ end ===========\n" );
    SOAPMessage msg = fac.createMessage();
    SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
    SOAPFactory soapFactory = SOAPFactory.newInstance();
    System.out.println("Before getBody");
    env.getBody().addChildElement(soapFactory.createName("MessageResponse")).addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
    System.out.println("After getBody");
    //addChildElement("MessageResponse").addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
    msg.saveChanges();
    System.out.println("After Msg Save Changes");
    return msg;
    catch( Exception e ) {
    System.out.println("From OnMessage() of AttachmentReceiver");
    e.printStackTrace();
    return null;
    This is generating the following series of errors in the catalina.out (Tomcat4.1 error log ) file:
    On message called in receiving servlet
    Message Received:
    ============ start ============
    Number of Attachments: 1
    Attachment #1 content type : text/plain
    SOAP Part of Message:
    org.apache.axis.SOAPPart@16fdac
    ============ end ===========
    - java.io.IOException:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.ClassCastException
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace: java.lang.ClassCastException
         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
         at org.apache.axis.Message.writeTo(Message.java:440)
         at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
         at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)
    java.lang.ClassCastException
         at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:272)
         at org.apache.axis.Message.writeTo(Message.java:440)
         at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
         at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.ClassCastException
         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
         ... 33 more

  • Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    Hi folks,
    I am using a cascaded mapping in my OM. I have a graphical mapping followed by the Java mapping. It is a flat file to IDOC mapping. Everything works fine in Dev but when I transport the same objects to QA, the Operation mapping though it doesn't fail in ESR testing tool, gives the following message and there is no output generated for the same payload which is successfully tested in DEV. Please advise on what could be the possible reasons.
    Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    kalyan,
    There seems to be an invalid xml payload which causes this error in ESR not generating the tree view. Please find the similar error screenshot and rectify the payload.
    Mutti

  • Empty file handling in Receiver File adapter (FCC - Premature end of file)

    Hi
    My interface is Flat file to Flat File interface with file content conversion which is working fine in SAP PI 7.1 EHP1.
    If I want to process the empty file from sender system, PI should place the same empty file in the receiver FTP Location as per my requirement.
    I am facing the below error message when PI tries to place the empty file.
    Message processing failed. Cause: org.xml.sax.SAXParseException: Premature end of file.
    But if I am not using FCC, I am able to get the empty file at the receiver end.
    Please suggest on this, If I am using FCC in the receiver side.
    Thanks
    Gabriel

    Hi Gabriel,
                       You can write a simple script to copy a file from source folder to target in case the fiel size is ZERO bytes. The script will not copy the file if the filesize is more than zero bytes, This will be processed normally by PI server. You can call the script from sender communication channel parameter : "RUN OS command before message processing". Could you please specify the Operating System (OS) you are using in your PI server.
    Regards
    Anupam

  • FILE_to_RFC  (Premature end of file)

    Hello,
    I'm trying to setup a FILE_to_RFC connection.
    Let me explain what I want to do .
    External systems sends files which should linked to SAP documents that users can later see with FB03.
    This can be done by function module ARCHIV_CREATE_SYNCHRON_META or similar, but only this is remote-enabled.
    Here an example:
    External system sends for e.g.  3 files. All files are located in file-system.
    1. file :  file-aaa.pdf
    2. file:   file-bbb-pdf
    3. file:   upload.txt
    Content of third file:  
    company-code, SAP-document number, year, file-name 
    0400..................6800004711...................2008..file-aaa.pdf
    0400.................48000004712..................2009, file-bbb.pdf
    FILE-Sender-channel is polling for  the file  "upload.txt".  This file will convert from text to XM by Adapter, so far ok. .
    RFC-Receiver-channel so far ok.  Using  imported RFC function module
    Test Message-Mappng : OK    (  MT_INVOICES  -->  ARCHIV_CREATE_SYNCHRON_META )
    Test.Operation-Maping:  OK
    But the process failed with following errors: , File "upload.txt" has been archived but no other activities.
    ==============================================================================
    SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~</SAP:P1>
      <SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2>
      <SAP:P3>on: Cannot create target element /ns1:ARCHIV_CREAT</SAP:P3>
      <SAP:P4>E_SYNCHRON_META/AR_OBJECT. Values missing in queu~</SAP:P4>
      <SAP:AdditionalText />
      <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns1:ARCHIV_CREATE_SYNCHRON_META/AR_OBJECT. Values missing in queu</SAP:Stack>
    Test-Result of configuration in the Integration Builder:
    ======================================
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Premature end of file.
    Maybe somebody can help here ?

    The payload is following: I imported this into the test area.
    <?xml version="1.0" encoding="utf-8" ?>
        <MT_INVOICES>
          <Recordset>
              <ROW>
                   <TEXT1>EFLOW</TEXT1>
                   <TEXT2>FI_DOCUMENTS</TEXT2>
                   <SAP_DOCUMENT>4300005878</SAP_DOCUMENT>
                   <COMPANY_CODE>0401</COMPANY_CODE>
                   <YEAR>2005</YEAR>
                   <FILE_NAME>file-1.gif</FILE_NAME>
                   <FILE_TYPE>GIF</FILE_TYPE>
            </ROW>
         </Recordset>
      </MT_INVOICES>
    Below the XSD schema of the  data type
    <xsd:complexType name="DT_INVOICES">
          <xsd:annotation>
             <xsd:documentation xml:lang="EN">
             Scanned invoices of eflow system
             </xsd:documentation>
          </xsd:annotation>
          <xsd:sequence>
             <xsd:element name="Recordset">
                <xsd:complexType>
                   <xsd:sequence>
                      <xsd:element name="ROW" maxOccurs="unbounded">
                         <xsd:complexType>
                            <xsd:sequence>
                               <xsd:element name="TEXT1" type="xsd:string" />
                               <xsd:element name="TEXT2" type="xsd:string" />
                               <xsd:element name="SAP_DOCUMENT" type="xsd:string" />
                               <xsd:element name="COMPANY_CODE" type="xsd:string" />
                               <xsd:element name="YEAR" type="xsd:string" />
                               <xsd:element name="FILE_NAME" type="xsd:string" />
                               <xsd:element name="FILE_TYPE" type="xsd:string" />
                            </xsd:sequence>
                         </xsd:complexType>
                      </xsd:element>
                   </xsd:sequence>
                </xsd:complexType>
             </xsd:element>
    So I see here no difference !.

  • SAXParseException: premature end of file in creating WARs

    Hi,
    I stronlgy follow the hints provided in J2EE tutorial to create some WARs from sample code,
    all is OK with compiling, however when I save my work (where ir is required in text), I get the following
    message
    ....WAR is corrupt or cannot be read
    SAXParseExcpetion: Premature end of file
    Where is cause for this? Additionally - when I try to install provided wars, all is OK (resp. I think that my installation work - J2EE 1.4 beta 2)
    Well during creating wars there is some reports about some bug which prevents to write URL directly during creation of war - could the cause be hidden here?
    Thanks for replies

    but I feel that .xml files should be correct - I try
    build samples and I get this error both for web
    applications and web service applications.Doesn't matter what you feel or assume. Are they correct or aren't they? The web and SOAP servers seem to think something's wrong. You ought to be checking all the XML that they touch to find out what's bothering them.
    I can't say that I know, but if you're getting a SAX parse exception an invalid web.xml will do it. They've got to be valid against the DTD for the web.xml. Have you verified your web.xml against the DTD? Will a browser or an app like XML Spy validate it for you?
    If you've checked it and found that it's okay, then I'm incorrect and you need to look at something else. But "feeling" that they're right isn't the same thing as being 100% certain because you've had a tool validate it against the DTD.

  • Premature end of File

    Hi all,
    I got the following exception while doing file to file scenario  (with file content conversion)
    Operation Mapping
    INF137917_OM_Medicine
    Runtime error
    Runtime exception occurred during application mapping com/sap/xi/tf/_INF137917_MM_Medicine_; com.sap.aii.utilxi.misc.api.BaseRuntimeException: Premature end of file.
    I found this error in test configuration of Integration directory.
    Please help me to find out the cause of it.

    Hi Ashu,
    With what payload you are testing in the ID test tool? Should be from the SXMB_MONI ,isn't it ?
    My view is that , there are error in the sender file adapter FCC which you have written.
    Please try correcting the FCC error and your issue will be solved.Make sure you use correct parameters as FCC is case sensitive.
    refer this help.sap link to analyse and correct your fcc error.
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    post if you have any specific erorr, as you seems to be very new to SDN , try searching for the error in Google/SDn and then if you dont get any way out ... SDN members will be more than happy to guide you .
    Cheers,
    Srinivas

Maybe you are looking for

  • When I try to adjust the date and time of an event by selecting Photos from iPhoto, the year I enter is altered.

    I have images in iPhoto from an older digital camera which did not record the date and time.  In iPhoto, with an event selected, I have tried to adjust the date and time by choosing Photo.  When I adjust the date and check Modify original files, it m

  • How to Create Organization unit with customised code?

    Hi all,    My business requirement need to create a Organization unit with a customised report. That customised report need to be developed in which i will be incorporating the code to create a new orgganization unit in sap and also to assign it in t

  • Accordion

    Hi -- I am reposting this to another group as I got no response in the DB group. Rich "Rich Morey" <[email protected]> wrote in message news:<fafbbf$gkp$[email protected]>... > Hi -- > > I would like to build an accordion by iterating through a recor

  • Unprompted Report parameter

    Hi, I'm running that against Oracle DB. If a report parameter is used within that script, then it will be prompted. If not, it will not be prompted. How can we make that be prompted, as for some situations, they can only be for the control use in the

  • Osmf ready to use in production?

    Has anyone who has been using OSMF got a POV on using it to build a production ready video player with advertising integration? Or would you advise just using Open Video Player? I like the OSMF architecture, but im concerned I wont have the flexabili