Applet is not able to call a URL

Discussion in 'Java' started by alexa.smith@gmx.net, Mar 7, 2008.

  1. Guest

    Hello!

    I try to make a HTTP Connection through a Applet. The Url is inside
    the same CodeBase.

    Error message: java.net.UnknownHostException: https://www.unserserver.de


    HttpMethod method = null;

    try {
    URL url = new URL(sUrl);

    HostConfiguration hostConfig = new HostConfiguration();
    hostConfig.setHost(url.getHost(), url.getPort(), url.getProtocol());

    HttpClientParams httpClientParams = new HttpClientParams();
    HttpClient httpClient = new HttpClient();
    httpClient.setHostConfiguration(hostConfig);
    httpClient.setParams(httpClientParams);

    method = new GetMethod();
    method.setQueryString(url.getQuery());
    method.setPath(url.getPath());

    int resultCode = httpClient.executeMethod(method);


    } catch (Exception e) {
    System.out.println(e);
    }


    I have configured the JVM to use the default settings of the browser,
    to connect through the proxy.
    Without proxy on my own workstation it works, but for the customer it
    doesn't work, allthough he saids, that he has configured the same
    settings for the JVM.

    Any ideas?

    best regards
    Alexa
     
    , Mar 7, 2008
    #1
    1. Advertising

  2. Roedy Green Guest

    On Fri, 7 Mar 2008 05:26:22 -0800 (PST), wrote,
    quoted or indirectly quoted someone who said :

    >I try to make a HTTP Connection through a Applet. The Url is inside
    >the same CodeBase.


    you can only do that through a SIGNED applet.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Mar 7, 2008
    #2
    1. Advertising

  3. Arne Vajhøj Guest

    wrote:
    > I try to make a HTTP Connection through a Applet. The Url is inside
    > the same CodeBase.
    >
    > Error message: java.net.UnknownHostException: https://www.unserserver.de


    The error message indicates that the DNS server used can not
    resolve the name www.unserserver.de !

    Arne
     
    Arne Vajhøj, Mar 8, 2008
    #3
  4. Arne Vajhøj Guest

    Roedy Green wrote:
    > On Fri, 7 Mar 2008 05:26:22 -0800 (PST), wrote,
    > quoted or indirectly quoted someone who said :
    >> I try to make a HTTP Connection through a Applet. The Url is inside
    >> the same CodeBase.

    >
    > you can only do that through a SIGNED applet.


    An unsigned applet can connect to the server it was fetched from.

    (I am not quite sure whether "The Url is inside the same CodeBase" means
    that but it could mean that)

    Arne
     
    Arne Vajhøj, Mar 8, 2008
    #4
  5. On Mar 7, 11:26 pm, wrote:
    ...
    > Error message:   java.net.UnknownHostException:
    > https://www.unserserver.de


    I am not surprised Java cannot find that URL.
    IE reports it as a 404 at this point in time.

    Are you *positive* the applet is coming from
    that codebase? What is the URL of the page
    that contains the applet?

    Note what Arne was saying. An (sandboxed) applet
    should have no problems fetching resources from it's
    own server or codebase, unless the server itself
    refuses to provide the resource.

    --
    Andrew T.
    PhySci.org
     
    Andrew Thompson, Mar 8, 2008
    #5
  6. Roedy Green Guest

    On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajhøj <>
    wrote, quoted or indirectly quoted someone who said :

    >An unsigned applet can connect to the server it was fetched from.


    Not quite. See http://mindprod.com/jgloss/applet.html

    There are some catches.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Mar 8, 2008
    #6
  7. On Mar 8, 11:32 pm, Roedy Green <>
    wrote:
    > On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajhøj <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    > >An unsigned applet can connect to the server it was fetched from.

    >
    > Not quite. Seehttp://mindprod.com/jgloss/applet.html
    >
    > There are some catches.


    There are a variety of errors in your understanding
    of access by sandboxed applets and JWS apps to files
    off their home server.

    I had been meaning to set up some tests to try and
    prove that to you, though past attempts to prove
    minor points using code turned out to take a lot
    longer, and be less effective, than I had
    anticipated - that somewhat discouraged me.

    --
    Andrew T.
    PhySci.org
     
    Andrew Thompson, Mar 8, 2008
    #7
  8. Arne Vajhøj Guest

    Roedy Green wrote:
    > On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajhøj <>
    > wrote, quoted or indirectly quoted someone who said :
    >> An unsigned applet can connect to the server it was fetched from.

    >
    > Not quite. See http://mindprod.com/jgloss/applet.html
    >
    > There are some catches.


    Actually you page says the same thing:

    #Unsigned Applets (without special permission to bypass security) are
    #not permitted to:
    #* talk to any server but the one you were loaded from.

    Arne
     
    Arne Vajhøj, Mar 10, 2008
    #8
  9. Guest

    On Mar 10, 3:21 am, Arne Vajhøj <> wrote:
    > Roedy Green wrote:
    > > On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajhøj <>
    > > wrote, quoted or indirectly quoted someone who said :
    > >> An unsigned applet can connect to the server it was fetched from.

    >
    > > Not quite. Seehttp://mindprod.com/jgloss/applet.html

    >
    > > There are some catches.

    >
    > Actually you page says the same thing:
    >
    > #Unsigned Applets (without special permission to bypass security) are
    > #not permitted to:
    > #* talk to any server but the one you were loaded from.
    >
    > Arne



    Many thanks to everybody!!!
    I have signed the applet and it will be deploeyd. Next Friday I give
    feedback if it was the solution.
    But I think this was the missing point.

    Alexa
     
    , Mar 11, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SGl0ZXNo?=
    Replies:
    1
    Views:
    451
    =?Utf-8?B?SGl0ZXNo?=
    Apr 22, 2005
  2. crazytazo
    Replies:
    3
    Views:
    1,293
    Daniel Pitts
    Oct 7, 2008
  3. sed_y
    Replies:
    0
    Views:
    1,062
    sed_y
    Feb 15, 2012
  4. danglesocket

    not able to access a URL with LWP::UserAgent.

    danglesocket, Sep 11, 2003, in forum: Perl Misc
    Replies:
    6
    Views:
    162
    danglesocket
    Sep 12, 2003
  5. Yohan N. Leder
    Replies:
    19
    Views:
    270
    Yohan N. Leder
    Jul 2, 2006
Loading...

Share This Page