IOException: Premature end of POST data

Hi, I have a web application with Java 5 / Struts 1.2.4 running on OAS 10g. I have this error when I tried to get any option of the application. The application is deployed in Tomcat, Websphere, JBoss, Glassfish but it fails only in OAS.
This is the error trace:
es.IOException: Premature end of POST data
es.class.java.lang.IllegalStateException
es.com.megasoft.erp.seguridad.acceso.MenuLauncherAction.execute (MenuLauncherAction.java:63)
+...+
+...+
This is the code of MenuLauncher.java:
public class MenuLauncherAction extends GenericaDispatchAction {
    private final static String SHC_LOG = "<L>";
    private final static String SHC_CVS = "<V>";
    private final static String FWD_ERROR = "error";
    private final static String FWD_DEFAULT = "default";
    private final static String FWD_MODULOS = "modulos";
    private static final String FWD_APPLOG = "appLog";
    private static final String FWD_CVS = "controlVersion";
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        Connection conn = null;
        // El forward corresponde a posicón 0 url a donde debe ser enviado o FWD_ a traducir el campo 1 indica si debe mapearse o no.
        String[] forward = new String []{FWD_DEFAULT, "S"};
        try {
            initLog(request);
            String sessionId = request.getSession().getId();          
            conn = UtilDAO.getConnection(getActiveDataSource(request));
            UserPrincipal principal = UserEnvironment.getPrincipal(request);
            String grupo = request.getParameter("grupo");     /*APPLICATION FAILS IN THIS LINE*/
            String modulo = request.getParameter("modulo");
            String permiso = request.getParameter("permiso");
            String shortcut = request.getParameter("shortcut");
            String usuario = UserEnvironment.getLogin(request);
            Integer empresa = UserEnvironment.getEmpresa(request).getCodigo();
            if (!ApplicationUtil.nullOrEmpty(grupo)){
                SeguridadService segService = (SeguridadService) getServiceLocator().getService(SeguridadService.class);
                segService.modifyEmpresaPerfil(principal, shortcut, grupo, log, conn);
                ApplicationEnvironment.addUsuarioPerfilCache(usuario);
            boolean isModulo = !nullOrEmpty(modulo);
            boolean isPermiso = !nullOrEmpty(permiso);
            boolean isShortcut = !nullOrEmpty(shortcut);
            if(isPermiso) {
                forward = per(empresa, usuario, permiso, principal, sessionId);
            } else if(isModulo) {
                mod(empresa, usuario, modulo, principal);
            } else if(isShortcut) {
                forward = shc(empresa, usuario, shortcut, principal, sessionId, conn);
            } else {
                throw new ValidationException("Parametro incorrecto", "error.menuLauncher.parametros", null);
        }catch (ValidationException e) {
            log.addMessage(e.getKey(), e.getParams(), ApplicationLog.MSG_USER);
        } catch(Exception e) {
            log.addException(e);
        } finally {
            UtilDAO.closeConnection(conn);
            saveLog(request);
        return new ActionForward(forward[1].equalsIgnoreCase("S")?mapping.findForward(forward[0]).getPath():forward[0]);
I have a javascript code that builds all urls of the application, this is the javascript code:
function loadOptionMenu(context, grupo){
     var cargarUrl = false;
     var urlTpw = document.getElementById("urlTpw");
     var btnShortcut = document.getElementById("btnShortcut");
     var url = context + "/menu.do?";
     if (urlTpw!=null && urlTpw.value!=''){
          url =  urlTpw.value + '&';
     if(btnShortcut.value!=""){
          cargarUrl = true;
          url += "shortcut=" + btnShortcut.value.toLowerCase();
     if (grupo!=null && grupo!=""){
          url += "&grupo=" + grupo;
     //alert('URL a cargar: ' + url);
     if (cargarUrl){
          cargar(url, true);
}Finally code above builds an url in this way:
http://localhost:8080/neon/menu.do?shortcut=con&grupo=ADMCONTRATO
I had been googling about error, in this post http://en.allexperts.com/q/JSP-Java-Server-3299/Question-request-class.htm answered a possible solution. I don't know if the order of the parameters in the url and the way that it were called is important. it must be? may be another cause?
Thanks for your help
Fernando G.

what does "initLog()" do with the request object (or any of the other calls which take the request instance)? are any of them looking at the stream/reader associated with the request?
Edited by: jtahlborn on Aug 10, 2011 4:54 PM

Similar Messages

  • Java.IOExceptionUnexpected end of POST data

              Iam currently using weblogic5.1 with SP13 and gettting this error occassionally...Not
              everytime.
              Can someone help me?
              Tue Nov 11 09:06:08 EST 2003:<I> <ServletContext-General> doRunSingleRpt: init
              Tue Nov 11 09:06:08 EST 2003:<I> <T3Services> com.lehman.pbreporting.gui.doRunSingleRpt@1fb78Generation
              of reports resumed...
              java.io.IOException: Unexpected end of POST data. Read 0 bytes. Content-length
              = 202
              at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletRequestImpl.java:644)
              at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(ServletRequestImpl.java:488)
              at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:685)
              at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:671)
              at com.lehman.pbreporting.gui.doRunSingleRpt.run(doRunSingleRpt.java:105)
              

    Anyone who can help me?

  • Month end accrual posting date- Last day of the month

    Hi Experts,
    I have set up month end accruals for PY US by configuring posting dates, LDCD, WageType accrual processing class, Schema changes. I have also set the closing dates as the end of the month.
    Now after I do the posting , there are three documents getting generated.
    1. Accrual posting document with first day of the current month
    2. Normal Payroll posting  document with payroll period posting date
    3. Accrual reversal document with first day of the following month.
    My Question is:  As per standard SAP configuration, the month end accrual will have first day of the month. Can we customize this to end of the month for doc#1 - accrual document?
    Please do let me know your suggestion and ideas.
    Thanks,
    Amosha

    Hello,
    I have a similar question and I hope to have more details on how to change the posting date.
    The point is that I have an amount of 1200 and I have to post 100 for each month.
    Key Date for Accruals: 31.01.2011
    I posted 100 with Document date: 31.01.2011 and Posting date 31.01.2011
    Key Date for Accruals: 28.01.2011
    I posted 200 with Document date: 28.02.2011 and Posting date 28.02.2011
    Also I reversed the amount posted in the previous month (100) with Document date: 31.01.2011 Posting date 28.02.2011
    And so on...
    The problem are the dates because I need to post the amount at the end of each month (28/02) and to reverse the previous amount at the beginning of the next month (01/02).
    How can I change these dates?
    Thanks a lot in advance
    Kind Regards,
    E.

  • Confirmation - start, end and post date

    Hi,
    In the transaction IW41 I need a start,end and post (ISDD, IEDD and BUDAT) of the confirmation order remains the same. Any suggestions?

    I guess, we can achieve by User Exits only.
    CONF0001 Enhancements in order confirmation
    CONFPM03 PM/SM order conf.: Cust. spec. check after op. selection
    Also validate in following user exit.
    CONFPM05 PM/SM order conf.: Cust. specific enhancements when saving
    Regards,

  • 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?

  • Java Forums - javax.jms.MessageFormatException: IOException: unexpected end

    I'm using jboss 3.2.6 and JDK 1.4
    Since I uppgraded to JDK 1.5, my JMS messaging doesn't work anymore.
    I am able to send and receive String messages without any problem but the getObject() method fails for custom objetcs.
    If someone has any idea, please help me.
    This is my Server and Client sourcecode
    Server Code
    QueueSender queueSender = m_queueSession.createSender( m_queue );
    ObjectMessage objectMessage = m_queueSession.createObjectMessage(serialazableObject);
    objectMessage.setStringProperty("Config", selector);
    queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    queueSender.send( objectMessage );
    Client code
    public void onMessage( Message message )
    Object obj = null;
    ObjectMessage objectMessage = null;
    try
    if ( message instanceof ObjectMessage )
    objectMessage = ( ObjectMessage ) message;
    obj = objectMessage.getObject();
    if (obj instanceof CLPBRRoute)
    onNewRoute( (CLPBRRoute) obj );
    else if (obj instanceof String)
    onStatusMessage((String)obj);
    catch ( Throwable t )
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - javax.jms.MessageFormatException: IOException: unexpected end of block data
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:135)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at com.calypso.operatorapps.networkdesigner.gui.bestroute.CLPBRResultPanel$CLPBRBestRouteThread.onMessage(CLPBRResultPanel.java:574)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:680)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - at java.lang.Thread.run(Thread.java:595)
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] - \n
    Simple listener:Mar-17-2006 17:02:40 - Trace Stderr - [10] -

    I'm sorry, I posted my message in a wrong forum. Thank you for not considering this message in this forrum.

  • 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>

  • MultipartRequest java.io.IOException: Corrupt form data: premature ending

    i try to upload a file using MultipartRequest
    i want to get the name of the file uploaded with html form
    and display it on jsp page (just for now to see if it works)
    in server.log i see Error creating file: java.io.IOException: Corrupt form data: premature ending
    thank You

    Then whatever is uploading the file, isn't doing it correctly.

  • Ioexception: end of tns data channel

    I'm very interested in this issue, too:
    just because it looks very similar, I post my issue, too
    please, if you find out the fixing, don't hesitate to contact me
    regards
    SCENARIO:
    - oracle 9i RAC installation on linux RedHat
    - java swing application using Jsdk1.4.2_06 deployed on HP machine, both resident on the same LAN.
    the application cycle on polling on another windows machine via FTP and save records on oracle
    - oracle JDBC driver used : ojdbc14-10-1-0-1-0.jar
    after a quite long period the application is running
    we are experiencing the following exception :
    Stack: java.sql.SQLException: IOException: End of TNS data channel
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:418)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    the oracle client memory usage keep increasing, from 80M up to 200, the typically the exception raise up
    does anybody have any clue?
    thanks in advance
    vl

