HTTP Proxy: My grogram runs even I put a wrong proxy host and port

I'm new to network programming, so I just use System.setProperty() for easy. But I don't know why this piece of code runs with whatever proxy I set:
(I download a file and display in a in JTextArea, this is the ActionListener for 'Download' button)
     private class GetFileListener implements ActionListener
          public void actionPerformed(ActionEvent event)
               if (completeRadioButton.isSelected())
                   try
                        viewFileTextArea.setText("");
                    System.setProperty("http.proxyHost", "http://123.123.123.123");
                    System.setProperty("http.proxyPort", "123");
                    System.setProperty("proxySet", "true");
                       URL url = new URL(completeURLTextField.getText());
                       BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
                       String str;
                       while ((str = in.readLine()) != null)
                           viewFileTextArea.append(str + "\n");
                       in.close();
                   catch (MalformedURLException e)
                        viewFileTextArea.setText("URL not found!");
                   catch (IOException e)
     }Please help! Thank you very much!

This is the new version:
     private class GetFileListener implements ActionListener
          public void actionPerformed(ActionEvent event)
               if (completeRadioButton.isSelected())
                   try
                        viewFileTextArea.setText("");
                    SocketAddress addr = new InetSocketAddress("123.123.123.123", 123);
                    Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
                    URL url = new URL(completeURLTextField.getText());
                    URLConnection conn = url.openConnection(proxy);
                       BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
                       String str;
                       while ((str = in.readLine()) != null)
                           viewFileTextArea.append(str + "\n");
                       in.close();
                   catch (MalformedURLException e)
                        viewFileTextArea.setText("URL not found!");
                   catch (IOException e)
     }but it still runs regardless of what proxy host and port I set in InetSocketAddress. Did I wrongly use Proxy class in the code above?

