?
Solved

applet connection refused exception

Posted on 2003-03-05
6
Medium Priority
?
636 Views
Last Modified: 2013-12-29
hi,

i've had this applet that worked perfectly for years.  until i changed JRE from 1.4.1_01 to 1.4.1_02.  the applet is AppletButton.class that can be gotten from the java site.  currently, it gets as far as showing a button on the web page which when clicked opens a frame in a new window.  and then it shows the error "Exception: Connection refused: connect"

searched the net but the hits i'm getting are pertaining to database connections.  no database is involved in my little app.

i'm using IE 5.5 on Windows 2000.  Tools-Advanced has the "Use Java 2v1.4.1_02 for <applet>(requires restart)" checkbox selected.  

the registry says that the CurrentVersion of JRE is 1.4. and HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment contains folders 1.4 and 1.4.1_02.  both folders have:

   JavaHome  = C:\Program Files\Java\j2re1.4.1_02
   RuntimLib = C:\Program Files\Java\j2re1.4.1_02\bin\client\jvm.dll

and those folders and files exist.  so i think the setup is okay.  i don't like mucking around in this windows registry and haven't tried removing the 1.4 folder and changing the CurrentVersion.  haven't had the need to do that before when updating JREs.

also tried it with Opera 7--the button does not even show up.

i've tried going back to j2re.1.4.1_01, that doesn't work anymore.  i'm not sure how to start fixing this.  would appreciate any pointer/direction.

thanks,
--meg
0
Comment
Question by:akeimou
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 8075423
can u post the stack trace for the exception.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 8075442
It sounds like you are trying to open a connection to a site other than the one the applet was loaded from (or at least the jre thinks so). Check the hostname you are using to connect is identical to the hostname of the url the applet was loaded from.

Maybe best to actually use the hostname from the codebase or document base:
String host = applet.getCodeBase().getHost();

0
 
LVL 92

Expert Comment

by:objects
ID: 8075452
If the problem is related to a problem with your JRE installation, then I would suggest removing all JRE's and reinstall 1.4.1_02.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:sct75
ID: 8075626
Couple of things you could consider:
1) I was told before that the JRE of 1.4.X might not work properly sometimes with IE 6 below, so first thing you might try is to update your IE version to latest IE, which is probably 6 Service Pack 1.

2) You don't have to muck around the Windows Registry. Instead, try to run the Applet with an Applet viewer or something like that in some IDEs, such as JBuilder. If it is visible without any problem, it would further prove that it was the browser plug-in problems.

3) When you switch around different version of JREs (i.e. from 1.3.X to 1.4.X), you might need to restart it in order for the browser to pick it up.

4) Better use the JRE 1.3.05, which I once tested to work most of my complicated Applet programs, even the ones written in Swing.
0
 

Author Comment

by:akeimou
ID: 8076044
oops!  i forgot about that one (embarrassed smiley here).

i had a static URL in there.  moved the app to a different server.  then the old server shut down.  just about the same time i upgraded my JRE.  i wouldn't have been able to find that for a long time as my focus was on the JRE.  thanks!

so it works in IE now.  still no go with Opera.  i think the problem there is my HTML code for the applet which is geared towards IE and Netscape only.  i don't know if Opera also needs special treatment but tomorrow's another day...
0
 
LVL 92

Expert Comment

by:objects
ID: 8076081
We all get caught up like that occasionally.
Good to hear your back on track.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question