    Yes, it definitely has to do with the language setting, and I do not have a database with a Chinese character set at my disposal.
    No, by TAR I meant to officially contact the support that will take care of your problem, if you still need this, if you have a support contract. To have an idea on what TARS are, you can take a look at the metalink site (metalink.oracle.com) under the TARs tab.
    Regards:
    Igor

  • BI services error "Data parsing failed, premature end of file".

    Hi all,
    we are facing issue while using BI services whenever we are trying to drill data its showing the error as "Data parsing failed contact your system administrator,premature end of file".
    please share with me if anyone has faced the same error anytime.
    thank in advance for your valuable suggestions.
    Thanks,
    karan.

    Hi,
    Please check whether the RFC imported by you contain the exact elements of XML.  I feel the RFC generated does not contain proper XML schema.
    Regards
    Krish

  • Period-End Closing with posting date

    Hi gurus,
       Tell me how to fix posting date when period-end closing. Where I can fix, assign ... Now our system, it's automatic.

    Hi Andy,
    Im using 2004, in 2004 you can not change the date that it carries the values over to. I highly doubt you'll be able in 2005. I'm taking a guess.....but the reason you want to do this is because the figures don't look right when you run the financial reports....hey? Before you execute financial reports tick the selection box "Add closing balances" i9n the selection window. Im assuming they still have this tick box in 2005.
    Hope this helps.