Similar Messages

  • Dynamic Host and Port for Web Proxy

    hi,
    When I create a web proxy in JDev I supply the hostname and the port for the web service. The code is then compiled and then deployed. However I want the host and port to be dynamic (kept in a varaible) so when I move my deployment from Development to Test server I just need to change a value in a database or text file. I don't want to re-compile and deploy the code when I move servers. Is there any way to do this??
    Thanks
    Stephen

    Hi,
    not so in the WSDL file that is created. If from the client side access, then WS poxy classes allow you to do this
    Frank

  • Change/Configure Host and Port for the Web Service Proxy with Server

    Hi,
    Is there a way to configure Host and Port in generated proxy for Web service depending upon server. (ADF 11g)
    Scenario:
    We are consuming Credit Card web service from a service provider and have different Host and Port details for development, QA and Prod.
    So we created proxy classes using wsdl for development and things work fine, but when deploying code to QA or Prod we need to change the Host
    and Port details.
    Is their a way we could user variable's for Host and Port which looks to some configuration file to evaluate their values
    based on server.
    I am a bit new to this web service .. will appreciate if someone could provide an example.
    Thanks.

    Are you using Web Service Proxy or Web Service Data Control?
    If you are using Web Service Proxy. Right click on your Proxy --> Properties --> Port Endpoints. Here you can change the IP & Port details for each port.
    Venkat

  • NB200 running Windows XP - What's wrong with my USB ports?

    I bought a new NB200 recently and have had a problem with my USB ports ever since.
    Independently, both rhs ports operate fine with my Logitech wireless mouse - unless I attach it via a USB hub. When I use the second port to attach another device - in this case an external DVD-RW - the mouse simply freezes. Meantime, the DVD-RW itself is recognised by Device Manager, etc - ("Working fine - with plenty of available power output per port), but it nonetheless fails to work and Windows Explorer is unable to read any disc inserted in it.
    Furthermore, the lhs USB port is pure decoration only; nothing I attach to it (even the mouse) will work, neither will the Sleep & Charge capability (at any of the 4 Modes).
    I've uninstalled the USB controllers and ports using Device Manager which, after re-booting, continues to report that all's well, both with the devices I attach and the ports themselves, albeit i's still patently not!
    I'm concerned that I'm still unable to create a recovery disc should the worst happen so can anyone help me resolve my conundrum, please?
    Am I doing something wrong or, less likely to be the case, I'm sure, is there perhaps a fault with my machine??
    Any advice would be helpful, please.
    Regards
    Bob

    Thanks for the suggestion, Guys, but neither provided the solution. I'd already updated both BIOS and Chipset drivers to the latest available.
    Incidentally, the OS is the version of XP that came already loaded - subsequently updated via Windows Update, of course.
    Any further thoughts anyone??
    Bob

  • TS3212 It still will not download when I enter Run even after I have added the site and turned OFF all Pop-Up Blockers!

    Trying to Install Itunes to a new Desktop Computer so I can Sync My Library back in. It goes into a Loop when I Enter Run. I have added itunes.com to Safe websites and that did n't work now I havw Turnedd OFF all Pop-up Blockers and it still will not work! I own an iPad 2 & an iPhone 4S so I need to get my iTunes back!!

    Sorry for  the typos, I hope my message still gets across!

  • How to get running application host and port?

    How can I get the host name and the port number of the currently running application?
    http://<host>:port/<context root>/faces/<page>
    Thanks,
    Mitesh.

    FacesContext.getCurrentInstance().getExternalContext().getRequest().getRemoteHost()
    FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()
    FacesContext fctx = FacesContext.getCurrentInstance();
    HttpServletRequest rq = (HttpServletRequest)fctx.getExternalContext().getRequest();
    rq.getServerPort()

  • Put the right host and port in notification emails

    I just got a email confirming the creation of an APEX workspace, but the URL shown is this:
    URL: http://localhost:8080/apex/
    Is there a way to tell APEX that it really resides at http://myapexmachine/apex?
    Thanks

    Hi,
    As I understand it take url where you have connected to Apex.
    So if you connect from http://myapexmachine/apex then url in email should be same.
    When you did create workspace did you connect using http://localhost:8080/apex/ ?
    Br, Jari

  • Server Host and Port for HTTP Client Too

    Hi All,
    I'm using the HTTP Client tool to connect to XI. How can i find out the ServerHost, ServerPort and Client values.
    Thanks,
    Sandeep

    Hi Michal, Thanks for the response,
    But when i use these values and connect. I get the Response - Resource not found . See the HTML below
    Result:  
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Error Report</title>
    <style>
    td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;}
    A:link
    A:visited
    A:active
    </style>
    </head>
    <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0">
    <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">
    <tr bgcolor="#FFFFFF">
        <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b>  404 &nbsp Not Found</b></font></td>
    </tr>
    <tr bgcolor="#3F73A3">
        <td height="23" width="84"><img width=1 height=1 border=0 alt=""></td>
        <td height="23"><img width=1 height=1 border=0 alt=""></td>
        <td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP J2EE Engine/6.45 </b></font></td>
    </tr>
    <tr bgcolor="#9DCDFD">
        <td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td>
    </tr>
    </table>
    <br><br><br><br><br><br>
    <p><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b>  The requested resource does not exist.</b></font></p>
    <p><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><table><tr><td valign="top"><b> Details:</b></td><td valign="top"><PRE>Go to <A HREF="/" target="_parent">main page</A> of this application!</PRE></font></td></tr></table></font></p>
    </body>
    </html>
    The interface, service all are correct. Do you think something else is wrong?
    Thanks,
    Sandeep

  • No programs will run even finder after an update even in safe mode

    I tried installing the newest update in my macbook pro and after my comp ran out of battery no programs including finder will run even in safe mode. I get and error message that says finder quit unexpectedly over and over again.
    any help would be awesome
    thanks
    kurt

    [[Firefox 18 crashes on startup due to malware - how to fix]]

  • Web Service Proxy with Dynamic IP and Port

    hi,
    I am currently looking at the Web Service Proxy generation in JDev 11g. I can generate proxies fine, but the proxies are generated with static host and port. I want to substitute the host and port during runtime if required, for instance read the values from a database. I need to do this to avoid compiling the application for every deployment we make dev, test and production. Is there an easy way to set the generated proxy host and port? Are there any examples?
    Thanks in advance!
    Stephen

    Hi,
    Maybe you should have a look on XML Catalogs feature, but I am not sure if JDeveloper support it and how to support it.
    -LJ

  • I dropped my iPhone 4 in the sink where it was submerged in water for not even 2 seconds I took it out and put it in a warm room by the radiator and most of it works but no sound and battery length is short and runs out quickly. Any ideals on how to help?

    I dropped my iPhone 4 in the sink where it was submerged in water for not even 2 seconds I took it out and put it in a warm room by the radiator and most of it works but no sound and battery length is short and runs out quickly. Any ideals on how to help?

    $149
    They do not repair .Apple exchange and all returned units are refurbished at The Apple plants in China
    So you get a device that looks like and functions like new
    Are you familiar with the results of water and electricity mixing

  • Minefield just would not open pages, whatever I tries to type in the addressbar the URL just stayed there and nothing happened. Even if I opened a new tab and put a new url again it did not even start loading the page. This is happening since the last upd

    Minefield just would not open pages, whatever I tries to type in the addressbar the URL just stayed there and nothing happened. Even if I opened a new tab and put a new url again it did not even start loading the page. This is happening since the last updates from today or yesterday. I already removed minefield and installed it again
    == This happened ==
    Every time Firefox opened
    == today ==
    == User Agent ==
    Mozilla/5.0 (Windows; Windows NT 5.2; Win64; x64; rv:2.0b3pre) Gecko/20100728 Minefield/4.0b3pre ( .NET CLR 3.5.30729; .NET4.0E)

    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    See also http://kb.mozillazine.org/Browser_will_not_start_up
    You can discuss issues with Namoroka 3.6 and Minefield 4.0 nightly and alpha/beta builds at the MozillaZine Firefox Builds forum.
    That forum is better suited to discuss such issues.
    You need to register on the MozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=23

  • Ever since the systyem upgraded me to 3.6.6. I can not even run one eight hour day without firefoc either crashing or locking up which requires me use C/A/Deleate to close the program. I used to be able to run 8 to 12 windows at a time and NEVER lock up

    Ever since the systyem upgraded me to 3.6.6. I can not even run one eight hour day without firefoc either crashing or locking up which requires me use C/A/Deleate to close the program. I used to be able to run 8 to 12 windows at a time and NEVER lock up or crash with the older version. Is this problem being looked into and or being corrected. I use Firefox with Google and my system is XP Pro 32 bit. THIS IS REALLY making me MAD. My email is [email protected] and would appreciate a response to this ASAP. I have tried a couple of items from your help section and nothing works.

    <u>'''Anonymous'''</u>
    Please post a separate question. Thank you. https://support.mozilla.com/tiki-ask_a_question.php?locale=en-US&forumId=1
    <u>'''chris'''</u>
    <u>'''''Crashing'''''</u>
    See:
    http://support.mozilla.com/en-US/kb/Firefox+crashes
    http://kb.mozillazine.org/Firefox_crashes
    http://support.mozilla.com/en-US/kb/Firefox+crashes+when+loading+certain+pages
    http://support.mozilla.com/en-US/kb/Firefox+crashes+when+you+open+it
    http://support.mozilla.com/en-US/kb/Firefox+will+not+start
    http://kb.mozillazine.org/Browser_will_not_start_up
    ''<u>'''Hanging'''</u>''
    See: http://support.mozilla.com/en-US/kb/Firefox+hangs
    <u>'''''Hanging at exit'''''</u>
    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: [http://kb.mozillazine.org/Kill_application Kill Application]
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    [[Firefox hangs]]
    [http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit]
    [[Firefox is already running but is not responding]]
    ''<u>'''Safe Mode'''</u>''
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.
    <u>'''chris'''</u>
    <u>'''''Other Issues'''''</u>: ~~red:You have installed plug-ins with known security issues. You should update them immediately.~~
    <u>'''Update Java'''</u>: your ver. 1.6.0.~~red:17~~; current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    (Firefox 3.6 and above requires Java 1.6.0.10 or higher; see: http://support.mozilla.com/en-US/kb/Java-related+issues#Java_does_not_work_in_Firefox_3_6 )
    ''(Windows users: Do the manual update; very easy.)''
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.
    <u>'''NOTE:'''</u> Java version 1.6.0.21 has been released. It is mainly an update for developers of Java applications and most users do not need to be concerned about downloading version 1.6.0.21. <u>'''''At this time'''''</u>, the update option in existing installations of Java 1.6.0.20 are not updating to version 1.6.0.21; <u>'''''at this time'''''</u>, it must be manually downloaded and installed. According to the Java release notes:
    ''"'''Bug Fixes'''''
    ''Java SE 6 Update 21 does not contain any additional fixes for security vulnerabilities to its previous release, Java SE 6 Update 20. Users who have Java SE 6 Update 20 have the latest security fixes and do not need to upgrade to this release to be current on security fixes."'' Source: http://java.sun.com/javase/6/webnotes/6u21.html
    <u>'''Install/Update Adobe Flash Player for Firefox (aka Shockwave Flash)'''</u>: your ver. 10.0 r~~red:45~~; current ver. 10.1 r53 ('''important security update 2010-06-10'''; see: http://www.adobe.com/support/security/bulletins/apsb10-14.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash Updating Flash]'''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    -exit Firefox (File > Exit)
    -''<u>In Windows,</u>'' check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -''<u>In Windows,</u>'' double-click on the Adobe Flash installer you just downloaded to install/update Adobe Flash
    -when the Flash installation is complete, start Firefox, and test the Flash installation here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507&sliceId=1
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version of Flash. To install/update the IE ActiveX Adobe Flash Player, same instructions as above, except use IE to download the ActiveX Flash installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Flash ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]
    <u>'''Update Shockwave for Director (aka Shockwave Player)'''</u>: your ver. ~~red:10.1 (very old)~~; current ver. 11.5.7.609 (<u>important security update released 2010-05-11</u>; see http://www.adobe.com/support/security/bulletins/apsb10-12.html)
    NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    SAVE the installer to your hard drive (Desktop is a good place so you can find it). When the download is complete, exit Firefox (File > Exit), locate and double-click in the installer you just downloaded, let the install complete.
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox#_Installing_Shockwave Installing Shockwave]'''
    <u>'''You '''</u>~~red:<u>'''MAY'''</u>~~<u>''' need to Update Adobe Reader for Firefox (aka Adobe PDF Plug-In For Firefox)'''</u>: your ver. N/A; current ver. 9.3.3 (important security update release 06-29-2010; see: http://www.adobe.com/support/security/bulletins/apsb10-15.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: http://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox#Installing_and_updating_Adobe_Reader
    ''<u>You may be able to update from the Adobe Reader installed on your system</u>'' instead of going to the Adobe site and downloading. Open the Adobe Reader installed on your system (''in Windows, Start > Program Files, find and click Adobe Reader to open''), click Help, click Check for Updates.
    ''<u>If you go to the Adobe site to download the current Adobe Reader:</u>''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    ~~red:-See the images at the bottom left of this post to see the steps to take on the Adobe site~~
    -exit Firefox (File > Exit)
    -In Windows: check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -In Windows: double-click on the Adobe Reader installer you just downloaded to install/update Adobe Reader
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version. To install/update the IE ActiveX version, same instructions as above, except use IE to download the ActiveX installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Adobe_Reader ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]

  • I just put itunes upeate 11 on and now itunes will not run. I get an error that sys iTunes has stopped and windows is sutting it down. I reinstalled 10.7 and it will not run eather now.

    I just put itunes upeate 11 on and now itunes will not run. I get an error that sys iTunes has stopped and windows is sutting it down. I reinstalled 10.7 and it will not run eather now.

    C Mawle wrote:
    Thanks.  I have followed all the instructions as recommended and nothing has worked so it looks like the restore/update may have been interrupted - would loss of internet connection do this?
    Yes it would, possibly even brick it.
    Have successfully connected my ipod nano with iTunes so looks like the device driver is working.
    Can I use my ipod nano USB connector to check?
    It is not much help to you, since the device that you need still not recognized.
    Anyway looks like I may have to swallow the loss of data.  Have set-up a call for tomorrow with Apple support so will wait until after this before doing the factory restore!
    Good luck, but if you expect miracle from that call good luck again.

  • How can i set dynamic properties in HTTP Binding adapter  at run time

    Hi,
    I am trying to put dynamic properties in HTTP Binding adapter at run time. I am able to Set endpointURI, UserName and Password dynamically using below code.
    Is it possible to set Version , Retry Count, timeout, authentication type at run time.
    below is code for setting endpointURI, UserName and Password dynamically.
    <invoke name="HttpInvoke" bpelx:invokeAsDetail="no"
    partnerLink="SACS_Http_Adapter"
    portType="ns1:Request_Response_ptt" operation="Request-Response"
    inputVariable="HttpInvoke_Request-Response_InputVariable"
    outputVariable="HttpInvoke_Request-Response_OutputVariable">
    <bpelx:toProperties>
    <bpelx:toProperty name="endpointURI" variable="inputVariable"
    part="payload" query="@endpoint"/>
    <bpelx:toProperty name="javax.xml.ws.security.auth.username"
    variable="inputVariable" part="payload"
    query="@username"/>
    <bpelx:toProperty name="javax.xml.ws.security.auth.password"
    variable="inputVariable" part="payload"
    query="@password"/>
    </bpelx:toProperties>
    </invoke>
    Thanks,
    Siva
    Edited by: 929920 on Apr 25, 2012 7:45 AM

    Hi Bastain,
    Assuming your using the Batch Process Model, you can programatically insert a new SN into the correct parameter in the postUUT callback sequence.
    This sequence has access to the UUT.SerialNumber parameter so you can use a File Global to pass the SN from the main sequence to the postUUT callback. 
    Here is an example of what I mean. 
    Adam
    Attachments:
    set SN within Main Sequence.seq ‏80 KB

Maybe you are looking for

  • How to figure it out that record is getting printed on a new page

    HI Folks,   I have the requirement  where  the report needs to show the data in below format.                        Name                                   Details                        ABC                                        1                   

  • Can I  change the information,such as MEDIA URL,username and password  ,from English to Chinese?

    I have downloaded the OSMF1.6.1 from the website http://sourceforge.net/projects/osmf.adobe/files/. And here comes the question.When playing encrypted video with OSMFPlayer, I want to change the message such as "user name" and "password" in the Authe

  • 16-bit color depth SVG output?

    Bon día to you all, I have a very dumb question... How do I output 16-bit SVG files from Illustrator? I've been working with Illustrator for what has seemed an eternity but have never ventured into the realm of SVG. Now I have found myself with the n

  • Lightroom Post-Processing

    One thing I'd like to see added to the Lightroom export dialog, perhaps in the post-processing section, would be the option to update DNG previews and metadata (when exporting DNGs of course).

  • How to Run Reports Demo on IAS Rel.2

    I have successfully installed 9ias Release 2, infrastructure and Business Intelligence and Forms on one Solaris server. I am now trying to run the demos. Forms demo runs fine, but the Reports Demo is confusing. I am presented with a screen that says