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
Roedy Green - 07 Mar 2008 23:37 GMT
>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
Arne Vajhøj - 08 Mar 2008 03:08 GMT
>> 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
Roedy Green - 08 Mar 2008 13:32 GMT
>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
Andrew Thompson - 08 Mar 2008 23:18 GMT
On Mar 8, 11:32 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> >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
Arne Vajhøj - 10 Mar 2008 03:21 GMT
>> 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
alexa.smith@gmx.net - 11 Mar 2008 10:22 GMT
> >> An unsigned applet can connect to the server it was fetched from.
>
[quoted text clipped - 9 lines]
>
> 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
Arne Vajhøj - 08 Mar 2008 03:07 GMT
> 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
Andrew Thompson - 08 Mar 2008 07:00 GMT
On Mar 7, 11:26 pm, alexa.sm...@gmx.net 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