  • A premature end-of-message was encountered--an incoming data stream was interrupted when the server expected to see more data

     I am getting this error when try to transfer data from an hosted database.
    An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "While reading current row from host, a premature end-of-message was encountered--an incoming data stream was interrupted when the server expected to see more data. The host program may have terminated. Ensure that you are using a supported client application programming interface (API).".
    How can I work around this?
    This is a simple data flow from a SQL 2005 table using SQL 2008 SSIS. going to a SQL 2008 table
    ThanksSQL Server MVP http:\\sqlblogcasts.com\blogs\simons

    You can still keep the NVARCHAR computed column in the table, but you cannot use MAX for the length, just use a fixed size and it will work like a charm (i.e. convert the whole result of the computation to NVARCHAR(4000)).
    Laurent.

  • Java.io.IOException: JZ0EM: End of data.

    We get the following exception. We are WLS 8.1 sp4 and using the jconn3_6_0.jar for sybase. The stack trace only shows WLS classes and sybase. Does anyone know how to eliminate this error?
    java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0EM: End of data.
    at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(ErrorMessage.java:559)
    at com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(ErrorMessage.java:863)
    at com.sybase.jdbc3.tds.Tds.handleIOE(Tds.java:3791)
    at com.sybase.jdbc3.tds.Tds.handleIOE(Tds.java:3736)
    at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2234)
    at com.sybase.jdbc3.tds.Tds.logout(Tds.java:741)
    at com.sybase.jdbc3.jdbc.SybConnection.close(SybConnection.java:1158)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroyForFlush(ConnectionEnv.java:579)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:564)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:390)
    at weblogic.common.resourcepool.ResourcePoolImpl.doShrink(ResourcePoolImpl.java:1650)
    at weblogic.common.resourcepool.ResourcePoolImpl.access$600(ResourcePoolImpl.java:27)
    at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.run(ResourcePoolImpl.java:2000)
    at java.util.TimerThread.mainLoop(Timer.java:432)
    at java.util.TimerThread.run(Timer.java:382)
    SQLException: SQLState(JZ006)

    Pat Bumpus wrote:
    We get the following exception. We are WLS 8.1 sp4 and using the jconn3_6_0.jar for sybase. The stack trace only shows WLS classes and sybase. Does anyone know how to eliminate this error?
    java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0EM: End of data.
    at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(ErrorMessage.java:559)
    at com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(ErrorMessage.java:863)
    at com.sybase.jdbc3.tds.Tds.handleIOE(Tds.java:3791)
    at com.sybase.jdbc3.tds.Tds.handleIOE(Tds.java:3736)
    at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2234)
    at com.sybase.jdbc3.tds.Tds.logout(Tds.java:741)
    at com.sybase.jdbc3.jdbc.SybConnection.close(SybConnection.java:1158)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroyForFlush(ConnectionEnv.java:579)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:564)
    at weblogic.jdbc.common.internal.ConnectionEnv.destroy(ConnectionEnv.java:390)
    at weblogic.common.resourcepool.ResourcePoolImpl.doShrink(ResourcePoolImpl.java:1650)
    at weblogic.common.resourcepool.ResourcePoolImpl.access$600(ResourcePoolImpl.java:27)
    at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.run(ResourcePoolImpl.java:2000)
    at java.util.TimerThread.mainLoop(Timer.java:432)
    at java.util.TimerThread.run(Timer.java:382)
    SQLException: SQLState(JZ006)Are there any other sorts of exceptions happening? There is either a
    DBMS/driver version mismatch or some other sort of non-weblogic
    problem. We are simply trying to close an unneeded connection and
    the Sybase driver is throwing an exception which is saying the
    driver didn't expect the other end of the line (the DBMS) to hang
    up so fast. One thing you can do is to turn off shrinking... Show
    me your pool config.
    Joe

  • 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

  • "Premature end of file" when reading in a GZIP file!

    Hello i'm trying to figure out what may be causing a "Premature end of file" when reading in a GZIP file!
    Basically, what i'm trying to do is read a GZIP file, create an XML file in GZIP format and then validate the GZIPed XML file using the SAX validator and this process works fine for LOW volume data, but for HIGH volume data it seems to have several problems. One problem i was getting was 'Corrupt GZIP trailer', which seems to be a known bug, used an override here and it's ok, and now i'm getting the 'Premature end of file error'.
    Here is the error report, see <<<<<<<<<!
    START: Wed Aug 03 12:03:41 EDT 2005
    Runparms :
    host: ....
    port: ....
    sid: ....
    usr: ....
    site: ....
    val_type: HVPEZ -- previously HVPEX, reason, reading zip file (.gz)
    dbo: NULL
    ddl: /home/......../HLPVAL/DAT/hlp_ddl_file
    table: ......
    db_name: NULL
    dat_file: /..../...../....../xxxxxxx1.dat.gz
    xsd: /home/....../....../XSD/xxxxxxx1.xsd
    sql: NULL
    debug: NULL
    sql query null
    pid: 11751
    xml: /home/.........../...../XML/xxxxxx1.dat_HVPEZ_xml.gz
    rep: /home/.........../...../XML/xxxxxx1.dat_HVPEZ.valrep
    fatalError:
    setValidity:
    Error number : 1
    Error starts on line number : 1302706816
    Error starts on column position: 8
    Error text is : org.xml.sax.SAXParseException: Premature end of file. <<<<<<<<<<<
    org.xml.sax.SAXParseException: Premature end of file.
    Here i'm reading in a GZIPed file, i then generate the XML and write out another GZIPed file, see <<<<<<<<<<:
           try {
            GZIPOutputStream     gz = new GZIPOutputStream(new FileOutputStream(xp.xml_file));  >>>>>>>> out GZIPed
            PrintWriter        outf = new PrintWriter (gz);
            GZIPInputStream      in = new GZIPInputStream(new FileInputStream(xp.dat_file),4096); <<<<<< in GZIPed
            byte[] buf = new byte[4096];int len=0; String[] sa = new String[NUM_COLS]; int bj=0; char[] ca=new char[1500];
            while ((len = in.read(buf)) > 0)
                String hrec = new String();
                for (int b=0;b<len;b++)
                     Byte byt=new Byte(buf); int bi=byt.intValue(); char c=(char)bi; ca[bj]=c;
    if (c == '\n')
    hrec=new String(ca); hrec=hrec.trim();
    for (int k=0;k<1500;k++) ca [k]=' ';
    int prevj=0; j=0;int fcnt=0;
    for (int w=0; w<hrec.length(); w++)
    if (hrec.charAt(w)=='|')
    sa[j]=hrec.substring(prevj,w);fcnt++;
    j++; prevj=w+1;
    sa[j]=hrec.substring(prevj,hrec.length());fcnt++; bj=-1;
    for (int i = 0; i < NUM_COLS; i++)
    if (i>(sa.length-1)) { sToken = new String(); } else { sToken = sa[i]; }
    if (sToken.indexOf('<')>-1 || sToken.indexOf('>')>-1 || sToken.indexOf('"')>-1 ||
    sToken.indexOf('&')>-1 )
    String sToken2 = new String();
    sToken2 = normalize(sToken);
    sToken = sToken2;
    outf.write(" <"+_columnNames[i]+">"+sToken+"</"+_columnNames[i]+">"+"\n");
    outf.write(" </"+FILE_NAME+">"+"\n");
    bj++;
    outf.write("</hlp_data>"+"\n");
    outf.flush(); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here if tried every combination of close command ect.
    outf.close();
    gz.finish();
    gz.close();
    in.close();
    Here i'm reading the GZIPed file from the previous program and this is where the 'Premature end of file' error is occurring. Notice that i'm using an extended class Called WorkingGZIPInputStream, this is to bypass the error message 'Corrupt GZIP trailer' message that seems to occur when processing high volume files, here's a previous link on issue:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=1&t=011624
           HlpValSax1  sx = new HlpValSax1();
           SAXParser   sp = sx.getParser(xp.xsd_file);
           if (
                  xp.val_type.substring(0,5).equals("HVPEZ")
               || xp.val_type.substring(0,5).equals("HVPEX")
               || xp.val_type.substring(0,5).equals("HVOEX")
               WorkingGZIPInputStream is = new WorkingGZIPInputStream(new FileInputStream(xp.xml_file),4096); <<<<<<<<<<
               sp.parse(is,dh);
           else
              File file      = new File(xp.xml_file);
              InputStream is2 = new FileInputStream(file);
              sp.parse(is2,dh);
         catch (FileNotFoundException nf) {System.out.println(nf);}
         catch (SAXException sa)          {System.out.println(sa);}
         catch (IOException  io)          {System.out.println(io);}

    Turns out things were not exactly the same. When I had done it from disk I would always create a new InputStream when reading the resource, when doing it from the Jar I was reusing it.

Maybe you are looking for

  • When can I expect the activation email (iPhone dev)?

    Hi, Very excited to submit two apps I've been working on in recent weeks for AppStore consideration. I've already registered and made the $99 payment, and am awaiting what I'm assuming is an activation email. Any idea when I should expect to receive

  • Tables in transaction WPER

    Hi, In table EDIDS i am getting error "Idoc not posted successfully" but in WPER it shows full detail description of the error. so can any body tell me which transperant table WPER is using for getting full Status message. Thanks RP

  • Printing 4 slides on a page -- adjusting margin

    Hi, I am using Keynote 3. I print out slides for handout by using Layout and set number of page per sheet to 4 and using landscape mode. So far everything is fine...but each slide on a page is a bit small. Is there a way to make the slide bigger...th

  • How can i use "sequence"

    hi I have created a sequence as the following: create sequence id_seq start with 1 ,increment by 1; I create a table as the following code: create table xmltab(id number primary key,xml_content varchar2(4000)); After this, In jdev9i,I try to use the

  • Text problems with Illustrator CS6

    Hello. We are having problems with text in Illustrator CS6. 1. When we copy / paste text within illustrator all color information is lost. 2. When we save documents in Illustrator CS6 then re-open text with color attributes changes to different rando