JRE 1.4.1 url.openConnection() broken?

The following code fails under JRE 1.4.1, but works fine under JRE 1.3.1.x.
URL url = new URL("http://www.financecenter.com/");
java.net.URLConnection conn = (java.net.URLConnection) url.openConnection();
Under JRE 1.4.1, this code results in the following exception:
java.net.MalformedURLException: no protocol: index.cfm
     at java.net.URL.<init>(Unknown Source)
     at java.net.URL.<init>(Unknown Source)
     at java.net.URL.<init>(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
     at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey(Unknown Source)
     at com.htinc.fmo.htmlretrieval.e.a(DashoA8EVA)
     at com.htinc.fmo.htmlretrieval.HtmlRetriever.getHtml(DashoA8EVA)
     at com.htinc.fmo.applet.URLContentAppJavaPlugIn.getURLContent(DashoA8EVA)
     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
     at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
Any suggestions?

This looks like a bug in the server running on www.financecenter.com. If you look at section 14.30 of RFC 2616 the Location header should be an absoluteURI - if it just returns "Location: index.cfm" this is incorrect.
Note that the issue has been observed before and the http stream handler has been changed so that it now resolves these type of invalid locations. See the following (changes are in 1.4.2) :-
http://developer.java.sun.com/developer/bugParade/bugs/4726087.html

Similar Messages

  • Problem with url.openConnection

    Hi everyone. I have created an applet that runs ok in appletviewer. The problem is that if I load it from IE an exception occurs. THis is because, at some point I want to read a file, and I do url.openConnection. The getContentLength() method of the urlconnection then returns -1 instead of the real file's size. I have to notice, that I have created .jar file for my classes and I use signatures for loading my applets in the browser.
    Any ideas?
    Thanx in advance,
    Theodore

    That made sense, so I changed my imports from:
    import com.sun.net.ssl.internal.www.protocol.https.*;
    import com.sun.net.ssl.internal.ssl.*;
    to
    import javax.net.ssl.*;
    and successfully recompiled. It was hopeful at first because It crashed on some permissions. As soon as I corrected the permissions in java.policy, that damn ClassCastException was back.
    Is this still the way to do it using javax.net.ssl?
    System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
    Security.addProvider(new sun.security.provider.Sun());
    URL url = new URL(authurl);
    HttpsURLConnection connection = HttpsURLConnection)url.openConnection();
    Thanks for your time...

  • Question about (HttpURLConnection)url.openConnection();

    Greetings Java Experts.
    I have a question about the following code snippet.
    As you can see below this snippet will establish a connection.
    Question how long will it allow for the connection to be established - for example if the web traffic is taking an unusually long period of time can I set it to a higher value ?
    connection = (HttpURLConnection)url.openConnection();
         HttpURLConnection.setFollowRedirects(true);
         connection.setInstanceFollowRedirects(true);
         connection.setUseCaches(false);
    stev

    forever, unless you set SO_TIMEOUT

  • Com.sap.pct.erp.mss.requisitionrequest_statusoverview _Target URL of Broken

    hi
    Friends
    in sap portal>portal content->content admin>end user content->employee self service--->line_manager
    under iview--->com.sap.pct.erp.mss.requisitionrequest_statusoverview WHENEVER I AM CLICK INTO THAT IVIEW
    SHOWING ERROR
    Target URL of Broken Delta Link: pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.common.bp_folder/com.sap.pct.erp.common.iviews/com.sap.pct.erp.common.isrstatusoverview
    please help me
    rafi shaik

    Hi,
    I know this is an old thread but I could'nt find this subject into any other thread and I got the same problem recently.
    When you are performing the export, choose '*' as filter.
    Then, you should be able to get this temporary object into an .epa
    Import it in your target system, it should work fine.
    Best regards,
    VijayKalluri

  • URL.openConnection() odes not work

    I am trying to make a applet talk to a servlet.
    i am using the foll code snippet:
    URL url = new URL(TARGET_URL);
    URLConnection con = url.openConnection();
    con.setDoOutput(true);
    con.setDoInput(true);
    OutputStream out = con.getOutputStream();
    out.writeObject(obj);
    out.flush();
    out.close();
    I am not getting any error msg. However, i find the servlet is not invoked properly. I am nt getting the SOP printed on the weblogic server console.
    If i try opening the servlet thru the applet in a new browser window, it works fine.
    wht could the problem be?

    You need to access the input stream
    otherwise the data from the output stream
    is not send to the server.

  • URL.openConnection() returns depcreated class

    I'm using jdk1.4.1 and am finding that in the following case:
    URL aURL = new URL("https://www.verisign.com");
    URLConnection urlConn = aURL.openConnection();
    if (urlConn instanceof com.sun.net.ssl.HttpsURLConnection) {
    System.out.println("*** openConnection returns an instanceof com.sun.net.ssl.HttpsURLConnection");
    if (urlConn instanceof javax.net.ssl.HttpsURLConnection) {
    System.out.println("*** openConnection returns an instanceof javax.net.ssl.HttpsURLConnection");
    if (urlConn instanceof HttpURLConnection) {
    System.out.println("*** openConnection returns an instnace of HttpURLConnection");
    My output is:
    *** openConnection returns an instanceof com.sun.net.ssl.HttpsURLConnection
    *** openConnection returns an instnace of HttpURLConnection
    Doesn't that seem like a mistake? Why is URL.openConnection() returning a deprecated class?
    What do I need to do to be able to get an HttpsURLConnection?

    I found the answer to this problem on another post:
    http://forum.java.sun.com/thread.jsp?thread=196586&forum=2&message=648727

  • Url.openConnection with PROXY

    How can I do a url.openConnection through a proxy WITHOUT CHANGING THE SYSTEM PARAMETERS ??

    You can build the HttpURLConnection as follows
    HttpURLConnection url = new sun.net.www.protocol.http.HttpURLConnection(url,  hostname, port);http://www.sourcebot.com/sourcebot/decompile.cgi?url=http://www.sourcebot.com/sourcebot/sun/net/www/protocol/http/HttpURLConnection.class

  • Http URL.openConnection() - URLConnection, not HttpURLConnection

    Is there any way of calling openConnection on an http URL object, and not getting a HttpURLConnection?
    HttpURLConnection extends the URLConnection class in frequently-useful ways, for example by defaulting the Accept and Content-Type headers on requests (plus the frequently baffling getOutputStream/getErrorStream behaviour). However in some contexts, these extensions are profoundly unhelpful.
    In particular, if I'm writing test code, I want to be able to make HTTP requests with missing Content-Type or Accept headers -- that is, without the default values which HttpURLConnection adds -- and there appears to be no way to do that, short of writing my own HTTP protocol handler.
    Failing that, is there any way of deleting request headers from a HttpURLConnection? The obvious connect.setRequestProperty("header", null) doesn't do it (and isn't documented to).
    Best wishes,
    Norman

    Thanks for that. The apache.commons.net classes look useful, but I think they end up being a little too low-level. The URLConnection class does usefully abstract the boring details of the HTTP transaction -- the only problem is that HttpURLConnection tries a little too hard.
    I think my question really boils down to the following: is there a way of switching off the extra functionality/defaults in HttpURLConnection? (if so, it's insufficiently clearly documented).
    I remember submitting an RFE to this effect a while ago, but can't find the entry in the bugs database (I apparently can't search for 'submitter').

  • Font finder URL is broken for searching

    https://www.adobe.com/type/fontfinder/
    The above link has 404 not found error when I try to search for Frutiger in face.
    Where is the Webmaster for adobe.com? I can't find the right form or email address to post this error.

    Click on the letter "F" under the Search field at that URL and you will find it.
    Search on the Adobe website has always been lame.

  • URL recognizer broken in 10.1.2?

    Hi all,
    During initialization i try to bind an EditorAddin to a Node (see code).
    The binding works fine for the TextNode, but when i extend TextNode or use DeployableTextNode the binding fails (without any error). The editor just doesn't show up.
    In 9.0.5.2 the binding works fine!
    Does someone have any idea?
    Thanks in advance,
    Jeroen van Schaijk
    I used the following code which works fine for TextNode:
    EditorAddin editor = (EditorAddin)AddinManager.getInstance().getAddin(DocEditorAddin.class);
    URLRecognizer.mapExtensionToClass( ".foo", TextNode.class );
    EditorManager eMgr = EditorManager.getEditorManager();
    eMgr.extend( editor, new Class[] {TextNode.class} );

    I found out that you have to remove the file from the project and reopen it again to change the binding.
    It seems that the binding info is persistent between IDE startups.

  • The URL is broken, can not load!

    I am trying to access my synology disk station on local net, like:
    192.168.1.101:5000
    and I got the above message, and nothing loads.
    The same happens if I try
    about:home
    And I get the same message when I try to switch to private browsing mode!
    It is strange for me, after an automatik update from version 7.x to 9.x

    You may need to enable that port.
    *http://www.mozilla.org/projects/netlib/PortBanning.html
    *http://kb.mozillazine.org/network.security.ports.banned.override

  • The great Oracle URL shuffle: are jdev extensions broken?

    I've been trying to install the JDev dynamic tab page template extension 1.02 today without much success. Right I thought, I'll download the extension manually and install it locally. But the extensions page is borked too, clicking the relevant link redirects to the JDev home page. So my question is, has the great Oracle URL reorg broken 1 or more of the downloadable extensions too?
    Or is it just me?!
    CM.

    It's just you.
    http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml (redirected from htmldb.oracle.com/pls/otn/f?p=updatecenter:uc) works... oh and then trying to download the actual extension - yeah, borked.
    [url http://www.google.com/webhp?hl=xx-bork]bork bork bork
    The great OTN reorg is really annoying!
    John

  • How to get the Response Code when a URL is launched from Web Dynpro

    Hello Experts,
    I have a Web Dynpro Application in which in one of its views i have an IFrame UI element in which i will show a resource stored somewhere ..
    But before showing it i want to check if the resource actually exists. For this i have to check the HTTP Response code from Web Dynpro Application without setting it in the Iframe..
    I am using the following code to get the Response Code:
    try{
    URL url = new URL("Some Url");
    HttpURLConnection.setFollowRedirects(false);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.connect();
    wdComponentAPI.getMessageManager().reportSuccess("Response code ="+connection.getResponseCode());
    }catch(Exception e){
    wdComponentAPI.getMessageManager().reportSuccess("Exception");
    Now the Problem is whatever response Code occurs 403 (for No Proper Authorization), 404 (for Resource not found) etc..
    i always get Response Code=  500 (which is for Internal Server Error) shown in the messgae i have printed.
    Please let me know the correct way of getting the Response Code from Web Dynpro.
    Also my resource is lying on a SAP Portal 6.4
    Best Regards
    Sundeep
    Edited by: Sundeep Sethi on Feb 18, 2008 9:07 AM
    Edited by: Sundeep Sethi on Feb 18, 2008 10:23 AM

    Hi,
      Check this code from /thread/5242768 [original link is broken] if it works.
    try{
    URL myurl = new URL("http://calendar.google.com");
    URLConnection connection = myurl.openConnection();
    if(connection instanceof HttpURLConnection) {
    HttpURLConnection httpConnection = (HttpURLConnection) connection;
    HttpURLConnection.setFollowRedirects(true);
    httpConnection.setRequestMethod("HEAD");
    httpConnection.connect();
    System.out.println("Response = "+httpConnection.getResponseCode());
    catch(Exception e) {
    // print exception
    Regards,
    Harini S

  • IOException  :server returned http response code:505 for url url

    hi,
    my program creates IOException server returned http response code:505 for url <some url>
    I close the i/p stream.I dont know ,where is the problem.plz let me know.Thanks in advance.
    Here is the code:
    public class CallApplicationURL
    private static final String className = "[CallApplicationURL] ";
    private MailAlert ma = new MailAlert();
    public String callURL(String purl, RequestObject ro, Debug log)
         URL url = null;
         String URLResponse = "No response from Provider";
         ProxySetter ps = new ProxySetter();
         try
              ps.setProxy(ro, log);
              url = new URL (purl);
         catch (Exception e)
         URLResponse = className+"Exception while URL assignment \n"+purl+"\n, Exception is "+e;
         return (URLResponse);
         try
         HttpURLConnection h = (HttpURLConnection) url.openConnection();
         h.connect();
         BufferedReader br = new BufferedReader( new InputStreamReader( h.getInputStream() ) );
         URLResponse = br.readLine();
         br.close();
         catch (Exception e)
              URLResponse = className+"Exception while calling URL "+purl+", Exception is "+e;
         return (URLResponse);
         return (URLResponse);
    }

    http response 505: http://libraries.ucsd.edu/about/tools/http-response-codes.html
    This would indicate nothing is wrong with your applet but with your http server (not supporting http 1.1??)
    A full trace might help:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    When you catch the exception you should print the stacktrace: (e.printStackTrace()).

  • Speed up the URL and Time out

    I have a database of links I use a statment to read of them pass them to a URL and read the site to extract links from there, if it the URL is broken it takes me 10 minutes to go to the next one, I have 200 odd links any help as to speed this up...
    it took me a day to finish up the lins

    hey Spieler you said
    You could use multiple threads. This way you can still
    work on url's while one or the other thread is waiting
    for a respons
    regards
    Spielerhow do I go about that.
    can you mail me an answer
    I use
    Statment stmt = con.createStatment("SELECT * FROM LinkTable");
    ResultSet rs = stmt.executeQuery();
    while(rs.next())
    String str = rs.getString(2);
    URLConnection conn = new URL(str).openConnection();
    Reader rd = new InputStreamReader(conn.getInputStream());
    EditorKit kit = new HTMLEditorKit();
    Document doc = kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    // Parse the HTML.
    kit.read(rd, doc, 0);
    // Iterate through the elements of the HTML document.
    ElementIterator it = new ElementIterator(doc);
    javax.swing.text.Element elem;
    while ((elem = it.next()) != null)
         int cnt = 0;
         st1 = new String();
                                  SimpleAttributeSet s = (SimpleAttributeSet)elem.getAttributes().getAttribute(HTML.Tag.A);
    if (s != null)
    st1 = s.getAttribute(HTML.Attribute.HREF).toString();
    System.out.println(st1);

Maybe you are looking for

  • ITunes code not working

    I received a large amount in an iTunes card this Christmas, it looked to have been purchased from Apple online then the whole card thing printed. It has two codes on it one that says "PIN" and one that says "Gift card number" I have tried entering th

  • In Safari 7.0.3, how do I get website ICONS to show up in the bookmark favorites toolbar?

    RE:  Bookmarks/Website Icons in Favorites Bar In Safari 7.0.3, does anyone  know how to get website ICONS to show up in the bookmark favorites toolbar? Blue dots with the website name in text show up in the favorites bar. The website icons do show up

  • Discount not carried as promised

    I originally signed up for BT Infinity 20gb with a -£15.00 per month discount for the first six months. I decided to upgrade to BT Infinity Unlimited. The BT website says the following: (http://bt.custhelp.com/app/answers/detail/a_id/36397/~/what-hap

  • Trusted ca keystore

    Using WebLogic Portal 7.0 on Solaris 8. I have installed the Portal Login Framework per the instructions for mutual authentication. One of the steps says that if using Portal 7.0 to add the trusted ca root certificates to the keystore as described in

  • Backups/Archivelogs triggered via DB13 hitting errors at TSM(Tivoli) level.

    We are encountering problem with our redolog/online backups that are triggered via DB13 whereby we will receive this error message in the logs before a failure message: BKI5014E: Tivoli Storage Manager Error: ANS1087E (RC106) Access to the specified