Multiple proxies handling

Hi,
I have an application with multiple threads that run simultaneously. Each thread has its own HttpURLConnection object. This object will send a http request to a webserver. I would like to be able to specify the proxy that this particular request will go thru before arriving to the origin webserver. In other words, the proxy setting is localized for each thread. Therefore, I don't want to use the system properties to set the proxy. It looks to me that HttpURLConnection doesn't have this feature. Is it possible to do it with the current JVM? If not, is there a workaround?
Any recommendation would be greatly appreciated.
Sincerely,

Hi Kurt,
Thanks for the recommendation. It seems very promising. I'm trying to build a prototype to make sure that it works for me by creating a simple test program. However, I'm having some problem with it. Below is my code:
public static void main(String[] args) {
BufferedReader input;
CookieModule.setCookiePolicyHandler(null);
try
URL url = new URL("http://w3.internal.com/cf/home/news/news_detail.cfm?article_rid=647");
HTTPConnection con = new HTTPConnection(url);
NVPair[] def_hdrs = { new NVPair("Connection", "close") };
con.setDefaultHeaders(def_hdrs);
String file = url.getFile();
HTTPResponse rsp = con.Get(file);
int statusCode = rsp.getStatusCode();
if (statusCode >= 300)
System.err.println("Received Error: "+rsp.getReasonLine());
System.err.println(rsp.getText());
else
System.out.println(rsp.getText());
catch (IOException ioe)
System.err.println(ioe.toString());
catch (ParseException pe)
System.err.println("Error parsing Content-Type: " + pe.toString());
catch (ModuleException me)
System.err.println("Error handling request: " + me.getMessage());
The program generated java.io.EOFException: Premature EOF encountered and didn't print out the response content as wanted. This behavior is not very consistent since I also tried others different urls and some work, some don't.
Have you used this lib? Have you ever seen this behavior? What is the cause? Am I missing something?
Thanks in advance for your help.

Similar Messages

  • Is there a way to select MULTIPLE tabs and then copy ALL of the the URLs and titles/or URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; However, I prefer to use a Firefox feature rather than download an add on. Thanks.

    Currently, I can copy ONE tab's url and nothing else (not its name). Or I can bookmark all tabs that are open. However, I'd like to have the ability to select multiple tabs and then copy ALL of the the URLs AND their titles/or copy ALL of the URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; when I download the add on, I get a message saying that using the add on will disable Firefox's tab features. I prefer to use Firefox features rather than download and use an add on. Is there a way to do this without an add on?

    Hi LRagsdale517,
    You should definitely be able to upload multiple files by Shift-clicking or Ctrl-clicking the files you want to upload. Just to make sure you don't have an old version of the service cached, please clear the browser cache and then log in to https://cloud.acrobat.com/files. After clicking the File Upload icon in the upper-right corner, you should be able so select multiple files for upload.
    Please let us know how it goes.
    Best,
    Sara

  • How to use multiple proxies at the same time?

    im planning to use multiple proxies at the same time on mac but i have no idea how to do it?!. i need help!thanks!

  • Is it possible to use multiple proxies simulatneously?

    I have access to four different proxy servers within my college. (Squid I think)
    Each proxy has limitations on the number of simultaneous GET requests (4 I think. When I set anything higher
    in Firefox images don't load, etc..) and allows only http and https traffic.  I was thinking if it was possible to use
    all/at least more than one proxy at a time to improve speeds.
    Does wget/aria2c have this capability? To download segments of a file from different proxies simultaneously instead of just one?
    I'd seen the manpages but as far as I can tell they use only one proxy server at a time (usually through environment variables)
    In fact I'd be happy if I were able to get good download speeds for pacman updates using multiple proxies.
    I've heard of network interface bonding but it looks like a lot of trouble to set it up (kernel recompilation! )
    Is http://www.cyberciti.biz/howto/question … -howto.php the way or is there any other?
    Just thought I'd know all possibilities before compiling kernels and stuff..

    I don't know if aria2 can use multiple proxies simultaneously, but if you want to download packages quickly through multiple proxies, you could do the following in a script:
    generate a metalink for your packages using powerpill
    split the metalink into separate metalinks with roughly the same download volume in each one
    launch separate instances of aria2c for each metalink, each set to a different proxy
    If you try this, don't forget to change the connection settings in the powerpill configuration file (or when you split the metalink) to avoid more than 4 connections per proxy.

  • Multiple Event Handler

    Hey,
    This is probably a really stupid question but is there a way
    to declare an event handle on an Actions layer that handles
    multiple events?
    For example, both of these are equivalent:
    // on button
    on (rollOut)
    // on action layer
    btnTest.onRollOut = function()
    // on button
    on(rollOut, releaseOutside)
    // on action layer

    btnTest.onRollOut = btnTest.onReleaseOutside = function(){
    }

  • Multiple event-handling threads?

    I am writing a Java program that will launch other Java programs within the same JVM. This feature is for an RAD IDE that currently uses Runtime.exec.
    The main problem is that the launcher is an IDE that will try to launch Swing applications within the same JVM. If a badly-written program traps the event-handling thread, it will bring the whole IDE down. The IDE's "Kill" button wont even work.
    Is there any way to tell the JVM to use different event-handling threads for my application? Alternatively, does anybody know of any obscure functions I could use to maybe cause the event-handling thread to delegate processing to another one of my own threads? Ugly hacks are welcome.

    After I first posted this question, I've taken a look at the java.awt.EventQueue class. The API provides an easy way to use your own EventQueue that could possibly dispatch events with multiple threads. If you make sure that you only use one thread at a time for each virtual JVM, I don't think that there will be any thread issues (unless there are any assumptions in AWT/Swing code about there only being one thread).
    About the load time being 0.5 seconds. I'm sure it'll improve, but a failed load only loads and links a minimum number of classes. I wrote a program that runs the java compiler from com.sun.tools.javac.Main and it looks like the load time is about 1.75 seconds. Since the compile time itself is usually under a second for around 2000 lines of code, this kind of makes a difference (500MHz P3, by the way). This load time will probably be even greater for Swing applications.
    When you're lauching a big program it may not matter much but the load time really kills Java's ability to create a quick command-line tool (not that it's best-suited for such a tool anyway, but it would be nice to have that barrier removed).
    The biggest problem with creating a lightweight JVM right now is probably the stupid File class. Even if you change "user.dir" in the system properties, many File methods still resolve relative to the original "user.dir". Though many other problems exist, this is the one that really kills it because of the pervasiveness of the File class.

  • Last run date & time & multiple files handling

    Hi frnds,
    i am working on an outbound interface in which i am retrieving data from custom db table,processing it with other db tables and writing  the final output into a file into the application server and updating the custom db table.
    Now i have an issue here when i am giving plant as input in selection screen (select-options), i should also get those plants from my custom table which have no last run date and time.
    How to get that?
    Next part of my question is for multiple plants entry,multiple files have to created in application server.
    Presently, i have concatenated the file path n name.Do i need to loop the same with s_werks.Will it work
    Also i used an internal table for update data storage.When multiple plants are their how to handle the updation.
    Rgds,
    Simran

    Hi.
    In ur reply i did'nt understood two things
    1) this is how i'm doin the selection
        select lt_run_dt
               lt_run_tm
        into table itab1
        from z_table
        where prog_name EQ sy-repid
        AND   plant IN s_werks
    will it give me plants whose last_run_date and last_run_time are not in the z table?
    2)  If you are going with select-option from parameter, then if you have to write a FILE per PLANT. Then you can loop at plant->extract the data-> write to app server-update z table->end loop
    Does that means:
    loop at s_werks
    open dataset
    transfer
    modify
    endloop
    Kindly clarify to solve this issue.
    Rgds,
    Simran

  • Multiple File Handling

    I am looking for the example that can handle multiple files. Requirement is to check how many files are present in the unix folder usr/temp/ - pick one file - and move it to /usr/temp/processed/ folder
    Please provide pointers to the code example that can achieve this.
    TIA.

    HMM wrote:
    I am not sure, how to pick one file at a time from a given directory. Thanks!Please be clearer. What's the problem: finding out the files in a directory, or in the picking.

  • Multiple Error Handling mails Issue

    Hello,
    I have created one SSIS Package, And i have added "Send Mail Task" In Event Handler on Error Event of the package.
    Whenever i execute this package it will send multiple mails for single error.
    Could you please help me to resolve this issue to send a single mail.

    Hi Vinay,
    I am able to reproduce the issue in my test environment. It indeed sends a single email for each error. I have tested the method described in the blog (http://agilebi.com/jwelch/2007/05/05/handling-multiple-errors-in-ssis/),
    however, it still send multiple emails even if the Send Mail Task is placed in the OnPostExecute event handler of the package. If you would like, you can give it a try to see if it works in your package.
    As a workaround, you can send the content in the error log instead of the System variable ErrorDescription. Furthermore, we can also implement custom logging to get the System::ErrorDescription value, then we can send the content of the custom logging.
    Since the Send Mail Task cannot send the logging of the current package because the logging is being written. So, we can create another package which contains the Execute Package Task to call the existing package, in the parent package we can add a Send
    Mail Task under the Execute Package Task, and set the Precedence Constraint between them to Failure. 
    For more information about Custom Logging Using Event Handlers, please see:
    http://consultingblogs.emc.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx 
    Hope this helps.
    Regards,
    Mike Yin
    TechNet Community Support

  • Multiple SQL_HANDLE_DBC handles do not work on Linux

    Hello,
    I am seeing the following error from the SQL Server Driver For Linux when I attempt to execute a query on a SECOND connection within my application:
    SQLSTATE: IM001
    Native Error Code: 0
    Message: [unixODBC][Driver Manager]Driver does not support this function
    I have compiled/run the test case I have on Windows and the code executes without issue.
    Here is my test case:
    // SQLGetData.cpp
    // g++ -M64 -I$ODBC/include -L$ODBC/lib -g -lodbc sqlgetdata.cpp
    // cl sqlgetdata2.cpp odbc32.lib
    // CREATE TABLE tstDFRBLB(col1 varbinary(max))
    #if defined(_WIN32)
    #include <windows.h>
    #endif
    #include <stdlib.h>
    #include <stdio.h>
    #include <sql.h>
    #include <sqlext.h>
    void checkError ( SQLRETURN rc, const char *cstr )
    if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ) {
    return ;
    } else if( rc == SQL_INVALID_HANDLE ) {
    fprintf( stderr, "Error: invalid handle: %s.\n", cstr ) ;
    } else {
    fprintf( stderr, "Unknown Error occured in %s: code %d.\n", cstr, rc ) ;
    void checkStmtError( SQLRETURN rc, SQLHSTMT stmth )
    if(rc != SQL_SUCCESS) {
    int i = 1 ;
    SQLSMALLINT length;
    SQLINTEGER sqlcode;
    SQLCHAR *sqlstate = (SQLCHAR *) malloc(100 * sizeof(SQLCHAR));
    SQLCHAR *message = (SQLCHAR *) malloc(1000 * sizeof(SQLCHAR));
    while ( SQLGetDiagRec( SQL_HANDLE_STMT, stmth, i, sqlstate, &sqlcode,
    message, 1000, &length ) == SQL_SUCCESS ) {
    printf( "\nSQLSTATE: %s\n", sqlstate ) ;
    printf( "Native Error Code: %ld\n", sqlcode ) ;
    printf( "Message: %s\n", message ) ;
    i++ ;
    delete sqlstate;
    delete message;
    int main( int ac, char **av )
    SQLHENV envh ;
    SQLHDBC dbch ;
    SQLHDBC dbch2 ;
    SQLRETURN rc ;
    SQLHSTMT stmth ;
    const char *select_stmt = "SELECT * FROM tstDFRBLB" ;
    /* Allocate a environment handl */
    rc = SQLAllocHandle( SQL_HANDLE_ENV, // Handle type
    SQL_NULL_HANDLE,
    &envh // SQLHENV handle (environment)
    checkError( rc, "SQLAllocHandle - SQL_HANDLE_ENV" ) ;
    /* Set environment attributes */
    rc = SQLSetEnvAttr( envh, // Environment handle
    SQL_ATTR_ODBC_VERSION, // Attribute to set
    (SQLPOINTER) SQL_OV_ODBC3,// New attribute
    SQL_NTS // SQL_NTS (null terminated)
    checkError( rc, "SQLSetEnvAttr" ) ;
    /* Allocate a database connection handle */
    rc = SQLAllocHandle( SQL_HANDLE_DBC, // Handle Type
    envh, // Where to attatch the new handle
    &dbch // Pointer to new handle
    checkError( rc, "SQLAllocHandle - SQL_HANDLE_DBC" ) ;
    /* Establish a connection */
    SQLCHAR outStr[1024];
    SQLSMALLINT outSize;
    rc = SQLDriverConnect(dbch, NULL,
    #if defined(_WIN32)
    (SQLCHAR*)"DSN=MSSQL_2012_NC_64;UID=*****;PWD=*****;DATABASE=qe1;", 57,
    #else
    (SQLCHAR*)"DSN=mssql-2012-md_64;UID=*****;PWD=*****;DATABASE=qe1;", 57,
    #endif
    outStr, sizeof(outStr), &outSize, SQL_DRIVER_NOPROMPT);
    /* Allocate a second database connection handle */
    rc = SQLAllocHandle( SQL_HANDLE_DBC, // Handle Type
    envh, // Where to attatch the new handle
    &dbch2 // Pointer to new handle
    checkError( rc, "SQLAllocHandle - SQL_HANDLE_DBC" ) ;
    rc = SQLSetConnectAttr(dbch2,
    SQL_ODBC_CURSORS,
    (SQLPOINTER)SQL_CUR_USE_DRIVER,
    (SQLINTEGER)NULL); // this value is ignored
    checkError( rc, "SQLSetConnectAttr - SQL_ODBC_CURSORS" ) ;
    rc = SQLDriverConnect(dbch2, NULL,
    #if defined(_WIN32)
    (SQLCHAR*)"DSN=MSSQL_2012_NC_64;UID=*****;PWD=*****;DATABASE=qe1;", 57,
    #else
    (SQLCHAR*)"DSN=mssql-2012-md_64;UID=*****;PWD=*****;DATABASE=qe1;", 57,
    #endif
    outStr, sizeof(outStr), &outSize, SQL_DRIVER_NOPROMPT);
    rc = SQLAllocHandle( SQL_HANDLE_STMT, dbch2, &stmth ) ;
    checkError( rc, "SQLAllocHandle - SQL_HANDLE_STMT" ) ;
    ** Read the value back
    rc = SQLExecDirect( stmth, (SQLCHAR*)select_stmt, SQL_NTS ) ;
    checkStmtError( rc, stmth );
    char outWData[168000];
    SQLLEN outInd = 0;
    while ( SQLFetch( stmth ) == SQL_SUCCESS )
    rc = SQLGetData( stmth, 1, SQL_C_BINARY, outWData, sizeof(outWData), &outInd );
    checkStmtError( rc, stmth );
    if(outInd == SQL_NULL_DATA) {
    printf("Data Returned: NULL\n");
    else {
    printf("Data Returned Length %d\n", outInd);
    rc = SQLMoreResults(stmth);
    checkStmtError( rc, stmth );
    /* Disconnect from the database */
    rc = SQLDisconnect( dbch2 ) ;
    checkError( rc, "SQLDisconnect" ) ;
    /* Free connection and environment handles */
    rc = SQLFreeHandle( SQL_HANDLE_DBC, dbch2 ) ;
    checkError( rc, "SQLDisconnect" ) ;
    /* Disconnect from the database */
    rc = SQLDisconnect( dbch ) ;
    checkError( rc, "SQLDisconnect" ) ;
    /* Free connection and environment handles */
    rc = SQLFreeHandle( SQL_HANDLE_DBC, dbch ) ;
    checkError( rc, "SQLDisconnect" ) ;
    SQLFreeHandle( SQL_HANDLE_ENV, envh ) ;
    checkError( rc, "SQLDisconnect" ) ;
    return EXIT_SUCCESS ;
    Thank you for any help/advice.
    Dave
    David Ritter

    Hi David,
    According to your description, the code running smoothly in windows, and getting this problem when using SQL Server driver for linux.
    So, what's the version of your SQL Server driver for linux?
    As per the error message, the function is not supported, so could you please check the configuration of the driver or there are some limitation in the driver you used?
    Please follow these links to have a check:
    The ODBC Driver 11 for SQL Server on 64-bit Red Hat Enterprise Linux 5 and 64-bit Red Hat Enterprise Linux 6.
    You can download the ODBC driver for Red Hat at
    Microsoft ODBC Driver for SQL Server.
    The ODBC Driver 11 for SQL Server on 64-bit SUSE Linux Enterprise 11 Service Pack 2. This driver is currently available as a Community Technology Preview (CTP).
    You can download the ODBC driver for SUSE Linux at
    Microsoft ODBC Driver 11 for SQL Server on SUSE Linux.
    If you have any feedback on our support, please click
    here.
    Iric Wen
    TechNet Community Support

  • Multiple environment handles for same file directory in DPL

    Hi,
    I have a standalone berkeley DB created by DPL. When one application is already running and accessing the DB, if i try to execute another application accessing the same DB i am getting EnvironmentLockedException. Went through articles of FileManager and EnvironmentImpl but could not understand how to handle that?
    Please suggest.

    This is not related to DPL. Please see the link Linda mentioned.
    --mark                                                                                                                                                                                       

  • Multiple session handling in the Web UI

    Hi all,
    According to the SAP help documentation, a user can have multiple sessions open in the Web UI. However after a certain period, inactive sessions are terminated. This is certainly the behaviour that we witness on our system, the second inactive session times out after about 25 minutes.
    Does anyone know how to adjust the time out of this second session, this appears to be independent of the general timeout for htttp which is set at 2hours according to the transaction SMICM.
    Thanks in advance
    Paul

    Follow the steps mentioned  by Pankaj.
    Even after this the debugger did not start, do the steps below so that HTTP debugger is on
    1) Run the T-code SICF
    2) Search for the service name CRM_UI_FRAME in the service name. click on F8
    3) Select CRM_UI_FRAME and click on the Edit Menu. Select the option Debugging --> Activate Debugging
    4) This opens a pop up, give your user name and click on OK.
    Now start running the application. The debugger should start.
    Hope this helps.
    Regards,
    Vinay

  • Multiple tasks handling in change Correction

    Hi Gurus,
    Need your help on the following queries:
    1. when we create a change request from a service desk request, how does the information flow happens. Also i have a scenario, wherein until my chnage request gets resolved and closed, i should not be able to close on the service desk request. Is it possible and if yes, please explain how it can be achieved.
    2.Another query - Is it possible in Charm to have multiple tickets as parent-child relationship. TO explain better, i have a scenario, wherein the change request needs to be worked upon by different teams in parallel and they should have their own workflows assigned to them. Once the work for all these parallel tasks has been completed, i should be able to move these changes as single entity into Production. please help with the solution.
    Thanks and Regards,
    Imran

    Hi,
    Please refer this Sample workflow URL
    http://infomoss.blogspot.in/search/label/Workflow2010
    Thanks
    Jaison A
    http://infomoss.blogspot.in

  • Multiple categories handled by Account tranformation in BPC NW7.5 ?

    Hi all
    I  am getting error message for multiple categories(Actual and Plan) in single a  CALCACCOUNT package for specific time and year.  I do have data for Actual and Plan version.  Is there any system limitation on categories in 7.5NW?
    appreciate your help and suggestions
    Thanks
    R

    Hi,
    Can you not run the package for different categories separately? Like have a selection for category in the data manager prompt and run it for Actual and then you can for your plan category.
    Hope I understood your query. Let us know if you are looking for something else. Please also share the package log if you are getting any error.
    Thanks,
    Sreeni

  • Multiple database handling through Forms4.5 D2K

    Hi,
    Is it possible to connect to multiple ORACLE servers from one form (application is on D2k forms 4.5 )at the same time without having a DB-LINK. If so then how ?

    Hi Gerry,
    Create a view by joining the three tables and have the base table
    of the block as the view. This will allow you to show only the
    necessary items.
    Regards,
    Anandh
    CV (guest) wrote:
    : Hi Gerry,
    : Try moving the items of the link table to a different
    : canvas and make all the items not navigable. You can then
    : navigate to the address block straight from the customer block.
    : Hope this helps.
    : CV.
    : Gerry Cameron (guest) wrote:
    : : I am using Forms4.5, to develop a customer search screen,
    which
    : : brings back the address of the customer. However the database
    : : itself returns this information, from three seperate tables.
    : : i.e. customer_name table, link_table (this links cust_id to
    : : address), address_table.
    : : The problem I have, is that I do not want the link table to
    be
    : : visable on the form, however, if I leave it off, the form
    will
    : : not bring back the address, saying it doesn't recognise the
    : join
    : : condition. I have tried to hide the link_table information,
    by
    : : drawing a rectangle over the top of it, however this does not
    : : hide the information.
    : : Can anyone tell me how to solve this problem, either by using
    : : multiple forms, or by, being able to put all the info on a
    : : single form (preferable).
    : : Thanks
    null

Maybe you are looking for

  • Master-Detail Form in Form6i Developer

    First of All Hi to all Respected Gurus. I am stuck in a very basic element and that is Primary-Key/Foreign-Key relation. I am trying to create a Master-Detail Form based on following structure. Records in Master Table and Child Table are saving (inse

  • Reg - Reading internal table with multiple record in a single field

    Dear Guru's,                     i want to read a internal table with field having mutilple entries like read table READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ). But it says comma without preceding col

  • How to install SAP SLC (Software Logistics Controller)

    Hello, How do I install SAP Software Logistics Controller? Thanks for your help in advance. Regards, Haleem

  • Cinelerra startup error message

    Hello. When starting Cinelerra I get this: void MWindow::init_shm():WARNING:/proc/sys/kernel/shmmax is 0x2000000, which is too low Before running Cinelerra do the following as root: echo "0x7fffffff" > /proc/sys/kernel/shmmax Found an answer to that

  • How to print the output string in inverted commas

    hi all, my question is like i have a string "welcome to java" using println statement i need to print the above statement in inverted commas like the output should appear as "welcome to java"