What's the error of this file-upload code?

hi,
I have written following code for file selection:
<form action="display.jsp" method="POST" enctype="multipart/form-data">
<input type="file" name="File1">
<input type="submit" name = "button" value="Submit">
</form>And my project another file display.jsp which code is:
<%@ page import="org.apache.commons.fileupload.*"%>
<%@page import="java.io.*" %>
<%@page import="java.util.*" %>
<%
     out.println("Content Type: "+request.getContentType());
     boolean isMultipart=FileUpload.isMultipartContent(request);
     DiskFileUpload upload=new DiskFileUpload();
     List items=upload.parseRequest(request);
     Iterator iter=items.iterator();
     while(iter.hasNext()){
          FileItem item=(FileItem)iter.next();
          if(item.isFormField()){
               out.println("SIZE: "+item.getSize());
            File fNew= new File(application.getRealPath("/"), item.getName());
             out.println(fNew.getAbsolutePath());
            item.write(fNew);
          else
     out.println("Field ="+item.getFieldName());
%>After that, i put on common-fileupload-1.1..jar on the project's /WebConcontent/WEB-INF/lib/ directory. And i have also add the common--fileupload-1.1.1. jar in the project build path. Further that i have got following error:
Error is:
exception
org.apache.jasper.JasperException: org/apache/commons/io/output/DeferredFileOutputStream
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.display_jsp._jspService(display_jsp.java:78)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
     org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:102)
     org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
     org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
     org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
     org.apache.jsp.display_jsp._jspService(display_jsp.java:53)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Why i have got this error? IS there anybody can help me? What will be the solution?Please Help me?
With regards
Bina

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
Means you are missing a class file from the class path. Most likely cause is a missing jar file. The Apache Commons utilities often have dependancies on other Commons projects. This looks like it is looking for the Apache Commons IO jar file. Download the jar file and add it to the WEB-INF/lib directory.

Similar Messages

  • Excel 2010: I get the error message "This file can't be previewed because of an error in the Microsoft Excel previewer." even though Advanced Properties is set to Save Thumbnails for all Excel Documents.

    Excel 2010: I get the error message "This file can't be previewed because of an error in the Microsoft Excel previewer." even though Advanced Properties is set to Save Thumbnails for all Excel Documents and I've run Repair on Microsoft Office.
     I don't know what else to try.
    Any help would be appreciated. Thanks.

    A hotfix request has already been submitted for this issue and we have also documented it here
    http://support.microsoft.com/kb/983097
    Thanks.
    Tony Chen
    TechNet Community Support

  • What's the use of this file?

    I found a file with the name [email protected] in $oracle_home/dbs.
    I deleted it and my oracle works as usual.
    What's the use of this file?
    Thanks

    I hope you took a backup of that file before zapping it. As a rule, it's a very bad idea to just delete a file in the Oracle directory to see whether anything breaks.
    If you had read the documentation you would have discovered that [email protected] is part of the RMAN configuration. So your database will continue to work up until the point you try to use RMAN to recover it. If you don't use RMAN then you probably won't miss that file.
    Cheers, APC

  • What does the error message "Opening file in iCloud(state=5) mean?

    I have been ushing iCloud to backup my data for Ascendo DataVault for my iPhone 5 (iOS 7.0.4) and original iPad (iOS 5.1.1) very successfully for some time.  Both devices are synchronized with my PC using Wi-Fi.  The DataVault data on my PC is also synchronized on my wife's iPhone 5 (iOS 7.0.4) and iPad Mini (iOS 7.0.4).  Recently, every attempt to synchronize my iPhone or iPad with my iCloud results in the error message "Opening file in iCloud(state=5)," but my wife's iPhone and iPad continue to synchronize with her iCloud without any problems.  What does this error message mean, and is there a cure for the problem?

    OK found a solution!
    It is really lame!
    NEVER add a reminder in iCal dragging them into the Week or Day view!!!
    Change to Month view and then drag the reminder on the desired day!
    You can now change to Week or Day view and move the reminder to the selected hours.
    Please help share this solution and click like to get Apple to finally fix this issue, which is clearly on their side.
    Thank you

  • What's the error in this package

    dear all,
    can you plz tell me what's the erro in this package plz
    SQL> CREATE OR REPLACE PACKAGE discounts
      2  IS
      3  g_id NUMBER := 7839;
      4  discount_rate NUMBER := 0.00;
      5  PROCEDURE display_price (p_price NUMBER);
      6  END discounts;
      7  /
    Package created.
    SQL>
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY discounts
      2  IS
      3  PROCEDURE display_price (p_price NUMBER)
      4  IS
      5  BEGIN
      6  DBMS_OUTPUT.PUT_LINE ( 'Discounted '
      7  ||TO_CHAR(p_price*NVL(discount_rate, 1)));
      8  END ;
      9  discount_rate:= 0.10;
    10  END ;
    11  /
    Warning: Package Body created with compilation errors.
    SQL>
    SQL> show errors;
    Errors for PACKAGE BODY DISCOUNTS:
    LINE/COL ERROR
    9/1      PLS-00103: Encountered the symbol "DISCOUNT_RATE" when expecting
             one of the following:
             begin end function package pragma procedure form
             The symbol "begin" was substituted for "DISCOUNT_RATE" to
             continue.
    SQL>

    if you want declare a private variable you need to declare at package body and remove from the package specification
    something like this
    @10g> CREATE OR REPLACE PACKAGE discounts
      2    IS
      3   g_id NUMBER := 7839;
      4    PROCEDURE display_price (p_price NUMBER);
      5    END discounts;
      6  /
    Package created.
    @10g> 
    @10g> CREATE OR REPLACE PACKAGE BODY discounts
      2    IS
      3    discount_rate NUMBER := 0.10; /* Private declaration */
      4  
      5    PROCEDURE display_price (p_price NUMBER)
      6    IS
      7    BEGIN
      8    DBMS_OUTPUT.PUT_LINE ( 'Discounted '
      9    ||TO_CHAR(p_price*NVL(discount_rate, 1)));
    10    END ;
    11  END ;
    12  /
    Package body created.You can't assign values to variables out of procedure unless you declare and assign a initial value.
    Edited by: dask99 on Oct 26, 2009 8:23 AM

  • Does any one know how to resolve the error while flat file upload

    Hey guys, I am so struck with this problem, please do let me know if anyone has any suggestions and ideas.
    1. I created three InfoObjects, Material Number, Name and Price,which is  a keyfigure and has data type DEC and fixed currency USD.
    Material Number is "With Master Data ", "With Text" and i added Name and Price as attributes to that.
    2.
    After that i created an Application component, and therafter a data source for Master data Attibutes.
    Now i select my flat file which is .csv file, in this data source. When I click "Load Example Data", i get all the fields from flat file, but the data type for PRICE changes to FLTP with length 16 instead of remaining DEC.
    Does anyone have any idea why on earth is this change of Data type taking place ?
    Please do me a favour by answering if you know about this problem. Thanks, appreciate it . Byee. And yeah, m just starting off in SAP so I am a total amateur unlike most of the people here.

    Am workin on BI 7.0.
    Let me put it in another way :
    Created Infoobjects:      1) Material No , 2) Material Name  3 ) Price which is the Key Figure
    Material No -
    has attributes Material Name and Price and " WIth Master Data", With ' Text"
    Price: -
    data type DEC, fixed currency - USD
    After doing things.
    Created Application Component:
    then, Right Click - Create Data Source,
    Selected -- Master Data Attributes
    After that from "EXTRACTIO' tab , selected the flat file, which is *.csv
    and then in DATA FORMAT - " SEPERATED WITH SEPERATOR"
    Then from "PROPOSAL" tab, when i click Load example data, the data from flat file shows up here, but the field PRICE now has Data Type -- " FLTP" and lenght "16"
    I hope i was clear enough. thanks

  • What is the error with this code ??

    i'm trying to execute the following AS3 code:
    var itemsArr:Array = new Array ();
    var i:int; 
          var loaderAds:URLLoader = new URLLoader();
          loaderAds.load(new URLRequest("ads.txt"));   
          loaderAds.addEventListener(Event.COMPLETE, completeHandlerAds);
          function completeHandlerAds(eventAds:Event):void {
              var loaderAds:URLLoader = URLLoader(eventAds.target);
              var varsAds:URLVariables = new URLVariables(loaderAds.data);
                itemsArr = varsAds.names.split(";");
                        for (i = 0; i < (itemsArr.length); i++) { 
                                trace("itemsArr, Processing: " + itemsArr[i]);
           var loaderProps:URLLoader = new URLLoader();
          loaderProps.load(new URLRequest(itemsArr[i]+".txt"));   
          loaderProps.addEventListener(Event.COMPLETE, completeHandlerProps);
          trace("one: " + itemsArr[i]);
          function completeHandlerProps(eventProps:Event):void {
                  trace("two: " + itemsArr[i]);
          }// end of fn for props
                        }//end of "for" loop of ads names
            }//end of fn for ads names
    But i get the following output:
    adsNames Array: ad0,ad1
    adsNames, Processing: ad0
    ad0
    adsNames, Processing: ad1
    ad1
    null
    TypeError: Error #2007: Parameter name must be non-null.
         at flash.display::DisplayObject/set name()
         at MethodInfo-279()
         at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio  n()
         at flash.events::EventDispatcher/dispatchEvent()
         at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    null
    TypeError: Error #2007: Parameter name must be non-null.
         at flash.display::DisplayObject/set name()
         at MethodInfo-279()
         at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio  n()
         at flash.events::EventDispatcher/dispatchEvent()
         at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    As you see, the "red text" is errors, Can you tell me the reason for it ?
    And also, tracing "itemsArr[i]" in the second time, always give "null", also in the first time, it give the correct value, Why ?

    the red text not appear after i posted the topic, but you can see the errors on the output
    and, you've to create to text files, first called "ads.txt" and put in it "names=ad0;ad1"
    second one called "ad0.txt" and put anything in it, and another called "ad1.txt" and put anything in it
    all these files should be in the same dir of flash file

  • What is the error in this one line of code!

    s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
    I am using this line of code in my programe but i am getting the following error.
    C:\shahzad\Easter.java:28: illegal start of expression
    s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
    Please help me solvingg this problem
    thanks.

    s=s-(s/28)*[1-(s/28)*(29/s+1)*(21-q/11)];
    [] brakets ae used to index arrays, are you using an array somewhere????
    arr=5; for example....
    in either event youl need to make changes.
    assuming no array is involved simply change [] to ()
    if still causing problems try adding extara()
    s= (s-(s/28))*( (1-(s/28)) * ( (29/s)+1) * (21-(q/11)) );

  • What's the error in this code?

    I keep getting an error message at "line 1 column 97" which is the letter "i" in the second "if."
    begin if :P23_START_DATE is null or :P23_START_DATE = ' ' then :P23_START_DATE:= '01-JAN-2001';
    if :P23_END_DATE = is null or :P23_END_DATE = ' ' then
    :P23_END_DATE = '31-DEC-2099';
    select 'http://apexdevapp1.ci.raleigh.nc.us:7777',
    user_name, count(ID) total
    FROM eba_ver2_cust_activity
    where ACTIVITY_DATE <= to_char(to_date(:P23_END_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
    and ACTIVITY_DATE >= to_char(to_date(:P23_START_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
    group by
    user_name,
    'http://apexdevapp1.ci.raleigh.nc.us:7777'
    end;
    Honestly, I don't see where the problem is. Help me please.
    Steve "the n00b" in Raleigh NC

    ackness wrote:
    You could forgo the IF statements altogether by doing using NVL and TRIM this:
    begin
    select
    'http://apexdevapp1.ci.raleigh.nc.us:7777',
    user_name, count(ID) total
    FROM eba_ver2_cust_activity
    where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099');
    group by
    user_name,
    'http://apexdevapp1.ci.raleigh.nc.us:7777';
    end;
    also you can simplify the GROUP BY by
    begin
    select
    MAXX('http://apexdevapp1.ci.raleigh.nc.us:7777') URL,
    user_name, count(ID) total
    FROM eba_ver2_cust_activity
    where ACTIVITY_DATE BETWEEN NVL(TRIM((:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM((:P23_END_DATE), '31-DEC-2099');
    group by
    user_name;
    end;Ackness, I tried your first suggestion, and got this when I applied the changes.
    1 error has occurred
    Failed to parse SQL query:
    BEGIN SELECT 'http://apexdevapp1.ci.raleigh.nc.us:7777', user_name, count(ID) total FROM eba_ver2_cust_activity where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099'); group by user_name, 'http://apexdevapp1.ci.raleigh.nc.us:7777'; end
    ORA-06550: line 5, column 115: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
    Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
    I can't for the life of me figure out where the invalid character is after "begin." All I can see is a blank character. Thanks for your help.
    Steve "the n00b"

  • What is the error in this program??????

    class FindArea
    public static void main(String args[])
    float radius=7.0f;
    float area=(22/7)*(radius)*(radius);
    System.out.println(area);
    When i execute the above program i am getting output as 147.0 why it is happening???? I dont understand.....
    Actually it should come...154!!!!!!!!

    When you divide one int by another the result is "truncated" (the decimal part is
    thrown away). If you don't want this to happen you have to tell the compiler to
    treat your integer as a double (or float). This is done in the first two cases, but not
    the third.public class IntOrDouble {
        public static void main(String[] args) {
                // prints 15.0
            double answer1 = ((double)3 / 2) * 10;
            System.out.println("answer 1 = " + answer1);
                // prints 15.0
            double answer2 = (3.0 / 2) * 10;
            System.out.println("answer 2 = " + answer2);
                // prints 10.0 because 3/2 is 1
            double answer3 = (3 / 2) * 10;
            System.out.println("answer 3 = " + answer3);
    }Test: so, what will (double)(3/2)*10 print?

  • What's the error in this snippet? very urgent!

    import java.io.*;
    import java.net.*;
    public class HttpClient {
         private String msg =null;
         private int gsm =0;
         private DataOutputStream out = null;
         private Socket HttpSocket = null;
         private String message = new String("Hello Socket");
         public HttpClient(String msg,int gsm) {
              this.msg = msg;
              this.gsm = gsm;
         try {
              HttpSocket = new Socket("127.0.0.1",3333);
              out = new DataOutputStream(HttpSocket.getOutputStream());
         } catch(UnknownHostException e) {
              System.out.println("Don't know about host:127.0.0.1");
              System.exit(1);
         } catch(IOException e) {
              System.out.println("Couldn't get I/o connection for 127.0.0.1");
              System.exit(1);
    out.writeChars(message);
    out.close();
    HttpSocket.close();
    /*When i compile the following errors are detected:
    C:\Work\sms\HttpClient.java:29: <identifier> expected
    out.writeChars(message);
    ^
    C:\Work\sms\HttpClient.java:30: <identifier> expected
    out.close();
    ^
    C:\Work\sms\HttpClient.java:31: <identifier> expected
    HttpSocket.close();
    ^

    Its just some declaration errors...
    just do as follow:
        public HttpClient(String msg,int gsm)
            this.msg = msg;
            this.gsm = gsm;
            try
                HttpSocket = new Socket("127.0.0.1",3333);
                out = new DataOutputStream(HttpSocket.getOutputStream());
                // guess you shall change this with out.writeChars(msg)
                out.writeChars(message);
                out.close();
                HttpSocket.close();
            catch(UnknownHostException e)
                System.out.println("Don't know about host:127.0.0.1");
                System.exit(1);
            catch(IOException e)
                System.out.println("Couldn't get I/o connection for 127.0.0.1");
                System.exit(1);
        }good luck!

  • What is the error message "This item cannot be shared while it is still referencing media on the camera" mean?

    When I tried to create a movie, I got this message: "This item cannot be shared while it is still referencing media on the camera".  What does it mean? 
    How do I resolve it?

    eDude.com wrote: ... What does it mean? ....
    It means that you cannot share something unless it resides on your computer.
    eDude.com wrote:... How do I resolve it?
    Import all clips that you plan to use in your finished project to your Mac before you edit and share your finished work. 
    For help see iMovie '11: Overview: Importing video and iMovie ’11: Import Video.

  • What' s the error in this procedure

    set serveroutput on
    create or replace PROCEDURE p1
    (v_quote IN number,
    v_stock IN Number,
    v_approval OUT number)
    IS
    BEGIN
    V_approval:=v_quote + v_stock;
    dbms_output.put_line(v_approval);
    END;
    call p1(7,8);

    But your procedure has 3 arguments, not 2. You must specify all of them, the last being a variable where the result can go. Perhaps you want something like this:
    SQL> create or replace PROCEDURE p1 (v_quote IN number,
      2                                  v_stock IN Number,
      3                                  v_approval OUT number) IS
      4  BEGIN
      5     V_approval:=v_quote + v_stock;
      6  END;
      7  /
    Procedure created.
    SQL> var  approval number
    SQL> exec p1(7, 8, :approval);
    PL/SQL procedure successfully completed.
    SQL> print approval
                APPROVAL
                      15(by the way, you shouldn't double post. Especially 6 minutes apart)

  • What is the error in this code

    hi everone
    I write this code in push button
         declare
              x varchar2(222);
         begin
              x:=get_application_property(:system.mode);
              message(x);
              end;
    to know the system mode
    but the resullt was exeception ora-06502

    simple write
    x := :system.mode;
    or
    message(:system.mode);
    message(:system.mode);Best way to resolve the issue is always check Forms online help first

  • What is the error in this trigger

    create or replace trigger tt1
    after insert on EXERCISE2_T
    referencing new as new
    for each row
    declare
    v_excd EXERCISE2_T.EX_CD%type:=(CASE EX_CD
        WHEN 'X' THEN 'Extracted';
        WHEN 'F' THEN 'Failed';
        WHEN 'S' THEN 'Skipped';
        WHEN 'C' THEN 'Cancelled';
        ELSE 'no');
    begin
    insert into DWH_DEX2_RD_T(DK_EX2,
    EX2_CD,
    EX2_NM) values(:new.EX_ID,:new.EX_CD,v_excd);
    end;error
    3/30 PLS-00103: Encountered the symbol ";" when expecting one of the following:
    * & = - + < / > at else end in is mod remainder not rem when
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || multiset member SUBMULTISET_

    create or replace trigger tt1
      after insert
      on exercise2_t
      referencing new as new
      for each row
    declare
      v_excd                        exercise2_t.ex_cd%type
        := case ex_cd
        when 'X'
          then 'Extracted'
        when 'F'
          then 'Failed'
        when 'S'
          then 'Skipped'
        when 'C'
          then 'Cancelled'
        else 'no'
      end;
    begin
      insert into dwh_dex2_rd_t
                    dk_ex2, ex2_cd, ex2_nm )
           values (
                    :new.ex_id, :new.ex_cd, v_excd );
    end;
    /In other words: the semi-columns and the case-END.

Maybe you are looking for

  • Why doesn,t  my mail iccon work?

    Why doesn't my mail icon work?

  • Image not shown - mysterious error

    We recently encountered a -to us very mysterious- problem in a report: We have to fields A, B and a repeating frame R on the same level. The repeating frame shows an image from a db blob. We have A and B side by side and R below that. A and B have fo

  • Sprite backup downloaded from Palm site won't run on my Treo 750 with Windows XP on laptop

    I have a Treo 750 with WMD 5.0 and Windows XP on my laptop.  I have a 2G mini storage card.  I downloaded the free Sprite software from Palm support and installed it on laptop and the storage card.  When I run the set-up wizard on the PC, I get an er

  • How to make your drawings into a movie?

    There is this series on youtube called 'Simons Cat' and I know its only his drawings that are made into a movie. I know how to make a video with pictures just the still pictures, thats not what I want, I want my drawings to move so its like 'Simons C

  • Continually Polling Server / Status 304 Loops

    I have pages on my website that use a Javascript loop to display an animation. Here is a typical page, the RADAR image is the animation in question: http://ozforecast.com.au/cgi-bin/weather.cgi?station=Toowoomba.QLD&radar I have noticed in my Apache