Writing on a server..

I have now this problem: i want to write - change - a file on a server. The problem is he means, that he doesn't find this file i want to change.. the filename is correct and it exists ;) .. but I think the programm "doesn't think" of looking at the destenition I gave him ;( .. Please help me

hmm.. good question ;)
i want to write on a normal webserver ( Fc-System).
There a file still exists and i want to change something there... My Computer has every day a different IP and so I have programmed something, which detects my IP and want to send it to a file, which is called by a HTML Site ;) .. but my programm doesn't find the file I wanna chance..
thx!

Similar Messages

  • Data Writing to Application server

    Hi,
    I am Uploading 108 fields of data to application server file
    Below ZFI_PAYMENT is the table which contains 108 fields of data
    Please check my code
    TYPES: ty_file TYPE zfi_payment.
    DATA: wa_file TYPE ty_file.
    DATA: it_file TYPE STANDARD TABLE OF ty_file.
    FIELD-SYMBOLS: <f1> TYPE ANY,
                   <f2> TYPE ANY.
    TYPES: BEGIN OF ty_data,
             data type string,
           END OF ty_data.
    DATA: wa_data TYPE ty_data,
                it_data TYPE STANDARD TABLE OF ty_data.
    DATA:  v_pay_amount(23).
    DATA: as_file TYPE file VALUE '/usr/sap/RD2/DVEBMGS20/work/fi_test2'.
    select * from zfi_payment into table it_file.
    open dataset as_file for output in text mode encoding default.
    LOOP AT it_file INTO wa_file.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE wa_file TO <f1>.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        IF sy-index = 5.
          MOVE wa_file-pay_amount TO v_pay_amount.
          CONCATENATE wa_data-data v_pay_amount '@' INTO wa_data-data.
        ELSE.
          CONCATENATE wa_data-data  <f1> '@' INTO wa_data-data.
        ENDIF.
      ENDDO.
      move wa_data-data to wa_data1.
      TRANSFER WA_DATA-DATA TO AS_FILE.
      APPEND wa_data TO it_data.
      CLEAR: WA_DATA,V_PAY_AMOUNT,WA_FILE,wa_data1.
    ENDLOOP.
    close dataset as_file.
    Here i am getting all 108 fileds of data into IT_DATA. (in debugging i seen that)
    But the only 68 fields of data is writing to the appl server.
    there is no problem in ztable and internal tables. data is coming properly to wa_data and it_data also.
    Please Give me reply
    Regards
    sri

    Hi,
    I guess, Now you are viewing only the first 68 fields on the application server. If yes, that is because of the restriction on the size and length can be viewed on application server.
    Try downloading directly from here.
    I guess, again using the OPEN DATASET and reading the file, it will retrieve all the data completely, i.e. only for viewing purpose, you can view the complete data.
    Regards,
    Nangunoori.

  • Do I have to use certificates when writing an HTTPS server

    I'm writing a client app and a server app. The client will connect to the server via HTTPS. A browser will never connect to this HTTPS server, just the client I have written. Can I skip the step of using certificates? I've been told it isn't a requirement. I just want SSL communication, that is all.
    When I try to do this, I get a handshake error, "no cipher suites in common'' coming from the client. The client seems okay because I can get it to connect to other secure web sites.
    So, certificates...must use in this case, or no?
    Thanks!!!

    Hi,
    I think you must use certificates if you want to do SSL communication.
    When using Netscape Navigator or IE to access files on a server that only has DSA-based certificates, a runtime exception occurs indicating that there are
    no cipher suites in common .
    By default, certificates created with keytool use DSA public keys. Navigator and IE do not use DSA public keys in their enabled cipher suites.
    To interact with IE or Navigator, you should create certificates that use RSA-based keys. To do this, you need to specify the -keyalg RSA option when using keytool. For Example:
    keytool -genkey -alias duke -ketstore testkeys -keyalg rsa
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

  • ORA-29283 when writing file to server

    I am trying to setup procedure that writes the result of a query to a file on the database server. I am currently testing the writing of file using some generic code.
    The database is on Red Hat Linux. The directory was created on the server as the mfts_user account and the oracle user granted read/write access. This was verified by logging into the server as oracle and creating a file via "touch test.txt".
    The following 2 procedures/functions were created to test utl_file:
    create or replace FUNCTION dump_csv ( p_query IN VARCHAR2
    , p_separator IN VARCHAR2 DEFAULT ','
    , p_dir IN VARCHAR2
    , p_filename IN VARCHAR2)
    RETURN NUMBER
    AS
    l_output utl_file.file_type;
    l_thecursor INTEGER DEFAULT dbms_sql.open_cursor;
    l_columnvalue VARCHAR2(2000);
    l_status INTEGER;
    l_colcnt NUMBER DEFAULT 0;
    l_separator VARCHAR2(10) DEFAULT '';
    l_cnt NUMBER DEFAULT 0;
    BEGIN
    l_output := utl_file.fopen(p_dir, p_filename, 'w');
    dbms_sql.parse(l_thecursor, p_query, dbms_sql.native);
    FOR i IN 1 .. 255
    LOOP
    BEGIN
    dbms_sql.define_column(l_thecursor, i, l_columnvalue, 2000);
    l_colcnt := i;
    EXCEPTION
    WHEN others
    THEN
    IF(SQLCODE = -1007) THEN
    EXIT;
    ELSE
    RAISE;
    END IF;
    END;
    END LOOP;
    dbms_sql.define_column(l_thecursor, 1, l_columnvalue, 2000);
    l_status := dbms_sql.EXECUTE(l_thecursor);
    LOOP
    EXIT WHEN(dbms_sql.fetch_rows(l_thecursor) <= 0);
    l_separator := '';
    FOR i IN 1 .. l_colcnt
    LOOP
    dbms_sql.column_value(l_thecursor, i, l_columnvalue);
    utl_file.put(l_output, l_separator || l_columnvalue);
    l_separator := p_separator;
    END LOOP;
    utl_file.new_line(l_output);
    l_cnt := l_cnt + 1;
    END LOOP;
    dbms_sql.close_cursor(l_thecursor);
    utl_file.fclose(l_output);
    RETURN l_cnt;
    END dump_csv;
    create or replace PROCEDURE TEST_DUMP_CSV
    AS
    l_count NUMBER;
    l_fn VARCHAR2(30);
    BEGIN
    SELECT TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS') INTO l_fn FROM DUAL;
    l_count := dump_csv( p_query => 'select * from coreq',
    p_separator => ',',
    p_dir => 'OUTBOUND_NEW_DIR',
    p_filename => 'dump_csv' || l_fn || '.csv' );
    dbms_output.put_line( to_char(l_count) || ' rows extracted to file dump_csv' || l_fn || '.csv.' );
    END TEST_DUMP_CSV;
    To test utl_file, I execute as the MAXIMO user:
    CREATE OR REPLACE DIRECTORY outbound_new_dir AS '/home/mfts_user/Maximo/outbound_new';
    select dump_csv('select * from coreq', ',', 'OUTBOUND_NEW_DIR', 'dump_csv.csv' ) from dual;
    Here is the error I get:
    ORA-29283: invalid file operation
    ORA-06515: at "SYS.UTL_FILE", line 449
    ORA-29283: invalid file operation
    ORA-06512: at "MAXIMO.DUMP_CSV", line 15
    ORA-06512: at line 1
    This same setup works on Windows XP when logged in as an Admin user, which tells me that the syntax and logic is correct.
    What could be wrong with the Linux setup?

    Yes. I read that read/write is automatically granted to the user that creates the DIRECTORY object.
    The result of the query you gave was 2 records:
    GRANTOR GRANTEE TABLE_SCHEMA TABLE_NAME PRIVILEGE GRANTABLE HIERARCHY
    SYS     MAXIMO     SYS     OUTBOUND_NEW_DIR     READ     YES     NO
    SYS     MAXIMO     SYS     OUTBOUND_NEW_DIR     WRITE     YES     NO

  • PDF issue while writing to application server

    Hi Guys,
    I am writing my PDF file into application server but there is an additional line coming up in the file after EOF as below. This additional line creates a new blank page when they take printout from web service.
    %%EOF#
    ef0 R0000 nRA                                            )Tj##########################################
    Steps I am using are :
            1. Convert smartform into PDF with CONVERT_OTF_2_PDF
            2. Write returned PDF lines into application server with below code.
                   OPEN DATASET  lv_filename FOR OUTPUT IN BINARY MODE .
                   LOOP AT lt_lines INTO ls_tline.
                       TRANSFER ls_tline TO lv_filename .
                   ENDLOOP.
    I have checked smartform but no windows are overlapping or out of margin. I tried some cleaning code from GUI_UPLOAD also but still same additional lines are coming. I tried CONVERT_OTF also. Pls advice..
    Thanks..
    SD

    Hi John,
    Try the following code which will lead you to the solution
    REPORT ZTEST_SMARTFORM_2_PDF.
    DATA: it_otf TYPE STANDARD TABLE OF itcoo,
    it_docs TYPE STANDARD TABLE OF docs,
    it_lines TYPE STANDARD TABLE OF tline,
    st_job_output_info TYPE ssfcrescl,
    st_document_output_info TYPE ssfcrespd,
    st_job_output_options TYPE ssfcresop,
    st_output_options TYPE ssfcompop,
    st_control_parameters TYPE ssfctrlop,
    v_len_in TYPE so_obj_len,
    v_language TYPE sflangu VALUE 'E',
    v_e_devtype TYPE rspoptype,
    v_bin_filesize TYPE i,
    v_name TYPE string,
    v_path TYPE string,
    v_fullpath TYPE string,
    v_filter TYPE string,
    v_uact TYPE i,
    v_guiobj TYPE REF TO cl_gui_frontend_services,
    v_filename TYPE string,
    v_fm_name TYPE rs38l_fnam.
    CONSTANTS c_formname TYPE tdsfname VALUE 'ZTEST'.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = v_language
    i_application = 'SAPDEFAULT'
    IMPORTING
    e_devtype = v_e_devtype.
    st_output_options-tdprinter = v_e_devtype.
    *st_output_options-tdprinter = 'locl'.
    st_control_parameters-no_dialog = 'X'.
    st_control_parameters-getotf = 'X'.
    .................GET SMARTFORM FUNCTION MODULE NAME.................
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = c_formname
    IMPORTING
    fm_name = v_fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ...........................CALL SMARTFORM............................
    CALL FUNCTION v_fm_name
    EXPORTING
    control_parameters = st_control_parameters
    output_options = st_output_options
    IMPORTING
    document_output_info = st_document_output_info
    job_output_info = st_job_output_info
    job_output_options = st_job_output_options
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    .........................CONVERT TO OTF TO PDF.......................
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
    bin_filesize = v_bin_filesize
    TABLES
    otf = st_job_output_info-otfdata
    doctab_archive = it_docs
    lines = it_lines
    EXCEPTIONS
    err_conv_not_possible = 1
    err_otf_mc_noendmarker = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ........................GET THE FILE NAME TO STORE....................
    CONCATENATE 'smrt' '.pdf' INTO v_name.
    CREATE OBJECT v_guiobj.
    CALL METHOD v_guiobj->file_save_dialog
    EXPORTING
    default_extension = 'pdf'
    default_file_name = v_name
    file_filter = v_filter
    CHANGING
    filename = v_name
    path = v_path
    fullpath = v_fullpath
    user_action = v_uact.
    IF v_uact = v_guiobj->action_cancel.
    EXIT.
    ENDIF.
    ..................................DOWNLOAD AS FILE....................
    MOVE v_fullpath TO v_filename.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = v_bin_filesize
    filename = v_filename
    filetype = 'BIN'
    TABLES
    data_tab = it_lines
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.

  • Writing An Email Server

    Can anyone help at all? I'm doing a project in java and I have to write my own POP3 and SMTP Server and I can't find the code anywhere. I've found plenty of sites with code for writing email clients that communicate with existing servers but nothing on how to write my own email server. Thanks

    The specs for SMTP servers are in RFC 821. You can find that here:
    http://www.faqs.org/rfcs/rfc821.html
    I don't know the RFC number for POP3 but you could probably find it by searching that site.

  • Tectra A10 - writing to file server ends with BSOD

    Hi
    I have a brand new Tectra A10 that I have used the recovery disk to restore the machine to XP Pro - I have done this process many times before.
    I have addred the machine to our Domain but whenever I try to write to our file server (Windows Server 2008) I get the blue screen.
    Writing to an old 32 bit Server is fine.
    I have made sure that the NIC Card driver is upto date.
    Any Ideas
    Thanks
    Lew

    Hi buddy,
    I personally believe, that everything is ok with your notebook and its related to server or network this BSOD.
    I mean you can write to a 32bit server properly and I believe other network connections work fine so its a problem of the new server.
    As Barrie wrote, if you use the notebook in your company ask the local network administrator. Maybe its a known issue.

  • Question about writing a web server

    I was asked to write a simple Web server that responds to HTTP requests received on port 808
    It has the following features:
    1.a request for an HTML document or image file should generate a response with the appropriate MIME type
    2.a request for a directory name with a trailing / should return the contents of the index.html file in that directory (if it exists) or else a suitably formatted HTML listing of the directory contents, including information about each file
    3.a request for a directory name without a trailing / should generate an appropriate Redirect response
    4.a request for a non-existent file or directory should generate an appropriate error response
    5/the Web server should be multi-threaded so that it can cope with multiple
    how to do it?
    may anyone help me please?

    As a startert for ten, try this that I had lying around form a previous
    forum response.
    java -cp <whatever> Httpd 808
    and connect to http://localhost:808 to get an eye-full.
    If you should use this for anything approacing a commercial
    purpose, I will, of course, expect sizable sums of money to be
    deposited in my Swiss bank account on a regular basis.
    Darn it! I'm serious!
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Httpd
         implements Runnable
         private static String HTTP_400=
              "<HTML><BODY><H2>400 Bad Request</H2></BODY></HTML>";
         private static String HTTP_403=
              "<HTML><BODY><H2>403 Forbidden</H2></BODY></HEAD>";
         private static String HTTP_404=
              "HTML><BODY><H2>404 Not Found</H2></BODY></HTML>";
         public static void main(String[] argv)
              throws Exception
              new Thread(new Httpd(Integer.parseInt(argv[0]))).start();
         private int mPort;
         public Httpd(int port) { mPort= port; }
         public void run()
              try {
                   ServerSocket listenSocket= new ServerSocket(mPort);
                   System.err.println("HTTPD listening on port " +mPort);
                   System.setSecurityManager(new SecurityManager() {
                        public void checkConnect(String host, int p) {};
                        public void checkCreateClassLoader() {};
                        public void checkAccess(Thread g) {};
                        public void checkListen(int p) {};
                        public void checkLink(String lib) {};
                        public void checkPropertyAccess(String key) {};
                        public void checkAccept(String host, int p) {};
                        public void checkAccess(ThreadGroup g) {};
                        public void checkRead(FileDescriptor fd) {};
                        public void checkWrite(String f) {};
                        public void checkWrite(FileDescriptor fd) {};
                        // Make sure the client is not attempting to get behind
                        // the root directory of the server
                        public void checkRead(String filename) {
                             if ((filename.indexOf("..") != -1) || (filename.startsWith("/")))
                                  throw new SecurityException("Back off, dude!");
                   while (true) {
                        final Socket client= listenSocket.accept();
                        new Thread(new Runnable() {
                             public void run() {
                                  try {
                                       handleClientConnect(client);
                                  catch (Exception e) {
                                       e.printStackTrace();
                        }).start();
              catch (Exception e) {
                   e.printStackTrace();
         private void handleClientConnect(Socket client)
              throws Exception
              BufferedReader is= new BufferedReader(
                   new InputStreamReader(client.getInputStream()));
              DataOutputStream os= new DataOutputStream(client.getOutputStream());
              // get a request and parse it.
              String request= is.readLine();
              StringTokenizer st= new StringTokenizer(request);
              if (st.countTokens() >= 2) {
                   String szCmd= st.nextToken();
                   String szPath= st.nextToken();
                   if (szCmd.equals("GET")) {
                        try {
                             handleHttpGet(os, szPath);
                        catch (SecurityException se) {
                             os.writeBytes(HTTP_403);
                   else
                        os.writeBytes(HTTP_400);
              else
                   os.writeBytes(HTTP_400);
              os.close();
         private void handleHttpGet(DataOutputStream os, String request)
              throws Exception
              if (request.startsWith("/"))
                   request= request.substring(1);
              String path= request;
              File f;
              if (request.endsWith("/") || request.equals("")) {
                   path= request +"index.html";
                   f= new File(path);
                   if (!f.exists()) {
                        if (request.endsWith("/"))
                             path= request.substring(0, request.length()-1);
                        else if (request.equals(""))
                             path= ".";
                        f= new File(path);
              else
                   f= new File(path);
              if (!f.exists())
                   os.writeBytes(HTTP_404);
              else if (f.isFile())
                   getFile(os, f);
              else if (f.isDirectory())
                   getDirectory(os, f);
         private void getDirectory(DataOutputStream os, File f)
              throws Exception
              getDirectory(os, f, "");
         private void getDirectory(DataOutputStream os, File f, String prefix)
              throws Exception
              StringBuffer szBuf= new StringBuffer();
              String szTitle= "Index of /";
              if (!f.getPath().equals("."))
                   szTitle= "Index of " +f.getPath().substring(prefix.length());
              szBuf.append("<HTML><HEAD><TITLE>");
              szBuf.append(szTitle);
              szBuf.append("</TITLE></HEAD><BODY><H1>");
              szBuf.append(szTitle);
              szBuf.append("</H1><BR><PRE>");
              szBuf.append(
                   "Name                              Last Modified              Size<HR>");
              String dir= "";
              if (!f.getPath().equals(".")) {
                   dir= f.getPath() +"/";
                   szBuf.append("<A HREF=\"..\">Parent Directory</A><BR>");
              java.text.SimpleDateFormat fmt=
                   new java.text.SimpleDateFormat("EEE MMM d yyyy hh:m:ss");
              String[] list= f.list();
              for (int i= 0; i< list.length; i++) {
                   String path= list;
                   File d= new File(dir + path);
                   if (d.isDirectory())
                        path += "/";
                   szBuf.append("<A HREF=\"");
                   szBuf.append(path);
                   szBuf.append("\">");
                   szBuf.append(path);
                   szBuf.append("</A>");
                   for (int j= path.length(); j< 34; j++)
                        szBuf.append(" ");
                   if (d.isDirectory())
                        szBuf.append("[DIR]");
                   else {
                        szBuf.append(fmt.format(new java.util.Date(f.lastModified())));
                        szBuf.append(" ");
                        szBuf.append(formatFileSize(d.length()));
                   szBuf.append("<BR>");
              szBuf.append("</PRE></BODY></HTML>");
              byte[] buf= szBuf.toString().getBytes();
              os.write(buf,0,buf.length);
         private String formatFileSize(long size)
              if (size < 1024)
                   return "" +size;
              if (size < (1024*1024))
                   return (new Float(size/1024).intValue()) +"K";
              if (size < (1024*1024*1024))
                   return (new Float(size/(1024*1024)).intValue()) +"M";
              if (size < (1024*1024*1024*1024))
                   return (new Float(size/(1024*1024*1024)).intValue()) +"G";
              return "Massive!";
         private void getFile(DataOutputStream os, File f)
              throws Exception
              DataInputStream in= new DataInputStream(new FileInputStream(f));
              int len= (int) f.length();
              byte[] buf= new byte[len];
              in.readFully(buf);
              os.write(buf,0,len);
              in.close();

  • Problem in writing to Mainframe Server through a Socket

    We have a Java client application running on MS windows writing/reading from a Mainframe application.
    What we observe is that, on some client machines even if we do not explicitly convert to EBCDIC the data gets sent in proper EBCDIC format, but on some machines the data that is sent is not in EBCDIC format. We have the same code on both the machines. Also one more thing that is coimplicating is that on the machine where explicit conversion to EBCDIC is needed now, used to work fine without this conversion about 3 months back. The token we write to socket is TSSK
    Is there some change in Java releases that has caused this more stringent checking now? Or are there any changes in Microsoft releases that is now more particular about the conversion?
    Your input is greatly appreciated. Agree that this might not be a socket issue, but was not clear where to post the problem.

    We use Socket as follows:
    byte[] b_tssk = new byte[4];
    _socket = new Socket(host, port);
    in =  new DataInputStream(socket.getInputStream());
    out = new DataOutputStream(socket.getOutputStream());
    out.write(btssk,0,4);
    _in.read(tranid, 0, 10);
    Before writing to the socket we convert the byte array to the required format.
    When you say protocol does it mean TCP/IP in this case? And how can we configure it and where?
    Can you please elaborate more on this?

  • Writing a conference server for RTP streams

    Hello,
    I'm trying to write a conference server which accepts multiple RTP streams (one for each participant), creates a mixed RTP stream of all other participants and sends that stream back to each participant.
    For 2 participants, I was able to correctly receive and send the stream of the other participant to each party.
    For 3 participants, creating the merging data source does not seem to work - i.e. no data is received by the participants.
    I tried creating a cloneable data sources instead, thinking that this may be the root cause, but when creating cloneable data sources from incoming RTP sources, I am unable to get the Processor into Configured state, it seems to deadlock. Here's the code outline :
        Iterator pIt = participants.iterator();
        List dataSources = new ArrayList();
        while(pIt.hasNext()) {
          Party p = (Party) pIt.next();
          if(p!=dest) {
            DataSource ds = p.getDataSource();
            DataSource cds = Manager.createCloneableDataSource(ds);
            DataSource clone= ((SourceCloneable)cds).createClone();
            dataSources.add(clone);
        Object[] sources = dataSources.toArray(new DataSource[0]);
        DataSource dataSource =   Manager.createMergingDataSource((DataSource[])sources);
        Processor p = Manager.createProcessor(dataSource);
        MixControllerListener cl = new MixControllerListener();
        p.addControllerListener(cl);
        // Put the Processor into configured state.
        p.configure();
        if (!cl.waitForState(p, p.Configured)) {
            System.err.println("Failed to configure the processor.");
            assert false;
        }Here are couple of stack traces :
    "RTPEventHandler" daemon prio=1 tid=0x081d6828 nid=0x3ea6 in Object.wait() [98246000..98247238]
            at java.lang.Object.wait(Native Method)
            - waiting on <0x9f37e4a8> (a java.lang.Object)
            at java.lang.Object.wait(Object.java:429)
            at demo.Mixer$MixControllerListener.waitForState(Mixer.java:248)
            - locked <0x9f37e4a8> (a java.lang.Object)
            at demo.Mixer.createMergedDataSource(Mixer.java:202)
            at demo.Mixer.createSendStreams(Mixer.java:165)
            at demo.Mixer.createSendStreamsWhenAllJoined(Mixer.java:157)
            - locked <0x9f481840> (a demo.Mixer)
            at demo.Mixer.update(Mixer.java:123)
            at com.sun.media.rtp.RTPEventHandler.processEvent(RTPEventHandler.java:62)
            at com.sun.media.rtp.RTPEventHandler.dispatchEvents(RTPEventHandler.java:96)
            at com.sun.media.rtp.RTPEventHandler.run(RTPEventHandler.java:115)
    "JMF thread: com.sun.media.ProcessEngine@a3c5b6[ com.sun.media.ProcessEngine@a3c5b6 ] ( configureThread)" daemon prio=1 tid=0x082fe3c8 nid=0x3ea6 in Object.wait() [977e0000..977e1238]
            at java.lang.Object.wait(Native Method)
            - waiting on <0x9f387560> (a java.lang.Object)
            at java.lang.Object.wait(Object.java:429)
            at com.sun.media.parser.RawBufferParser$FrameTrack.parse(RawBufferParser.java:247)
            - locked <0x9f387560> (a java.lang.Object)
            at com.sun.media.parser.RawBufferParser.getTracks(RawBufferParser.java:112)
            at com.sun.media.BasicSourceModule.doRealize(BasicSourceModule.java:180)
            at com.sun.media.PlaybackEngine.doConfigure1(PlaybackEngine.java:229)
            at com.sun.media.ProcessEngine.doConfigure(ProcessEngine.java:43)
            at com.sun.media.ConfigureWorkThread.process(BasicController.java:1370)
            at com.sun.media.StateTransitionWorkThread.run(BasicController.java:1339)
    "JMF thread" daemon prio=1 tid=0x080db410 nid=0x3ea6 in Object.wait() [97f41000..97f41238]
            at java.lang.Object.wait(Native Method)
            - waiting on <0x9f480578> (a com.ibm.media.protocol.CloneableSourceStreamAdapter$PushBufferStreamSlave)
            at java.lang.Object.wait(Object.java:429)
            at com.ibm.media.protocol.CloneableSourceStreamAdapter$PushBufferStreamSlave.run(CloneableSourceStreamAdapter.java:375)
            - locked <0x9f480578> (a com.ibm.media.protocol.CloneableSourceStreamAdapter$PushBufferStreamSlave)
            at java.lang.Thread.run(Thread.java:534)Any ideas ?
    Thanks,
    Jarek

    bgl,
    I was able to get past the cloning issue by following the Clone.java example to the letter :)
    Turns out that the cloneable data source must be added as a send stream first, and then the clonet data source. Now for each party in the call the conf. server does the following :
    Party(RTPManager mgr,DataSource ds) {
          this.mgr=mgr;
          this.ds=Manager.createCloneableDataSource(ds);
       synchronized DataSource cloneDataSource() {
          DataSource retVal;
          if(getNeedsCloning()) {
            retVal = ((SourceCloneable) ds).createClone();
          } else {
            retVal = ds;
            setNeedsCloning();
          return retVal;
        private void setNeedsCloning() {
          needsCloning=true;
        private boolean getNeedsCloning() {
          return needsCloning;
         private synchronized void addSendStreamFromNewParticipant(Party newOne) throws UnsupportedFormatException, IOException {
        debug("*** - New one joined. Creating the send streams. Curr count :" + participants.size());
        Iterator pIt = participants.iterator();
        while(pIt.hasNext()) {
          Party p = (Party)pIt.next();
          assert p!=newOne;
          // update existing participant
          SendStream sendStream = p.getMgr().createSendStream(newOne.cloneDataSource(),0);
          sendStream.start();
          // send data from existing participant to the new one
          sendStream = newOne.getMgr().createSendStream(p.cloneDataSource(),0);
          sendStream.start();
        debug("*** - Done creating the streams.");So I made some progress, but I'm still not quite there.
    The RTP manager JavaDoc for createSendStream states the following :
    * This method is used to create a sending stream within the RTP
    * session. For each time the call is made, a new sending stream
    * will be created. This stream will use the SDES items as entered
    * in the initialize() call for all its RTCP messages. Each stream
    * is sent out with a new SSRC (Synchronisation SouRCe
    * identifier), but from the same participant i.e. local
    * participant. <BR>
    For 3 participants, my conf. server creates 2 send streams to every one of them, so I'd expect 2 SSRCs on the wire. Examining the RTP packets in Ethereal, I only see 1 SSRC, as if the 2nd createSendStream call failed. Consequently, each participany in the conference is able to receive voice from only 1 other participant, even though I create RTPManager instance for each participany, and add 2 send streams.
    Any ideas ?
    Thanks,
    Jarek

  • Writing a web server.

    i am trying to write a tiny web server, with a gui, and want the gui to be a able to stop and start the server, the server is in a separate class called web server, and i need some code to destroy the instance of the class. thx in advance.

    web server code
    package tinywebserver;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class WebServer implements HttpConstants {
        /* static class data/methods */
        /* print to stdout */
        protected static void p(String s) {
            GUI.main.append(s + "\n");
            System.out.println(s);
        /* our server's configuration information is stored
         * in these properties
        protected static Properties props = new Properties();
        /* Where worker threads stand idle */
        static Vector threads = new Vector();
        /* the web server's virtual root */
        static File root;
        /* timeout on client connections */
        static int timeout = 0;
        /* max # worker threads */
        static int workers = 5;
        //port to serve from
        static int port = 8080;
        /* load www-server.properties from java.home */
        static void loadProps() throws IOException {
            File f = new File("server.properties");
            if (f.exists()) {
                InputStream is =new BufferedInputStream(new
                               FileInputStream(f));
                props.load(is);
                is.close();
                String r = props.getProperty("root");
                if (r != null) {
                    root = new File(r);
                    if (!root.exists()) {
                        throw new Error(root + " doesn't exist as server root");
                r = props.getProperty("timeout");
                if (r != null) {
                    timeout = Integer.parseInt(r);
                r = props.getProperty("workers");
                if (r != null) {
                    workers = Integer.parseInt(r);
                r = props.getProperty("serverPort");
                if (r != null) {
                    port = Integer.parseInt(r);
            /* if no properties were specified, choose defaults */
            if (root == null) {
                root = new File(System.getProperty("user.dir")+File.separator+"html");
            if (timeout <= 1000) {
                timeout = 5000;
            if (workers < 25) {
                workers = 5;
        static void printProps() {
            p("Tiny Web Server Starting on " + System.getProperty("os.name") +" "+System.getProperty("os.arch"));
            p("root="+root);
            p("timeout="+timeout);
            p("workers="+workers);
            p("port="+port);
        public static void start() throws Exception{
            loadProps();
            printProps();
            /* start worker threads */
            for (int i = 0; i < workers; ++i) {
                Worker w = new Worker();
                (new Thread(w, "worker #"+i)).start();
                 threads.addElement(w);
            ServerSocket ss = new ServerSocket(port);
            while (true) {
                Socket s = ss.accept();
                Worker w = null;
                synchronized (threads) {
                    if (threads.isEmpty()) {
                        Worker ws = new Worker();
                        ws.setSocket(s);
                        (new Thread(ws, "additional worker")).start();
                    }else {
                        w = (Worker) threads.elementAt(0);
                        threads.removeElementAt(0);
                        w.setSocket(s);
    class Worker extends WebServer implements HttpConstants, Runnable {
        final static int BUF_SIZE = 2048;
        static final byte[] EOL = {(byte)'\r', (byte)'\n' };
        /* buffer to use for requests */
        byte[] buf;
        /* Socket to client we're handling */
        private Socket s;
        Worker() {
            buf = new byte[BUF_SIZE];
            s = null;
        synchronized void setSocket(Socket s) {
            this.s = s;
            notify();
        public synchronized void run() {
            while(true) {
                if (s == null) {
                    /* nothing to do */
                    try {
                        wait();
                    } catch (InterruptedException e) {
                        /* should not happen */
                        continue;
                try {
                    handleClient();
                } catch (Exception e) {
                    e.printStackTrace();
                /* go back in wait queue if there's fewer
                 * than numHandler connections.
                s = null;
                Vector pool = WebServer.threads;
                synchronized (pool) {
                    if (pool.size() >= WebServer.workers) {
                        /* too many threads, exit this one */
                        return;
                    } else {
                        pool.addElement(this);
        void handleClient() throws IOException {
            InputStream is = new BufferedInputStream(s.getInputStream());
            PrintStream ps = new PrintStream(s.getOutputStream());
            /* we will only block in read for this many milliseconds
             * before we fail with java.io.InterruptedIOException,
             * at which point we will abandon the connection.
            s.setSoTimeout(WebServer.timeout);
            s.setTcpNoDelay(true);
            /* zero out the buffer from last time */
            for (int i = 0; i < BUF_SIZE; i++) {
                buf[i] = 0;
            try {
                /* We only support HTTP GET/HEAD, and don't
                 * support any fancy HTTP options,
                 * so we're only interested really in
                 * the first line.
                int nread = 0, r = 0;
    outerloop:
                while (nread < BUF_SIZE) {
                    r = is.read(buf, nread, BUF_SIZE - nread);
                    if (r == -1) {
                        /* EOF */
                        return;
                    int i = nread;
                    nread += r;
                    for (; i < nread; i++) {
                        if (buf[i] == (byte)'\n' || buf[i] == (byte)'\r') {
                            /* read one line */
                            break outerloop;
                /* are we doing a GET or just a HEAD */
                boolean doingGet;
                /* beginning of file name */
                int index;
                if (buf[0] == (byte)'G' &&
                    buf[1] == (byte)'E' &&
                    buf[2] == (byte)'T' &&
                    buf[3] == (byte)' ') {
                    doingGet = true;
                    index = 4;
                } else if (buf[0] == (byte)'H' &&
                           buf[1] == (byte)'E' &&
                           buf[2] == (byte)'A' &&
                           buf[3] == (byte)'D' &&
                           buf[4] == (byte)' ') {
                    doingGet = false;
                    index = 5;
                } else {
                    /* we don't support this method */
                    ps.print("HTTP/1.0 " + HTTP_BAD_METHOD +
                               " unsupported method type: ");
                    ps.write(buf, 0, 5);
                    ps.write(EOL);
                    ps.flush();
                    s.close();
                    return;
                int i = 0;
                /* find the file name, from:
                 * GET /foo/bar.html HTTP/1.0
                 * extract "/foo/bar.html"
                for (i = index; i < nread; i++) {
                    if (buf[i] == (byte)' ') {
                        break;
                String fname = (new String(buf, 0, index,
                          i-index)).replace('/', File.separatorChar);
                if (fname.startsWith(File.separator)) {
                    fname = fname.substring(1);
                File targ = new File(WebServer.root, fname);
                if (targ.isDirectory()) {
                    File ind = new File(targ, "index.html");
                    if (ind.exists()) {
                        targ = ind;
                boolean OK = printHeaders(targ, ps);
                if (doingGet) {
                    if (OK) {
                        sendFile(targ, ps);
                    } else {
                        send404(targ, ps);
            } finally {
                s.close();
        boolean printHeaders(File targ, PrintStream ps) throws IOException {
            boolean ret = false;
            int rCode = 0;
            if (!targ.exists()) {
                rCode = HTTP_NOT_FOUND;
                ps.print("HTTP/1.0 " + HTTP_NOT_FOUND + " not found");
                ps.write(EOL);
                ret = false;
            }  else {
                rCode = HTTP_OK;
                ps.print("HTTP/1.0 " + HTTP_OK+" OK");
                ps.write(EOL);
                ret = true;
            p("\nRequest from " +s.getInetAddress().getHostAddress()+": GET " + targ.getAbsolutePath()+"-->"+rCode);
            ps.print("Server: Simple java, Tiny Web Server");
            ps.write(EOL);
            ps.print("Date: " + (new Date()));
            ps.write(EOL);
            if (ret) {
                if (!targ.isDirectory()) {
                    ps.print("Content-length: "+targ.length());
                    ps.write(EOL);
                    ps.print("Last Modified: " + (new
                                  Date(targ.lastModified())));
                    ps.write(EOL);
                    String name = targ.getName();
                    int ind = name.lastIndexOf('.');
                    String ct = null;
                    if (ind > 0) {
                        ct = (String) map.get(name.substring(ind));
                    if (ct == null) {
                        ct = "unknown/unknown";
                    ps.print("Content-type: " + ct);
                    ps.write(EOL);
                } else {
                    ps.print("Content-type: text/html");
                    ps.write(EOL);
            return ret;
        void send404(File targ, PrintStream ps) throws IOException {
            ps.write(EOL);
            ps.write(EOL);
            ps.println("404 error, the requested object was not found\n\n"+
                       "The requested resource was not found.\n\n\nTiny Web Server has encountered an error.");
        void sendFile(File targ, PrintStream ps) throws IOException {
            InputStream is = null;
            ps.write(EOL);
            if (targ.isDirectory()) {
                listDirectory(targ, ps);
                return;
            } else {
                is = new FileInputStream(targ.getAbsolutePath());
            try {
                int n;
                while ((n = is.read(buf)) > 0) {
                    ps.write(buf, 0, n);
            } finally {
                is.close();
        /* mapping of file extensions to content-types */
        static java.util.Hashtable map = new java.util.Hashtable();
        static {
            fillMap();
        static void setSuffix(String k, String v) {
            map.put(k, v);
        static void fillMap() {
            setSuffix("", "content/unknown");
            setSuffix(".uu", "application/octet-stream");
            setSuffix(".exe", "application/octet-stream");
            setSuffix(".ps", "application/postscript");
            setSuffix(".zip", "application/zip");
            setSuffix(".sh", "application/x-shar");
            setSuffix(".tar", "application/x-tar");
            setSuffix(".snd", "audio/basic");
            setSuffix(".au", "audio/basic");
            setSuffix(".wav", "audio/x-wav");
            setSuffix(".gif", "image/gif");
            setSuffix(".jpg", "image/jpeg");
            setSuffix(".jpeg", "image/jpeg");
            setSuffix(".htm", "text/html");
            setSuffix(".html", "text/html");
            setSuffix(".text", "text/plain");
            setSuffix(".c", "text/plain");
            setSuffix(".cc", "text/plain");
            setSuffix(".c++", "text/plain");
            setSuffix(".h", "text/plain");
            setSuffix(".pl", "text/plain");
            setSuffix(".txt", "text/plain");
            setSuffix(".java", "text/plain");
        void listDirectory(File dir, PrintStream ps) throws IOException {
            ps.println("<TITLE>Directory listing</TITLE><P>\n");
            ps.println("<A HREF=\"..\">Parent Directory</A><BR>\n");
            String[] list = dir.list();
            for (int i = 0; list != null && i < list.length; i++) {
                File f = new File(dir, list);
    if (f.isDirectory()) {
    ps.println("<A HREF=\""+list[i]+"/\">"+list[i]+"/</A><BR>");
    } else {
    ps.println("<A HREF=\""+list[i]+"\">"+list[i]+"</A><BR");
    ps.println("<P><HR><BR><I>Tiny Web Server on "+ port + " at " + (new Date()) + "</I>");
    interface HttpConstants {
    /** 2XX: generally "OK" */
    public static final int HTTP_OK = 200;
    public static final int HTTP_CREATED = 201;
    public static final int HTTP_ACCEPTED = 202;
    public static final int HTTP_NOT_AUTHORITATIVE = 203;
    public static final int HTTP_NO_CONTENT = 204;
    public static final int HTTP_RESET = 205;
    public static final int HTTP_PARTIAL = 206;
    /** 3XX: relocation/redirect */
    public static final int HTTP_MULT_CHOICE = 300;
    public static final int HTTP_MOVED_PERM = 301;
    public static final int HTTP_MOVED_TEMP = 302;
    public static final int HTTP_SEE_OTHER = 303;
    public static final int HTTP_NOT_MODIFIED = 304;
    public static final int HTTP_USE_PROXY = 305;
    /** 4XX: client error */
    public static final int HTTP_BAD_REQUEST = 400;
    public static final int HTTP_UNAUTHORIZED = 401;
    public static final int HTTP_PAYMENT_REQUIRED = 402;
    public static final int HTTP_FORBIDDEN = 403;
    public static final int HTTP_NOT_FOUND = 404;
    public static final int HTTP_BAD_METHOD = 405;
    public static final int HTTP_NOT_ACCEPTABLE = 406;
    public static final int HTTP_PROXY_AUTH = 407;
    public static final int HTTP_CLIENT_TIMEOUT = 408;
    public static final int HTTP_CONFLICT = 409;
    public static final int HTTP_GONE = 410;
    public static final int HTTP_LENGTH_REQUIRED = 411;
    public static final int HTTP_PRECON_FAILED = 412;
    public static final int HTTP_ENTITY_TOO_LARGE = 413;
    public static final int HTTP_REQ_TOO_LONG = 414;
    public static final int HTTP_UNSUPPORTED_TYPE = 415;
    /** 5XX: server error */
    public static final int HTTP_SERVER_ERROR = 500;
    public static final int HTTP_INTERNAL_ERROR = 501;
    public static final int HTTP_BAD_GATEWAY = 502;
    public static final int HTTP_UNAVAILABLE = 503;
    public static final int HTTP_GATEWAY_TIMEOUT = 504;
    public static final int HTTP_VERSION = 505;
    the gui is just normal gui stuff, it contains the main method

  • BO Data Services - Reading from excel file and writing to SQL Server Table

    Hi,
    I would like to read data from an excel file and write it to a SQL Server Data base table without making any transformations using Data Services. I have created an excel file format as source and created target table in SQL Server. The data flow will just have source and target. I am not sure how to map the columns between source and target. Appreciate your quick help in providing a detailed steps of mapping.
    Regards,
    Ramesh

    Ramesh,
    were you able to get this to work? if not, let me know and I can help you out with it.
    Lynne

  • How to intercept Http requests by writing an App Server plugin?

    Hi all,
    My requirement of "Application Server plugin/filter" is to intercept all Httprequests coming to an
    Application Server instance (and not webserver), get the related information from the request, do whatever
    i want to do and then forward the request based on the info available in the request header to any
    webapplication or EAR deployed in the application server.
    I do not want to implement as a Servlet filter in a webapp. which is intrusive to the webapp.
    as we are aware, Servlet Filters can be attached to resources in a Web application and are configured in the
    web.xml file.
    I have tried out my requirements in Tomcat as follows, it works:
    In Tomcat, Valves are attached to a Tomcat container and are configured using a <Valve> element in the
    server.xml file.
    We have modified RequestDumperValve Filter ( source available) class extending Valve to intercept Http
    requests.
    I perform whatever i want to do in this custom Filter and then able to forward to the next valve in the valve
    chain of Tomcat container. I have Configured this valve in server.xml and it works fine.
    My queries are:
    1. Can i do it the same thing in WebLogic application server or other IBM Websphere application server ?
    2. Do the commercial appservers expose their APIs ( e.g. like Valve or Filter in Tomcat ) such that i can
    implement an application server plugin ?
    i.e. Are there any such Filter classes available which will intercept the Http request processing pipleine
    in application server ( precisely, its web container )
    If so, can you pls provide pointers for WebLogic application server and IBM Webpshere application server
    3. Is this against J2ee specs ?
    Appreciate if you can provide me any clues, tips, solutions, pointers regarding this problem.
    thanks and regards
    rajesh

    Try proxyHandler property and implement a custom ProxyHandler.
    ex:
    <property name="authPassthroughEnabled" value="true"/>
    <property name="proxyHandler" value="com.sun.enterprise.web.ProxyHandlerImpl"/>
    null

  • Servlet coding - writing file to server

    Hi,
    I am using IBM's RAD as my IDE. In my servlet, I have coded:
                        // set the filename for the server side repository ...
                        serverFileName = "/web/UserSource/" + user + "-" + shortFileName;
                        // Open up the output file on server ...
                        FileOutputStream fos = new FileOutputStream(serverFileName);
                        Writer outf = new OutputStreamWriter(fos,"Cp1047");The above logic is inside an "if" construct, as I only can set the file name after some information is retrieved.
    Afterwards, outside of this "if", I try to write to the file like so, (another "if"):
                   if (cnt > 4 && !prevLine.equals(boundary)) {
                        outf.write(prevLine);
                        out.println("<br>" + prevLine);
                   }The outf.write(prevLine) statement is flagged as "outf cannot be resolved"
    why, since I have previously defined it?

    The above logic is inside an "if" construct, as I
    only can set the file name after some information is
    retrieved.
    Afterwards, outside of this "if", I try to write to
    the file like so, (another "if"):
                   if (cnt > 4 && !prevLine.equals(boundary)) {
                        outf.write(prevLine);
                        out.println("<br>" + prevLine);
    The problem is the scope of outf. Since it is declared in an if block, it goes out of scope when that block is exited, so it's no longer available after the first if. Declare the variable outside the if, so that it's still in scope when you get to the next if block.
    FileOutputStream fos;
    if (whatever) {
        FileOutputStream fos = new FileOutputStream(serverFileName);
    if (whatever) {
        outf.write(prevLine);
    }Message was edited by:
    hunter9000

  • Writing PHP enable server in JAVA

    Hi,
    I have a server written by myself etirely in java. Now need to give PHP support to this server so that It can handle php pages and serves accordingly the page. how can I write a php enable server in java?If anyone can help me or send me some link to tutorial regarding this problem.

    please, if anyone know repply my post. I m badly the
    resources regarding this. I have to make my created
    server php enable. So help needed.Patience man, patience.
    Now here's how it's going to work.
    You have to install PHP as a commandline/cgi tool. You will have to go through the documentation on the PHP site yourself to get this setup. If you get stuck on this step go ask questions on a PHP forum because it's a PHP setup question and nothing to do with Java whatsoever.
    Then once you get that time you'll just use Runtime.getRuntime().exec to fire off the ol' PHP process with the parameters you want. Then capture the process of the output and bob's your uncle you're done.

Maybe you are looking for

  • 1.2.6 oracle lite connecting using SQL*PLUS

    i have successfully installed a oracle 8iLite on win2000 professional. user id --- system password --- manager host string ---- odbc:polite But when i try to give this command " set serveroutput on " i am getting a message "Server not available or ve

  • Add glyph at end of story...

    Hi, trying to do a find/ change where I need to add a glyph to the end of a story. I have a bunch of titles in their own text frame which also have their own paragraph style and I want to add a right indent tab, then a glyph after the last word in th

  • Can't delete unwanted HD downloads

    first I get scammed into buying the HD for a whole tv season, because they bury the non HD option... then I find out, I can't play HD on my 30" external monitor! Now I am plagued with HD downloads, which for some reason accompany the non HD downloads

  • JAAS and J2EE authorization combination

    I've got a custom login module, which authenticates users and associates roles with them. J2EE declarative security works just fine (isCallerInRole, etc). What I want now, is to extend the system to grant permissions to roles - to allow a finer-grain

  • How to make Chrome stop prompting?

    I get a ton of popups from Google Chrome.  For login pages, I get this: Google Chrome wants to use your confidential information stored in "abc.com" in your keychain. There are three buttons, "Always Allow", "Deny", "Allow". I always click Deny but t