Home arrow static arrow Java Programming [Archive] - Java Applet and IIS
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Java Applet and IIS
This topic has 8 replies on 1 page.

Posts:5
Registered: 7/30/04
Java Applet and IIS  
Aug 4, 2004 1:51 AM



 
Hi,

I have created an applet code. The code is normally working fine without IIS.
I have IIS 5.0 installed on my Windows 2000 Server. My web site home directory is "C:\Inetpub\wwwroot". I already coppied the files to the correct folder. In the address box of Internet Explorer, I typed "http://localhost:8080/myfile.html". My web site is working on port 8080. Adn myfile.html is to run my applet. But when I go to the page I got the error message saying that "Connection refused: connect".

But, if I copy the code to my Windows XP pro machine with IIS 5.1 installed, it works fine.

Can anyone give me some idea or any dvise?
Your advise will be much appreciated.

Thanks,

Roda
 

Posts:14,142
Registered: 99-04-02
Re: Java Applet and IIS  
Aug 4, 2004 7:23 AM (reply 1 of 8)



 
sounds like an IIS problem, not a Java problem
 

Posts:5
Registered: 7/30/04
Re: Java Applet and IIS  
Aug 4, 2004 10:22 PM (reply 2 of 8)



 
Yes! Now, I have found that my code is working fine with IIS on standard http port, 80. But I have another servcie running on port 80. That's why I use port 8080 for my IIS instead. And my code never works with IIS port 8080. The applet show the message saying that "Connection refused: connect".

Any idea or advise? please.

Thanks in advance.

========================
Roda
 

Posts:14,142
Registered: 99-04-02
Re: Java Applet and IIS  
Aug 5, 2004 8:40 AM (reply 3 of 8)



 
are you trying to use URLs in the applet that aren't specifying the port?
 

Posts:3,534
Registered: 9/30/99
Re: Java Applet and IIS  
Aug 5, 2004 9:36 AM (reply 4 of 8)



 
"http://localhost/myfile.html:8080".
"http://localhost:8080, myfile.html".

I run my IIS on 8080 also, but have not used it for 6 months now. I've been using Apache, but if I remember correctly of of these works. If not look it up at the MS site, your connection string is not right to start with.
 

Posts:5
Registered: 7/30/04
Re: Java Applet and IIS  
Aug 5, 2004 9:57 AM (reply 5 of 8)



 
Yes, I've found that I am trying to use URL constructor without specifying the port. So, I've just added port 8080 to my URL constructor and it is working now.

Here is my correct line of code.

URL logfileURL1 = new URL(documentBase.getProtocol(), documentBase.getHost(), path + "/Total.log");


Now, my problem is fixed.

Thand you for your help, bsampieri and morgalr. Your help is much appreciated.

Kind regards,

================
Roda
 

Posts:5
Registered: 7/30/04
Re: Java Applet and IIS  
Aug 5, 2004 9:59 AM (reply 6 of 8)



 
Sorry, here is the correct line of code.

URL logfileURL1 = new URL(documentBase.getProtocol(), documentBase.getHost(), 8080, path + "/Total.log");
 

Posts:14,142
Registered: 99-04-02
Re: Java Applet and IIS  
Aug 5, 2004 4:42 PM (reply 7 of 8)



 
you should be able to just do this:

URL log = new URL(getDocumentBase(), path+"/Total.log");

unless your documentBase is different from what the applet's getDocumentBase() method returns
 

Posts:5
Registered: 7/30/04
Re: Java Applet and IIS  
Aug 5, 2004 9:55 PM (reply 8 of 8)



 
Yes, that's great. The following code is also working.

URL log = new URL(getDocumentBase(), path+"/Total.log");


Thanks

==============
Roda
 
This topic has 8 replies on 1 page.