File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applet works fine in my Eclipse IDE,  but doesn't work outside of Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet works fine in my Eclipse IDE,  but doesn Watch "Applet works fine in my Eclipse IDE,  but doesn New topic
Author

Applet works fine in my Eclipse IDE, but doesn't work outside of Eclipse

michael turner
Greenhorn

Joined: Oct 28, 2003
Posts: 23
Reviewers:

1. I am working on a Graphing applet developed by modifying code from the prefuse visualization toolkit (http://www.prefuse.org/). The primary issue is: "The Applet works fine in my Eclipse IDE, but doesn't work outside of Eclipse". Without Posting code, Consistent errors received are: "load: class GraphViewApplet not found. Caused by: java.io.IOException: open HTTP connection failed" This indicates The Class loader cannot find the applicable class. I read through the various postings in this Forum and other pertinent Forums in an effort to gain insight into problem resolution.

2. Through Analysis, I believe the solution is to generate a "Signed Applet", and perhaps tweak some security settings. The Applet does not have a "main()" function ... It is not a stand alone Application. The functions "init(), Stop(), Destroy(). are present. When I generate and test a jar file, a consistent Error received is "Cannot Find main program" .

3. I reviewed several postings on Manifest Files. I am looking for example(s) of Generating a manifest for Applet Classes, that do not have a "Main Class" function. I say this because an entry in a Manifest requires:

Main-Class: "The Main Class"

And the applet Under development does not have a Main.


Can anyone assist me in this matter???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41816
    
  62
Consistent errors received are: "load: class GraphViewApplet not found. Caused by: java.io.IOException: open HTTP connection failed" This indicates The Class loader cannot find the applicable class.

What does the applet tag in the HTML look like? How is the server directory organized - is the applet jar file in the same directory as the HTML file?

2. Through Analysis, I believe the solution is to generate a "Signed Applet", and perhaps tweak some security settings. The Applet does not have a "main()" function ... It is not a stand alone Application. The functions "init(), Stop(), Destroy(). are present. When I generate and test a jar file, a consistent Error received is "Cannot Find main program" .

Signing the applet has nothing to do with this; you shouldn't need to do this (unless there are other requirements that you haven't mentioned). How are you testing the jar file = using appletviewer? That would still require an HTMl file containing an applet tag.

3. I reviewed several postings on Manifest Files. I am looking for example(s) of Generating a manifest for Applet Classes, that do not have a "Main Class" function. I say this because an entry in a Manifest requires:

Main-Class: "The Main Class"

And the applet Under development does not have a Main.

Manifest files are used for applications, not applets. You don't need one.


Ping & DNS - my free Android networking tools app
michael turner
Greenhorn

Joined: Oct 28, 2003
Posts: 23
OK...

Lets try this Again.
a. "What does the applet tag in the HTML look like? How is the server directory organized - is the applet jar file in the same directory as the HTML file?"

RESPONSE: Not Germane to the Issue. I am aware of the necessary Applet configuration and did not Include Code ...BECAUSE it would DISTRACT from the inquiry.

b. "Signing the applet has nothing to do with this; you shouldn't need to do this (unless there are other requirements that you haven't mentioned). How are you testing the jar file = using appletviewer? That would still require an HTMl file containing an applet tag."

RESPONSE: Signing the Applet has a LOT to do with it. Yes, there are other requirements that were not Discussed (Not Germane to the question). I am testing by attempting to Open the Jar in Internet Explorer .... A technique that was Advised in other Forums.

"Manifest files are used for applications, not applets. You don't need one."

RESPONSE: I am putting the applet in A "Jar file" For Execution, which is highly recommended in other FORUMS .... Guess what? A Manifest is REQUIRED.

Thanks for the Help (OR lack thereOf)


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41816
    
  62
a. "What does the applet tag in the HTML look like? How is the server directory organized - is the applet jar file in the same directory as the HTML file?"

RESPONSE: Not Germane to the Issue. I am aware of the necessary Applet configuration and did not Include Code ...BECAUSE it would DISTRACT from the inquiry.

If the class loader can't find the class, then there is a certain likelihood that the details of the applet tag are the issue - so it is very much germane to the issue.

b. "Signing the applet has nothing to do with this; you shouldn't need to do this (unless there are other requirements that you haven't mentioned). How are you testing the jar file = using appletviewer? That would still require an HTMl file containing an applet tag."

RESPONSE: Signing the Applet has a LOT to do with it. Yes, there are other requirements that were not Discussed (Not Germane to the question). I am testing by attempting to Open the Jar in Internet Explorer .... A technique that was Advised in other Forums.

Then you should let us know WHY signing the applet has anything to do with it. If the class loader can't find a class -which is what the original post says- then it doesn't matter whether it's signed or not. That is checked AFTER the class has been found.

Opening the applet jar file with the browser will definitely not work, regardless of where it is advised. It may work for applications (not in all browsers, though), but not, as you've found out, for applets.

"Manifest files are used for applications, not applets. You don't need one."

RESPONSE: I am putting the applet in A "Jar file" For Execution, which is highly recommended in other FORUMS .... Guess what? A Manifest is REQUIRED.

Please re-read my post. I didn't advise against using a jar file -using one is advantageous- but said that manifests aren't required (which indeed they're not). I'd question anything that says otherwise.

Thanks for the Help (OR lack thereOf)

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet works fine in my Eclipse IDE, but doesn't work outside of Eclipse