Threading problem during File Upload with Apache faces upload tag

First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
3) Validates Input(Checks to see whether the User has input the correct file)
4) Updates Backing Bean or Model to reflect the values.
5) Renders response to user.
I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
<h:form id="uploadForm" enctype="multipart/form-data">
<x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
</h:form>
In the backing bean
private UploadedFile fileContents;
     public UploadedFile getFileContents() {
          return fileContents;
     public void setFileContents(UploadedFile fileContents) {
          System.out.println("File being uploaded...");
          this.fileContents = fileContents;
Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
In web.xml i am using like this
<filter>
<filter-name>ExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>600m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>10m</param-value>
</init-param>
     <init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/uploadfolder/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ExtensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
The upload process is working perfectly fine.
Now coming to the problem:
Suppose one user is logging into the application & uploading say 400MB of files.
Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.

Dear friend,
i am also trying to upload using the common file upload.
when try to run the file error is coming
can give some suggestion.
can i use if concurrent user file upload at a time

Similar Messages

  • Trailing spaces problem during file content conversion

    I have developed a proxy to file scenario.And am using file content conversion for creating the file. The file is to be a fixed length file.
    File Structure
    <Header>
    <Item>
    <Item Trailer>
    <File Trailer>
    Each tab in the file has the last character mapped to spaces.
    Eg: Header00000001  2006011700000000020060<blank   space>
    Item00000001        2006011700000000020060<blank   space>
    The problem is that during file content conversion. XI does not preserve trailing spaces at the end of the line i.e.if a particular line in the file ends with space. It terminates the line at the last non-space character (in this case at 060).
    However we are required to maintain these trailing spaces at the end of each line.
    I have tried preserve white space in data type that does not work.
    I know that xslt mapping may solve the problem but I am looking for a workaround with my current graphical mapping.
    Looking for suggestions !!                                
    Thanks,
    Rashida

    Hi,
    I have the problem quite opposite to this where we are getting the trailing spaces at end of each record which should not come.
    File structure is
    <Record>
    - <Data>
      <Content>11/09/2007@210@ZACSL007@GBB-56436@PS01@29@1044@19@646@0</Content>
      </Data>
      </Record>
    ............. n records
    <Header>
      <File_Name>UK01</File_Name>
      </Header>
    Record structure in communication channel used is
    Header, Data
    Data.fieldFixedLengths     1024
    Data.addHeaderLine     0
    Header.addHeaderLine     0
    Header.fieldFixedLengths     0
    Header.fixedLengthTooShortHandling     Cut
    Data.fixedLengthTooShortHandling     Cut
    Header.endSeparator     '0'
    Actually if the length of record is less than 1024, rest of the length is being filled with spaces which should not occur.
    Many advanced thanks.
    Jitender

  • Jar file for org.apache.taglibs.standard.tag.el.core.SetTag

    hi all,
    i had been trying to debug the jsp code in eclipse. which requires the project to identify few class files. i am not able to find the jar file which has the implementation of the below mentioned files. (i am using jboss as application server)
    org.apache.taglibs.standard.tag.el.core.SetTag
    org.apache.taglibs.standard.tag.el.fmt.BundleTag
    the list is long... but all the class files refer to the same package.
    your help is much appreciated.
    --thanks a lot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hello ritu...
    you would require standard-1.1.2.jar .....
    try with that....
    u can download it from -
    http://www.java2s.com/Code/Jar/CatalogJar.htm
    classes contained in standard-1.1.2.jar -
    org.apache.taglibs.standard.tag.el.core.OutTag.class
    org.apache.taglibs.standard.tag.el.core.ParamTag.class
    org.apache.taglibs.standard.tag.el.core.RedirectTag.class
    org.apache.taglibs.standard.tag.el.core.SetTag.class
    org.apache.taglibs.standard.tag.el.core.UrlTag.class
    org.apache.taglibs.standard.tag.el.core.WhenTag.class
    org.apache.taglibs.standard.tag.el.fmt.BundleTag.class
    org.apache.taglibs.standard.tag.el.fmt.FormatDateTag.class
    org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag.class
    regards
    vamsi

  • Facing problem during file upload

    hi
    we r designing a portal where it is required to upload files based on individual users who have logged in.
    For this purpose we r using a file field in one page and http upload tag in another page.
    The file uploads successfuly to the database, but the problem is that we r not able to get the value of pReq.getUser() in the page where the httpfileupload tag exists.
    we noted that request.getParameter() and session.getValue() is also not valid in this page.
    we also tried setting the session value to true in provider.xml. Even this didnt work.
    we noted that this problem comes only when the file field is used. can anyone tell me how to solve this??
    Thanks in advance.
    voyager

    request.getParameter() nor session.getParameter() does not fetch anything. the value is null
    Regards,
    voyager

  • Problem during configuring SSO with APEX 4.1

    Hello everybody,
    I'm trying to configure my APEX application to use SSO, but I have big problems with ssosdk902.zip file.
    During execution of the loadsdk.sql script it creates package "wwsec_sso_enabler" but APEX 4.1 wants to have "wwsec_sso_enabler_private". For me it a clear sign, that I'm using some old SSOSDK.
    Can somebody tell me where to find the current "ssosdk"?
    I'm using OAS10gR2 and the interesting thing is that in the DB schema ORASSO package "wwsec_sso_enabler_private" exists, but it doesn't helps me. It is at the other machine. I must have it on the same instance, where APEX is running.
    It looks like packaging error by Oracle. Can somebody help me?
    Thanks,
    Ianko

    Hi Anton,
    that's why I added the IF statement around the code block, to guarantee that it only runs if the URL contains auto-login data (i.e. P101_UNAME). Setting FSP_AFTER_LOGIN_URL to null avoids a loop when the login fails. If we keep FSP_AFTER_LOGIN_URL, the wwv_flow_custom_auth_std.login procedure will redirect to page 101 and the before header process will run again, re-executing wwv_flow_custom_auth_std.login , etc.
    It might be clearer to put the before header code into the authentication itself. The invalid session procedure is the right place for that, but it's use is very sparsely documented yet.
    I created a 2nd copy of your original application (22274), where I removed the before header process and added this invalid session procedure:
    procedure autologon_on_invalid_session
    is
      v_user                VARCHAR2(4000);
      v_pass                VARCHAR2(4000);
      v_fsp_after_login_url VARCHAR2(4000) := :FSP_AFTER_LOGIN_URL;
      v_user_pos            pls_integer    := instr(v_fsp_after_login_url, 'P101_UNAME:');
    BEGIN
      if apex_application.g_flow_step_id != 101 and v_user_pos > 0 then
        v_user := substr(v_fsp_after_login_url, v_user_pos+11);
        wwv_flow_custom_auth_std.login(
            P_UNAME       => v_user,
            P_PASSWORD    => v_pass,
            P_SESSION_ID  => v('APP_SESSION'),
            P_FLOW_PAGE   => :APP_ID||':1' );
        apex_application.stop_apex_engine;
      end if;
    END;If the current page is not 101 (the login page) and the URL (which was copied into the deep link item) contains the autologin credentials, call login. The finall call to apex_application.stop_apex_engine stops Apex from continuing it's default invalid session handling, which is to redirect to the login page.
    Regards,
    Christian

  • Problems installing CF 10 with Apache 2.2.24 (or 2.4) on RHEL 6.4

    Built Apache using openssl 1.0.1e (updated LD_LIBRARY_PATH to reflect the correct openssl libs) and pcre. Configure for build was:
    configure --enable-ssl=shared --with-ssl=/usr/local/ssl  --enable-so --with-included-apr --with-pcre  --with-perl
    Also downloaded and built the connector from http://helpx.adobe.com/coldfusion/kb/rhel-connector-configuration.html after the vanilla CF install didn't work. I get the following when I try to start up CF:
    [root@web01 logs]# /etc/rc.d/init.d/coldfusion_10 start
    Starting ColdFusion 10 server instance named cfusion ...
    The ColdFusion 10 server instance named cfusion is starting up and will be available shortly.
    nohup: appending output to `nohup.out'
    ======================================================================
    Running the ColdFusion 10 connector wizard
    ======================================================================
    Configuring the web server connector (Launched on the first run of the ColdFusion 10 start script)
    Running /usr/local/apache2/conf connector wizard...
    =======================================
    There was an error while running the connector wizard
    Connector installation was not successful
    =======================================
    ======================================================================
    ColdFusion 10 server instance named cfusion has been started.
    ColdFusion 10 will write logs to /opt/coldfusion10/cfusion/logs/coldfusion-out.log
    ======================================================================
    The wsconfig.log contains the following:
    [root@web01 wsconfig]# cat wsconfig.log
    # Created by ColdFusion on 05/28 15:15:23
    05/28 15:15:23 info Tomcat Connector
    05/28 15:15:23 debug command line: -ws Apache -bin /usr/local/apache2/bin/httpd -script /usr/local/apache2/bin/apachectl -dir /usr/local/apache2/conf -v
    05/28 15:15:23 info Red Hat Enterprise Linux Server release 6.4 (Santiago)
    05/28 15:15:23 debug Using Apache binary /usr/local/apache2/bin/httpd
    05/28 15:15:23 info Server's Module Magic Number: 20051115:31.  Supported major magic numbers on this platform are 20020628 and 20020903.
    05/28 15:15:23 info Attempting to build connector from sources
    05/28 15:15:23 info Server version: Apache/2.2.24 (Unix)
    05/28 15:15:23 debug Using Apache control script /usr/local/apache2/bin/apachectl
    05/28 15:15:23 debug Parsing Apache configuration file /usr/local/apache2/conf/httpd.conf
    05/28 15:15:23 debug Exec'ing chmod 777 /opt/coldfusion10/config/wsconfig/1
    05/28 15:15:23 debug Set permission to 777 on /opt/coldfusion10/config/wsconfig/1
    05/28 15:15:23 debug Exec'ing chmod +x /opt/coldfusion10/config/wsconfig/1/mod_jk.so
    05/28 15:15:23 debug Set permission to execute on /opt/coldfusion10/config/wsconfig/1/mod_jk.so
    05/28 15:15:23 debug Created file /opt/coldfusion10/config/wsconfig/1/mod_jk.so
    05/28 15:15:23 debug Wrote file /usr/local/apache2/conf/httpd.conf
    05/28 15:15:23 debug Added ColdFusion configuration to Apache configuration file /usr/local/apache2/conf/httpd.conf
    05/28 15:15:23 debug Created file /opt/coldfusion10/config/wsconfig/1/README.txt
    05/28 15:15:23 debug Wrote file /opt/coldfusion10/config/wsconfig/wsconfig.properties
    05/28 15:15:23 debug Exec'ing /usr/local/apache2/bin/apachectl restart
    05/28 15:15:23 error Error running "/usr/local/apache2/bin/apachectl restart": exit code was 1
    05/28 15:15:23 error Error restarting Apache server.  The web server must be restarted to complete this operation.
    com.adobe.coldfusion.connector.connectorinstaller.WebServerException: Error restarting Apache server.  The web server must be restarted to complete this operation.
        at com.adobe.coldfusion.connector.connectorinstaller.ApacheInstaller.restartWS(ApacheInstall er.java:480)
        at com.adobe.coldfusion.connector.connectorinstaller.ApacheInstaller.installConnector(Apache Installer.java:269)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.installConnector(Con nectorInstaller.java:340)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.doIt(ConnectorInstal ler.java:284)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.main(ConnectorInstal ler.java:741)
    05/28 15:16:37 info Tomcat Connector
    05/28 15:16:37 debug command line: -ws Apache -dir /usr/local/apache2/conf -bin /usr/local/apache2/bin/httpd -script /usr/local/apache2/bin/apachectl -cfide /opt/coldfusion10/cfusion/wwwroot/CFIDE -v
    05/28 15:16:37 error This web server is already configured for ColdFusion.
    com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstallerException: This web server is already configured for ColdFusion.
        at com.adobe.coldfusion.connector.connectorinstaller.ApacheInstaller.installConnector(Apache Installer.java:187)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.installConnector(Con nectorInstaller.java:340)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.doIt(ConnectorInstal ler.java:284)
        at com.adobe.coldfusion.connector.connectorinstaller.ConnectorInstaller.main(ConnectorInstal ler.java:741)
    I've searched and tried just about everything I could find relating to the error info.

    Hi,
    RHEL 6.4 is not the supported version of RHEL, Supported version are 5.6 and 6.1. We published an article you can try if that helps.
    http://helpx.adobe.com/coldfusion/kb/rhel-connector-configuration.html
    However if that doesn't work please try this in Supported environment.
    Regards,
    Priyank

  • Problem ContourHD files 720p60fps with FCP 7

    Hi,
    Sorry for my english but I send this message from France.
    I bought a Contour HD 1080p for my outdoor sports sessions.
    I record with this cam in the Action Settings. The format of the files is .mov, Ambarella AVC encoder, 1280x720, AAC stereo 48 Khz, 59.94 IPS.
    I try to import these files to FCP 7 but it did not recognize the files.Does someone have already this problem ?
    What can I do to resolve it ?
    Many thanks for your help
    Fred

    Sounds like a variation of AVCHD. Do they open in Quicktime? If so, you can try opening it in Compressor and converting to ProRes.

  • I have a problem sending files along with thier directories to server

    The Problem is i couldnt understand the sequence in which should the file transfers will execute.....
    Here is the Code ......
    The **************Error************* i get is that it makes one dir then other one and paste one file in it after writing another file in the second loop it gives error on write UTF that Socket write Error COnnection Reset by peer
    ***************************CLIENT************************
    package oam.filemanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    import oam.beans.*;
    public class FileClient {
    Socket socket;
    DataOutputStream dataout;
    FileBean file;
    public void SetSocket() {
    //Create socket connection
    try {
    socket = new Socket("localhost", 9898);
    dataout = new DataOutputStream(socket.getOutputStream());
    String wavfiles []=null;
    //Directory & Wavfiles Manipulation
    file=new FileBean();
    String dirs []= file.getDirsForSocket("Accounts//");
    for(int i=0;i<dirs.length;i++){
    wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
    //sending Username & DIR
    dataout.writeUTF(dirs);
    if (wavfiles.length==0)
    dataout.writeUTF("no");
    for (int j=0;j<wavfiles.length;j++){       
    //Sending Filename
    dataout.writeUTF(wavfiles[j]);
    //getting file to be send
    File f = new File("Accounts//"+dirs[i]+"//"+wavfiles[j]);
    int fileLength = (int) f.length();
    System.out.println("fileLength " + fileLength);
    byte data[] = new byte[fileLength]; //settting array of byte to file len
    //reading from file acha
    FileInputStream fis = new FileInputStream(f);
    // Send file length
    dataout.writeInt(fileLength); // writing file length
    dataout.flush();
    System.out.println("Length Sent .... " + fileLength);
    dataout.flush();
    // Send file
    int loop = 0;
    loop = fis.read(data);
    System.out.println("......1......" + "in loop" + loop);
    if (loop > -1) {
    dataout.write(data);
    //closeConnection();
    // output.flush();
    catch (UnknownHostException e) {
    System.out.println("Unknown host:");
    System.exit(1);
    catch (IOException e) {
    System.out.println("No I/O " + e.getMessage());
    System.exit(1);
    catch (Exception e){
    e.printStackTrace();
    public static void main(String args[]) {
    FileClient serv = new FileClient();
    serv.SetSocket();
    ******************************************SERVER*********************
    import java.io.*;
    import java.net.*;
    import java.io.*;
    class ClientThread
    implements Runnable {
    FileOutputStream output;
    DataInputStream input;
    String uname;
    String filename;
    Socket client;
    public ClientThread(Socket clientth) {
    this.client=clientth;
    public void checkdir(String dirname){
    File f =new File("..//Accounts//"+uname+"//");
    if (!f.exists()){
    f.mkdirs();
    public void run() {
    try {
    while (true) {
    input = new DataInputStream(client.getInputStream());
    uname = "";
    filename = "";
    uname = input.readUTF();
    checkdir(uname);
    filename = input.readUTF();
    if (!filename.equals("no")) {
    System.out.println("Filename Recieved of file: " + filename);
    File f = new File("..//Accounts//" + uname + "//" + filename);
    if (!f.exists()) {
    RandomAccessFile raf = new RandomAccessFile(f, "rw");
    raf.setLength(0);
    int length;
    int pack = 0;
    int fileLength = 0;
    System.out.println("User Name received...." + uname);
    System.out.println("...2a....");
    fileLength = input.readInt();
    System.out.println("...2b....");
    System.out.println("Length Receieved .... " + fileLength);
    // input.readInt();
    // input.readInt();
    byte data[] = new byte[fileLength];
    System.out.println("Length Receieved .... " + fileLength);
    input.read(data);
    raf.write(data);
    raf.close();
    System.out.println("File Receieved and Wrote at Server");
    // clientoutput.flush();
    else {
    System.err.println("File Already Exists request by " + uname);
    } //if check ends
    catch (IOException e) {
    System.out.println("in or out failed"+ e.getMessage());
    System.exit( -1); }
    public class FileServer {
    Socket client;
    ServerSocket server;
    public FileServer(){
    File f=new File("..//Accounts") ;
    if(!f.exists())
    f.mkdirs();
    public void listenSocket() {
    try {
    server = new ServerSocket(9898);
    catch (IOException e) {
    System.out.println("Could not listen on port 9898 Server Already Listening");
    System.exit( -1);
    while (true) {
    ClientThread cth;
    try {
    cth = new ClientThread(server.accept());
    Thread thr = new Thread(cth);
    thr.start();
    catch (Exception mye) {
    mye.printStackTrace();
    protected void finalize() {
    try {
    server.close();
    catch (IOException e) {
    System.out.println("Could not close socket");
    System.exit( -1);
    public static void main(String args[]) {
    FileServer serv = new FileServer();
    serv.listenSocket();

    Well Thanks a lot : jschell so nice of u helping me all through this well i sort out this problem as well...
    i wasnt sending all files at once ...........one by one the problem was the biggest file is 240 k and byte arraay couldnt accomdate it ................so now i am sending files in 4k packets any of u guys need help u can see this code how to send files in packets .................
    //**********************SERVER************************************
    package servermanager;
    import java.io.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class ClientThread
        implements Runnable {
      FileOutputStream output;
      DataInputStream input;
    DataOutputStream dataout;
      String uname;
      String filename;
      Socket client;
      JTextArea log;
      public ClientThread(Socket clientth,JTextArea mylog) {
        this.client=clientth;
        this.log=mylog;
      public void checkdir(String dirname){
      File f =new File("..//Accounts//"+uname+"//");
      if (!f.exists()){
        f.mkdirs();
      public synchronized  void  startTransfer(){
          try {
              FileOutputStream fos=null;
              input = new DataInputStream(client.getInputStream());
              uname = "";
              filename = "";
              uname = input.readUTF();
              checkdir(uname);
              filename = input.readUTF();
              File f = new File("..//Accounts//" + uname + "//" + filename);
              RandomAccessFile raf = new RandomAccessFile(f, "rw");
              raf.setLength(0);
              raf.close();
              long fileLength=0;
              byte lenbuf[]=null;
              int help =input.read();
              lenbuf = new byte[help];
              input.read(lenbuf);
              String lenz = new String(lenbuf);
              fileLength = new Integer(lenz).longValue();
              fos = new FileOutputStream (f);
              byte data[]=new byte[4096];
              int length;
              while( (length=input.read(data, 0, 4096)) > 0) {
               fos.write(data, 0, length);
              fos.close();
      log.append("\n File Recieved = ["+filename+"]:---:"+"of Size["+fileLength+"]:---:"+"By ["+uname+"]." );
        catch (IOException e) {
          log.append("\n In or Out failed"+e.getMessage());
          System.exit( -1);}
      public void run() {
        startTransfer();
    public class FileServer extends JFrame {
      int port;
      Socket client;
      ServerSocket server;
      JScrollPane textscrollpane = new JScrollPane();
      JTextArea log = new JTextArea();
      JButton clear_btn = new JButton();
      JButton stop_btn = new JButton();
      public FileServer(){
        port=9898;
        File f=new File("..//Accounts")  ;
        if(!f.exists())
         f.mkdirs();
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public void listenSocket() {
        try {
          server = new ServerSocket(port);
        catch (IOException e) {
         log.append("\n Could not listen on port["+port+"]");
         System.exit( -1);
        while (true) {
          ClientThread cth;
          try {
            cth = new ClientThread(server.accept(),log);
            Thread thr = new Thread(cth);
            thr.start();
          catch (Exception  mye) {
         log.append("\n Thread Exception["+mye.getMessage()+"]");
      protected void finalize() {
        try {
          server.close();
        catch (IOException e) {
              log.append("\n Could not Close Socket on port["+port+"]");
          System.exit( -1);
      public static void main(String args[]) {
        FileServer serv = new FileServer();
        serv.setBounds(new Rectangle(150,150,500,300));
        serv.show();
        serv.listenSocket();
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(null);
        textscrollpane.setBounds(new Rectangle(1, 21, 489, 212));
        log.setBackground(Color.black);
        log.setForeground(Color.green);
        log.setToolTipText("Server Log");
        log.setEditable(false);
        log.setLineWrap(true);
        clear_btn.setText("Clear");
        clear_btn.addActionListener(new FileServer_clear_btn_actionAdapter(this));
        clear_btn.setBounds(new Rectangle(323, 245, 86, 13));
        clear_btn.setToolTipText("");
        stop_btn.setToolTipText("");
        stop_btn.setBounds(new Rectangle(55, 246, 86, 13));
        stop_btn.setText("Stop");
        stop_btn.addActionListener(new FileServer_stop_btn_actionAdapter(this));
        this.addWindowListener(new FileServer_this_windowAdapter(this));
        this.getContentPane().add(textscrollpane, null);
        this.getContentPane().add(stop_btn, null);
        this.getContentPane().add(clear_btn, null);
        textscrollpane.getViewport().add(log, null);
        log.setText("Server Initiated Listening on Port [9898]...");
      void stop_btn_actionPerformed(ActionEvent e) {
        System.exit(0);
      void this_windowClosed(WindowEvent e) {
        System.exit(0);
      void this_windowClosing(WindowEvent e) {
    System.exit(0);
      void clear_btn_actionPerformed(ActionEvent e) {
      log.setText("");
    class FileServer_stop_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_stop_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.stop_btn_actionPerformed(e);
    class FileServer_this_windowAdapter extends java.awt.event.WindowAdapter {
      FileServer adaptee;
      FileServer_this_windowAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void windowClosing(WindowEvent e) {
        adaptee.this_windowClosing(e);
    class FileServer_clear_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_clear_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.clear_btn_actionPerformed(e);
    //**********************CLIENT************************************
    package servermanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    public class FileClient {
      Socket socket;
      DataOutputStream dataout;
      public   void SetSocket(String dir,String filename) {
        try {
          socket = new Socket("localhost", 9898);
          dataout = new DataOutputStream(socket.getOutputStream());
            //sending Username & DIR name
            dataout.writeUTF(dir);
            //Sending Filename
            dataout.writeUTF(filename);
            dataout.flush();
            File f = new File("Accounts//"+dir+"//"+filename);
            byte data[]=new byte[4096];  //40k
            long filelength=f.length();
            String lenbuf = String.valueOf(filelength);
             byte lenz[] = lenbuf.getBytes(); //file length in bytes
               int lenzLen = lenz.length;
            FileInputStream fis = new FileInputStream(f);
            dataout.write(lenzLen);  //sending length in integer
            dataout.flush();
            System.out.println(lenzLen+"--------First Thing Sent length of byte array");
            dataout.write(lenz);      //sendinf byte  Array length
            dataout.flush();
              System.out.println(lenz+"--------Second Thing Sent bytes");
            int loop=0;
              while(loop!=-1){
                loop=fis.read(data);
                dataout.write(data);
                dataout.flush();
              socket.close();
        catch (UnknownHostException e) {
          System.out.println("Unknown host:");
          System.exit(1);
        catch (IOException e) {
          System.out.println("No I/O   " + e.getMessage());
          System.exit(1);
        catch (Exception e){
          e.printStackTrace();
      public static void main(String args[])  {
        FileClient serv = new FileClient();
        FileBean file=new FileBean();
        String wavfiles []=null;
        String dirs []=  file.getDirsForSocket("Accounts//");
        for(int i=0;i<dirs.length;i++){
        wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
         //if (wavfiles.length==0)
              for (int j=0;j<wavfiles.length;j++){
                  serv.SetSocket(dirs,wavfiles[j]);

  • File upload with jakarta common upload package

    i got the code f file upload from the forum but it is not working and giving some errors . I am attaching the code iam using and the stack trace of the errors i am getting . Please if somebody can help me ............
    <html>
    <form method="post" action="/servlet/UploadFile" enctype="multipart/form-data">
    Name
    <input type="text" name="uname"/>
    File
    <input type="file" name="upfile"/>
    <input type="submit"/>
    </form>
    </html>
    and the servlet handling the request is as import java.io.File;
    import java.io.IOException;
    import java.util.Iterator;
    import java.util.List;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.commons.fileupload.DiskFileUpload;
    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.FileItemFactory;
    import org.apache.commons.fileupload.FileUpload;
    import org.apache.commons.fileupload.FileUploadException;
    * @author sm23772
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class UploadFile extends HttpServlet {
    public void doPost(HttpServletRequest req,HttpServletResponse res)
    public class UploadFile extends HttpServlet {
    public void doPost(HttpServletRequest req,HttpServletResponse res)
    try{
    FileUpload fup=new FileUpload();
    boolean isMultipart = FileUpload.isMultipartContent(req);
    // Create a new file upload handler
    System.out.println(isMultipart);
    DiskFileUpload upload = new DiskFileUpload();
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(req);
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();
    if (item.isFormField()) {
    System.out.println("its a field");
    } else {
    System.out.println("its a file");
    System.out.println(item.getName());
    File cfile=new File(item.getName());
    File tosave=new File(getServletContext().getRealPath("/"),cfile.getName());
    }catch(Exception e){System.out.println(e);}
    the exception arising are
    as ..........
    exception
    javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/UploadFile
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:389)
         org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUpload
         java.lang.Class.getDeclaredConstructors0(Native Method)
         java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
         java.lang.Class.getConstructor0(Class.java:2640)
         java.lang.Class.newInstance0(Class.java:321)
         java.lang.Class.newInstance(Class.java:303)
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:370)
         org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUpload
    this is your error
    you need to have commons-fileupload-1.2.jar in your classpath
    you can download it from http://jakarta.apache.org/site/downloads/downloads_commons-fileupload.cgi

  • Problem setting file extension with jspc

    I'm using xhtml which it appears the Jasper compiler (Tomcat 5.5) can't handle. It seems to only recognize files with the jsp and jspx extensions. Is there a way (either on the command line or via the Ant task) to set this? What is the proper way of pre-compiling these pages?
    Thanks in advance.
    Scott Czadzeck

    Hi,
    You can restrict them to save in any other format by making the check.
    Simply add listner for the Event.OPEN on the fileReference and inside this check for your allowed extension,if the extension is not what you want then
    simply right a line there like:-
    fileReference.cancel();
    And addtionally you can give any alert that your file should be of that particular extension.
    with Regards,
    Shardul

  • Mod_wl.so "Thread Local Storage" load error with Apache and WL 7

    I'm using Apache 1.3 and WL 7.0, and after configuring Apache to load mod_wl.so,
    I get the following error when starting up. I'm using the mod_wl.so that is
    for hpux11.
    Thanks for any help.
    $ ./apachectl start
    /usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libcl.2
    /usr/lib/dld.sl: Exec format error
    Syntax error on line 1053 of /opt/apache/etc/httpd.conf:
    Cannot load /opt/apache/lib/modules/mod_wl.so into server: Exec format error
    ./apachectl start: httpd could not be started

    Sunny,
    When you build apache on hpux, you should do the following before the
    configure:
    export CFLAGS="-lstd -lstream -lCsup -lm -lcl -ldld"
    Regards,
    Eric
    "Sunny Yee" <[email protected]> wrote in message
    news:[email protected]..
    >
    I'm using Apache 1.3 and WL 7.0, and after configuring Apache to loadmod_wl.so,
    I get the following error when starting up. I'm using the mod_wl.so thatis
    for hpux11.
    Thanks for any help.
    $ ./apachectl start
    /usr/lib/dld.sl: Can't shl_load() a library containing Thread LocalStorage: /usr/lib/libcl.2
    /usr/lib/dld.sl: Exec format error
    Syntax error on line 1053 of /opt/apache/etc/httpd.conf:
    Cannot load /opt/apache/lib/modules/mod_wl.so into server: Exec formaterror
    /apachectl start: httpd could not be started

  • Thread Problem during Multiple Canvas....

    Hi,
    I have designed two games for a suite while integrating these into a single MIDlet, the flow of the canvas are good but when i go to the secomd game the thread is not executing which cause paint also not executing.. so i don find any interaction with key events.Please help in this.
    1. From the main MIDlet i set the DISPLAY.SETCURRNT to the first canvas.
    2. From the First canvas i set the DISPLAY.SETCURRNT of the second canvas using the main MIDlet.
    3. The setCurrent method is working and as i started the Thread from here.
    4.But Run is executing only one which cause Paint also only once.
    Please Help me regarding...

    Dear Bhanu,
    Firstly FRC1 is quantity based condition now you want the quantity check in MIRO (FRB1 is absolute value based , FRA1 is Percentage based)
    Lets take 1 example
    PO quantity 100 Kg price 100 Rs/Kg. with 3 FRC1 conditions values are 5 Rs/kg ,6 Rs/kg,7Rs/kg (3 separate vendor A,B,C)
    so total PO with freight =100100 +51006*1007*100
                                          =10000 +  1800
                                          =11800 Rs
    Now say you have received 10 Kg of material
    And for freight vendor A you are performing MIRO ->Enter PO ->Select planned delivery cost-> Pop up will appear
    Select vendor A.
    Now it will propose 50 Rs and 10 KG
    If you enter qty as 11 kg it will show you warning ( that Qty exceed from GR) but
    TO achieve this you need to set tolerance key DQ (Qty check) for your company ->select check limit in OMR6
    and if want price check too set tolerance key KW this will check the amount of FRC1
    You can also make this warning as error in OMRM message no M8 081 as error
    Edited by: redriver on Dec 12, 2011 6:55 AM

  • How to display the device name during file sending with Bluetooth

    I get this Message:
    File Receive Conformation
    Do you want to receive a file from 00:13:70:69:95:84?
    My Question is how can it display the device name not the device address?
    Message was edited by: hazzaa

    The same situation when I want to send photo from mobile phone to my notebook. I didnt find any option how to change it.
    When I send photo from notebook to the mobile phone the notebook name (device name) is displayed. Try to check external device properties. Maybe you will find there way to change it.

  • Problems opening files & folders with Intuos3 Pen in Mini-Bridge

    I just started working with an Intuos3, using it in many places to get the feel of it, clicking, double-clicking, etc.  Works nicely!  However, in Photoshop CS5 and Mini-Bridge, it's almost impossible to use the pen to open folders and open images.  I will use the side buttons to click, or tap the tablet to click.  I'm not sure if I'm tapping too fast, not fast enough, or what.  The most consistent way to do it is right-click with the side switch and select open. 
    But why can't I "click" on a folder to open it, or an image to open it in Photoshop?  Any thoughts would be welcome!

    I have an Intuos4, and although I rarely use it it does open folders and puts pic in the viewer.
    Go to your Wacom setup and make sure you have the pen set up correctly.  There are lots of options for buttons, tip and so forth.

  • Problems previewing file and with flash action

    I am using Acrobat.com for my children's book in order to send it out to agents and it has been working well since October. I have checked it several times and there were no issues but today it will not preview either file any longer and the flash page turner is no longer working. I upoaded a new version of the same file and it is working but the link I sent out to agents will only allow a download now. Just wondering what may have caused this. I read where someone else had a similar issue but there was no result posted. The page turning issue, though not really an important feature, is just something I really liked about the program. Thank you.

    Hello,
    This should have been a temporary issue - the preview function should be working normally for the new file now. Please lmk if this is not the case.
    Michelle

Maybe you are looking for