Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet is not able to call a URL

Reply
Thread Tools

Applet is not able to call a URL

 
 
alexa.smith@gmx.net
Guest
Posts: n/a
 
      03-07-2008
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
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      03-07-2008
On Fri, 7 Mar 2008 05:26:22 -0800 (PST), http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      03-08-2008
(E-Mail Removed) 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
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      03-08-2008
Roedy Green wrote:
> On Fri, 7 Mar 2008 05:26:22 -0800 (PST), (E-Mail Removed) 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
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      03-08-2008
On Mar 7, 11:26*pm, (E-Mail Removed) 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
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-08-2008
On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajh°j <(E-Mail Removed)>
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
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      03-08-2008
On Mar 8, 11:32*pm, Roedy Green <(E-Mail Removed)>
wrote:
> On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajh°j <(E-Mail Removed)>
> 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
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      03-10-2008
Roedy Green wrote:
> On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajh°j <(E-Mail Removed)>
> 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
 
Reply With Quote
 
alexa.smith@gmx.net
Guest
Posts: n/a
 
      03-11-2008
On Mar 10, 3:21 am, Arne Vajh°j <(E-Mail Removed)> wrote:
> Roedy Green wrote:
> > On Fri, 07 Mar 2008 22:08:24 -0500, Arne Vajh°j <(E-Mail Removed)>
> > 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to display color in excel not able to display color in excel using xml sed_y XML 0 02-15-2012 09:46 PM
When Javascript call applet method, applet throw security exception. crazytazo Java 3 10-06-2008 11:12 PM
Not able to use spaces (or equivalent characters) in sitemapnode url jmorgret ASP .Net Web Controls 2 02-13-2008 10:22 PM
Does recursive call able to print in same page as main call Yohan N. Leder Perl Misc 19 07-02-2006 11:45 AM
not able to access a URL with LWP::UserAgent. danglesocket Perl Misc 6 09-12-2003 02:39 PM



Advertisments