NotSerializableException - FileUpload

Whenever File is Uploaded the following Exception is seen
although there is no Technical Error in Application :
[4/5/07 18:00:45:297 CEST] 75a18925 DRSCacheApp E DRSW0008E: Exception is: java.io.NotSerializableException:
org.apache.commons.fileupload.DeferredFileOutputStream
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined Compiled Code))
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java(Compiled Code))
     at com.ibm.ws.drs.DRSUtils.getBytes(DRSUtils.java:564)
     at com.ibm.ws.drs.DRSCacheApp.getBytes(DRSCacheApp.java(Inlined Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.DRSHttpSessCache.setJCMPropObj(DRSHttpSessCache.java(Compiled Code))
     at com.ibm.ws.drs.DRSAPI.updateEntryProp(DRSAPI.java:859)
     at com.ibm.ws.drs.DRSCacheApp.updateEntryProp(DRSCacheApp.java:3154)
     at com.ibm.ws.webcontainer.httpsession.DRSHttpSessCache.updateEntryProp(DRSHttpSessCache.java:1617)
     at com.ibm.ws.webcontainer.httpsession.DRSBackedHashtable.handlePropertyHits(DRSBackedHashtable.java:280)
     at com.ibm.ws.webcontainer.httpsession.DRSBackedHashtable.persistSession(DRSBackedHashtable.java:367)
     at com.ibm.ws.webcontainer.httpsession.BackedHashtable.ejbStore(BackedHashtable.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.BackedHashtable.storeSession(BackedHashtable.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.BackedHashtable.put(BackedHashtable.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.sync(DatabaseSessionContext.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.SessionData.sync(SessionData.java:296)
     at com.ibm.ws.webcontainer.httpsession.DatabaseSessionData.sync(DatabaseSessionData.java:885)
     at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.checkForSessionWrites
(DatabaseSessionContext.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.DatabaseSessionContext.asyncExternalWrite
(DatabaseSessionContext.java(Compiled Code))
     at com.ibm.ws.webcontainer.httpsession.SessionAlarmListener.alarm(SessionAlarmListener.java(Compiled Code))
     at com.ibm.ejs.util.am._Alarm.run(_Alarm.java(Compiled Code))
     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Resolution :
Currently im using common-fileupload-1.0.jar where DeferredFileOutputStream.class is not Serializable., thus Exception is thrown.
If I try using higher version - common-fileupload-1.2.jar along with common-io-1.3.1.jar , then there DeferredFileOutputStream.class is not Serialized , but they hav made the reference of DeferredFileOutputStream.class as "transient" in DiskFileItem class.
This means that although I wil nt get the Exception , on the contrary the reference wil not be passed onto server , as its "transient" ( transient variables are not Serialized when objects pass from client to server.)
Please post ur replies as early as possible.

Agreed ,
DefferedOutputStream is just a output stream to write data in memory til a particular threshold is reached n then write it to disk.
But then How to remove the Exception ?
You mean to say that the Exception is propogated from some other object i,e. Not Serialized.
Do i need to check all the objects being passed in session during fileupload, whether they are Serialized or not ?
Please post some suggestion.

Similar Messages

  • Thread unserialized exception: NotSerializableException: java.lang.Thread

    hello experts,
    i have this exception coming; seems to be coming from some thread but i removed all the threads from my code, i thought its because of some object which is still unserialized, i am not sure whether this is because of one unserialized object or its because of more reasons, please have a look:
    Exception in client main: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
         at BallServerImpl_Stub.getAllBallProxies(Unknown Source)
         at CopyOfManyMovingBalls.<init>(CopyOfManyMovingBalls.java:80)
         at CopyOfManyMovingBalls$2.run(CopyOfManyMovingBalls.java:294)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
         ... 11 more
    this is coming  when i m accessing this method:
    class BallServerImpl extends UnicastRemoteObject
    implements BallServer
    * @return an enumeration of all Balls as proxy objects
    public Ball[] getAllBallProxies() throws java.rmi.RemoteException
         Ball[] locations1 = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
         BallImpl impl = (BallImpl)iter.nextElement();
    locations1[idx++] = new BallProxy(impl);
    return locations1;
    why this function is running fine when i m calling this from client unlike getAllBallProxies() nevertheless both are returning the same thing:
    * @return an enumeration of all Balls as remote references
    public Ball[] getAllBalls()
         Ball[] locations = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
    locations[idx++] = (Ball)iter.nextElement();
    return locations;
    the proxy Class:
    * The Proxybouncing ball.
    public class BallProxy implements Serializable,Ball {
    * The Real bouncing ball.
    public class BallImpl extends UnicastRemoteObject implements IBallRemote,Serializable
    *load of thanks as this is "SHOW STOPPER",
    jibbylala*
    Edited by: 805185 on Oct 25, 2010 8:33 PM
    Edited by: 805185 on Oct 25, 2010 8:39 PM
    Edited by: 805185 on Oct 25, 2010 9:21 PM
    Edited by: 805185 on Oct 25, 2010 9:25 PM
    Edited by: 805185 on Oct 25, 2010 9:27 PM
    Edited by: 805185 on Oct 25, 2010 9:46 PM

    that there was some thread there in BallProxy but i removed all from them and now testingIf you don't post the code people ask to see, you may never get a useful answer here.
    P.S i didn't know that threads are not SerializedThe Thread class is not Serializable. Precision please.
    Now i m updating the code, i needed the confirmationConfirmation of what?
    and now trying to avoid them.Them?
    But what if i need them.Them?
    Please make the effort to express yourself clearly. You've already been told you're not making much sense and you haven't done anything about it.
    how can we make serialized?The concept of serializing a Thread makes no sense whatsoever. You don't want to do it. You don't need to do it. You can't do it. It wouldn't work if you could do it.
    Somewhere or other you have a class member that is a reference to a Thread. Remove it or make it transient. If you post the code somebody may help you. If you don't, nobody can possibly do that.

  • FileUpload UI element -"browse"label is not coming in Hungrian for Hungrian

    Folks,
    We are using FileUpload ui element in our application, our application supports English , Hugrian languages, Problem is here , label on browse button coming in English for hungrian users.
    I believe  no need to add any translation to browse label in .xlf file,
    can any one tell me how to add Hungrian translation to Browse label, how to check standard translations of file upload ui element?
    Thanks & Regards,
    Veera.

    Hi Anup,
    portal User language is already hungray and rest of the labels in page are coming in hungrian as we maintained in -hu.xlf file.but for FileUpload ui element there is no option to map label of  "browse"  button with a message pool attribute.
    Thanks & Regards,
    Veera.

  • I am trying to use apache commons fileupload and get this error

    I am using tomcat 5.5 as application server and JDK 1.6,
    does anybody have idea how to resolve this error ?
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.security.AccessControlException: access denied (java.util.PropertyPermission java.io.tmpdir read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         java.security.AccessController.checkPermission(AccessController.java:546)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
         java.lang.System.getProperty(System.java:652)
         org.apache.commons.fileupload.disk.DiskFileItem.getTempFile(DiskFileItem.java:611)
         org.apache.commons.fileupload.disk.DiskFileItem.getOutputStream(DiskFileItem.java:556)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         project.UploadFiles.processRequest(UploadFiles.java:48)
         project.UploadFiles.doPost(UploadFiles.java:107)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)

    Make sure that the servlet has permissions to write to that directory. I've hit that snag before, and on linux I set the permissions to nobody nobody 775.
    Good luck,
    Krista

  • Sending an email with attachments in Java using FileUpload UI Element

    Hello Experts,
    I'm using NWDS 7.01 SP6.
    I have an application that has a FileUpload ui element. The elements resource property is bound to a context node of type Resource from the Local Dictionary from uielementsdefinitions.
    The question I have is, how can I take the uploaded file from the context, and attach it to an email using the javax.mail.* api?
    Do I need to store it somewhere first or can it be taken directly from the context attribute? If I need to store it, where do I store it? 
    Any help or suggestions are appreciated.
    Thanks
    MM

    Hello Experts,
    I'm using NWDS 7.01 SP6.
    I have an application that has a FileUpload ui element. The elements resource property is bound to a context node of type Resource from the Local Dictionary from uielementsdefinitions.
    The question I have is, how can I take the uploaded file from the context, and attach it to an email using the javax.mail.* api?
    Do I need to store it somewhere first or can it be taken directly from the context attribute? If I need to store it, where do I store it? 
    Any help or suggestions are appreciated.
    Thanks
    MM

  • How to invoke the FileUpload field click event without clicking on the browse button?

    The Fileupload field click() method works in IE, but not in firefox. Can someone provide some details on this issue?

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Dynamic Error Message from a Bundle Showed in a rich:fileUpload

    Hello.
    There is a way to show a dynamic error message from a bundle (i.e, There is a problem in the word {0} in line {1}.) in a rich:fileUpload after the Managed Bean method in fileUploadListener="#{MyManagedBean.myMethod}" attribute was performed? That's because the error message parameters are discovered only after the MyManagedBean.myMethod execution.
    As far I know, I'm able only to show a static message with transferErrorLabel="#{myBundle.myErrorMessage}" attribute.
    Here is my rich:fileUpload component code:
      <rich:fileUpload id="upload"   
         fileUploadListener="#{PlanilhaManagedBean.importar}"  
         maxFilesQuantity="100" 
         immediateUpload="true" listHeight="130" acceptedTypes="xls"  
         addControlLabel="#{bundle.geralProcurarArquivo}" 
         ontyperejected="alert('#{bundle.geralExtensaoInvalida}')"    
         cancelEntryControlLabel="#{bundle.geralCancelar}" 
         clearAllControlLabel="#{bundle.geralLimparTudo}"     
         clearControlLabel="#{bundle.geralLimpar}" 
         doneLabel="#{bundle.geralArquivoTransferidoComSucesso}"  
         progressLabel="#{bundle.geralTransferindoArquivo}" 
         stopControlLabel="#{bundle.geralParar}"  
         stopEntryControlLabel="#{bundle.geralParar}" 
         transferErrorLabel="#{bundle.geralErroNaTransferenciaDoArquivo}" /> Any idea?
    Thanks in advance.

    Hi, BalusC. Thanks for your reply.
    I already tried that. I put a navigation-rule in faces-config.xml to the same page of the rich:fileUpload, but the rich:fileUpload component doesn't starts a get or a post request. So the navigation-rule is ignored and the page wasn't rendered again.
    I also tried to put the <a4j:support ...> in the rich:fileUpload to re-render the <h:messages ...> component, but didn't work too. The <h:messages ...> wasn't re-render.
    Thanks in advance.
    Edited by: reolca on May 10, 2009 5:40 AM

  • FileUpload problem: InputStream does not contain a serialized object

    Hi All,
    I'm using the FileUpload component in a JSPDynPage and the htmlb component seems to work fine but I cannot read the file (InputStream). I get the following error(IOException): "InputStream does not contain a serialized object".
    Please let me know what is wrong with my code. This is a part of the code I used:
    public FileInputStream sourceFileInput;
    public ObjectInputStream input;
    FileUpload fu;
    fu = (FileUpload) this.getComponentByName("myFileUpload");
    IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
    File f       = fileParam.getFile();
    file         = fu.getFile().getFile();
    absolutepath = fu.getFile().getFile().getAbsolutePath();
    this.sourceFileInput = new FileInputStream(file);
    input = new ObjectInputStream(sourceFileInput);
    The last line of code seems to generate te error.

    Hi,
    I have found the answers, thank you both.
    (I included the examle code. Perhaps of some use to someone.)
    FileUpload fu;
    fu = null;
    fu = (FileUpload) this.getComponentByName("myFileUpload");
    //       this is the temporary file
    if (fu != null) {
         IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
         if (fileParam != null) {
              // get info about this file and create a FileInputStream
              File f = fileParam.getFile();
              if (f != null) {
                   try {
                        fis = new FileInputStream(f);
                   // process exceptions opening files
                   catch (FileNotFoundException ex) {
                        myBean.setMessage(
                             "1" + f + ex.getLocalizedMessage());
                   isr = new InputStreamReader(fis);
                   br = new BufferedReader(isr);
    String textLine = "";
    do {
         try {
              textLine = (String) br.readLine();
         } catch (IOException e) {
              myBean.setMessage(
                   "1" + e.getLocalizedMessage());
         // Jco append table & put data into the record
         // (I_FILE is the table with txt data that is sent to the RFC)
         I_FILE.appendRow();     
         I_FILE.setValue(textLine, "REC");                              
    } while (textLine != null);

  • Why do I get this NotSerializableException?

    Using NetBeans 6.7, glassfish V2.1.
    The code will compile, deploy and run, but when it initializes I get a NotSerializableException error.
    Any clues as to how I can get rid of this?
    Let me know if more information is needed.
    Thanks.
    In my main session bean (SessionBean1) I do the following in the init method:
        public String enc = "9W4xFQqTa56JZ8z9C+w8xw==";
        AESEncryption aes;
        public void init() {
            super.init();
            try {
                _init();
            } catch (Exception e) {
                log("SessionBean1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
            readCfg();
            fillCcList();
            fillStateList();
            fillCountryList();
            fillBusinessTypeList();
            fillContactList();
            fillQuarterList();
            fillMonthList();
            fillCcYearList();
            *aes = new AESEncryption( enc );*
            initialized = false;
            initializeSource();
        }Here is my AESEncryption class
    package fmtax;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class AESEncryption {
        byte[] rawKey;
        public AESEncryption( String strKey )
              char[] carray = strKey.toCharArray();
              rawKey = Base64Coder.decode(carray);
        public byte[] encrypt( String message )
            try
                // Get the KeyGenerator
                KeyGenerator kgen = KeyGenerator.getInstance("AES");
                kgen.init(128); // 192 and 256 bits may not be available
                char[] carray = Base64Coder.encode(rawKey);
                String strkey = new String(carray);
                SecretKeySpec skeySpec = new SecretKeySpec(rawKey, "AES");
                // Instantiate the cipher
                Cipher cipher = Cipher.getInstance("AES");
                cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
                byte[] encrypted = cipher.doFinal(message.getBytes());
                return encrypted;
            catch( Exception e )
                return new byte[1];
        public String decrypt( byte[] encrypted )
            try
                SecretKeySpec skeySpec = new SecretKeySpec(rawKey, "AES");
                // Instantiate the cipher
                Cipher cipher = Cipher.getInstance("AES");
                cipher.init(Cipher.DECRYPT_MODE, skeySpec);
                byte[] original = cipher.doFinal(encrypted);
                return new String(original);
            catch( Exception e )
                return "";
    }When the application tries to initialize, I get the following error:
    Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context '/FMTaxNL'
    PWC2785: Cannot serialize session attribute SessionBean1 for session c6cd82f3f97bd0574ddb969f8df7
    java.io.NotSerializableException: fmtax.AESEncryption
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
            at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1947)
    <...CUT TO FIT IN POST CHARACTER LIMIT - will post in separately if neecessary...>
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
            at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:670)
            at org.apache.catalina.session.StandardManager.unload(StandardManager.java:584)
            at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
            at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
            at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
            at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
            at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
            at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
    classLoader = WebappClassLoader
      delegate: true

    Thanks for the feedback.
    I removed the "aes" property from being a session bean property to beinig a local variable within the methods that need the security portion.
    That did not help.
    It looks like the issue is not with the session bean, but within the AESEncryption class, based on the error message.
    If I add 'implements Serializable' to my AESEncryption class definition, I get a different error (see below).
    I also had to add the import 'import java.io.Serializable;'.
    I don't think this is the basic problem, however, because I have never added 'implements Serializable' to any of my other classes and I do not get a serializable error on them.
    Both this error and the last one seem to point to something dealing with java.io.
    But, I do not have a clue as to what would cause that.
    PWC2768: IOException while loading persisted sessions: java.io.StreamCorruptedException: unexpected end of block data
    java.io.StreamCorruptedException: unexpected end of block data
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
            at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at org.apache.catalina.session.StandardSession.readRemainingObject(StandardSession.java:1827)
            at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1759)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at org.apache.catalina.session.StandardSession.deserialize(StandardSession.java:1125)
            at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:501)
            at org.apache.catalina.session.StandardManager.load(StandardManager.java:418)
            at org.apache.catalina.session.StandardManager.start(StandardManager.java:810)
            at org.apache.catalina.core.StandardContext.managerStart(StandardContext.java:4942)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:5259)
            at com.sun.enterprise.web.WebModule.start(WebModule.java:353)
            at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
            at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
            at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)

  • How to upload data in the pdf file to the R/3 with fileupload element ?....

    Hi Experts,
    I need to upload the data in the pdf file to the R/3 with fileupload element.
    But I am not able to get the correct data(it is confusion code) in the pdf file when I debug the programe. However, I am able to get the data if the data is in the txt or excel file.
    Do you give some hint for this problem ?
    Thanks & Regards,
    Tao

    Hi, experts,
    The version of R/3 : ABAP: 10, BASIS:11.
    Best regards,
    tao

  • FileUpload get filename and PATH?

    Hi everybody,
    is there a chance to get also the path from where to upload a file using the fileupload-UI?
    Thanks a lot
    Regards Mario

    Mario,
    No, this is not possible due to security restrictions imposed by browsers
    VS

  • Pre-fill the filename in Fileupload UI

    Hi,
    I am unable to pre-fill the filename in fileupoad UI.
    When I launch the WD app, on the browser it get the following URL
    http://devai063.private.xxxx.com:8081/sap/bc/webdynpro/sap/zgi_file_upload?sap-language=EN
    at the end I add &filename=c:benefit.txt and hit enter,
    http://devai063.private.xxxx.com:8081/sap/bc/webdynpro/sap/zgi_file_upload?sap-language=EN&filename=c:benefit.txt
    In WD window HANDLEDEFAULT method I am checking for the filename parameter if not empty I am setting the 'filename'  to the context of filename of fileuploadUI, but the app does not show the file name C:
    benefit.txt in the fileupload UI.
    I debugged the HANDLEDEFAULT and I can see the filename but somehow it is not setting to the filname for uploadfile UI.
    any advice is highly appreciated.
    Thanks,
    Ram

    From the online help:
    Technical Browser Details Beyond the Control of WDA
    Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore impossible to enter the file name in the entry field. The field always remains empty. The selection of the file name is therefore only possible in new browser versions using the Browse... button. You cannot enter the file name manually (using the keyboard or the Copy and Paste functions) or by setting the file name from the back end (directly or using context binding). For more details, read the security-related information in Internet Explorer 6 about handling <input type=file>.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm

  • Is there any way to get FileUpload.PosetedFile.Inputstream property as string?

    Hello,
    In my project i have used asp.net Fileupload control which works fine on my local machine. but when run that project on server i am not able to load the xls file. so i have used "Fileupload1.PostedFile.InputStream" property which returns as a Stream.
    By using this i can load excel file properly. but now i have to use as "string" instead of "stream" for further implementation. so how i can use "Fileupload1.PostedFile.InputStream" which returns Stream, and i can convert it into
    string and pass it to load excel file to run it properly on server also? can any one please help me?

    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
    You'll need to post it in the dedicated ASP.Net Forum
    http://forums.asp.net for more efficient responses, where you can contact ASP.NET experts. Thanks for understanding.

  • Attachements with apache commons fileupload

    I'm using:
    http://commons.apache.org/fileupload/
    to write file on server side (Tomcat running on Windows with XP or 2003).
    I'm sending data to servlet with doPost() as follows:
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                DiskFileItemFactory factory = new DiskFileItemFactory();
                factory.setSizeThreshold(4096);
                factory.setRepository(new File("test"));
                ServletFileUpload upload = new ServletFileUpload(factory);
                upload.setSizeMax(1000000);
                List fileItems = upload.parseRequest(request);
                Iterator i = fileItems.iterator();
                String comment = ((FileItem) i.next()).getString();
                FileItem fi = (FileItem) i.next();
                String fileName = fi.getName();
                // db
                fi.write(new File("C:/", fileName));
            } catch (Exception ex) {
                out.print(ex.getMessage());
            out.close();
        }but it's response is:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         Upload.doPost(Upload.java:69)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    root cause
    java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         Upload.doPost(Upload.java:69)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.
    Apache Tomcat/6.0.16don't know why.. any ideas?

    java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStreamThe mentioned class is missing in the runtime classpath.
    Add it (in this specific case, the JAR file with the mentioned class) to the classpath and the problem will disappear.
    This class is part of Commons IO. Read the dependencies page at FileUpload user guide which JAR's you all need.

  • Fileupload broken in Firefox 3.6.3 Flash 10.0.45.2 Mac OS X

    I have been trying to get some basic file upload of an image working using Flex 4 and Flash 10, but when I upload an image drag and drop stops working in Firefox 3.6.3 on Mac OS X.
    After the fileupload loads the new PNG file, it displays correctly, but drag and drop events don't appear to propagate any more, and the app generally freezes up.  On some occasions the app starts working again until the next file upload.
    I tried calling the fileupload code without doing anything with the loaded file, and the problem still occurs.
    This exact code works as expected with Safari and Google Chrome (5.0.375.55) on Mac OS X.
    I don't think I am trying to do anything too complex - I do not have a workaround. Ultimately I want to store the images in a back end database etc., but there is no getting around the need for fileupload.  I have moved from Flex 3 / Flash 9 fileupload due to well documented and wide ranging problems.
    Any suggestions are welcome...
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                      creationComplete="init()">
         <s:layout>
              <s:HorizontalLayout/>
         </s:layout>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   import mx.core.IUIComponent;
                   import mx.events.DragEvent;
                   import mx.managers.DragManager;
                   import mx.rpc.AsyncToken;
                   import mx.rpc.events.FaultEvent;
                   import mx.rpc.events.ResultEvent;
                   [Bindable]
                   var listContent:ArrayCollection = new ArrayCollection();
                   private function init():void
                        listContent.addItem({heading1:"qwe", heading2:"qwew", heading3:"wwww"});
                        listContent.addItem({heading1:"sdasd", heading2:"asdasd", heading3:"asdsad"});
                        listContent.addItem({heading1:"zxcxc", heading2:"zxcxzc", heading3:"zxczxc"});
    // drag drop
                   private function dragEnterHandler(e:DragEvent):void {
                        DragManager.acceptDragDrop(e.currentTarget as IUIComponent);
                   private function dropHandler(event:DragEvent):void {
                        Alert.show("got the drop");
    // file uplaod stuff               
                   private var fileReference:FileReference = new FileReference();
                   private function uploadFile():void {
                        var fileFilter:FileFilter = new FileFilter("png","*.png");
                        fileReference.browse([fileFilter]);
                        fileReference.addEventListener(Event.SELECT, onFileSelected);
                        fileReference.addEventListener(Event.COMPLETE, onFileCompleted);
                   private function onFileSelected(event:Event):void {   
                        fileReference.load();
                   private function onFileCompleted(event:Event):void {
                        fileReference = event.currentTarget as FileReference;
                        var data:ByteArray = fileReference.data; 
                         background.source = fileReference.data;
              ]]>
         </fx:Script>
         <s:Scroller width="100%" height="100%" dragEnter="dragEnterHandler(event)" dragDrop="dropHandler(event)">
              <s:Group width="100%" height="100%">
                   <mx:Image id="background" />
              </s:Group>
         </s:Scroller>
         <s:Button label="Upload image" click="{uploadFile()}" />
         <mx:DataGrid dataProvider="{listContent}" dragEnabled="true">
              <mx:columns>
                   <mx:DataGridColumn headerText="Column 1" dataField="heading1"/>
                   <mx:DataGridColumn headerText="Column 2" dataField="heading2"/>
                   <mx:DataGridColumn headerText="Column 3" dataField="heading3"/>
              </mx:columns>
         </mx:DataGrid>
    </s:Application>

    Your best bet is to file a bug.

Maybe you are looking for