Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet can't find JDOM classes, how to solve this?

 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm using JDOM to create XML file in an Applet class, but it seems that the
Applet can't find the JDOM classes. I searched the web and found that something has to do with the JDOM jar file, but couldn't find clear explanation. Can anyone help me to resolve this issue?

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your applet tag. It needs to have an archive attribute that points to the jar file, and the jar file needs to be publicly accessible - I'd put it in the same directory as the HTML/JSP file that contains the applet tag.

I'll move the topic to the Applet forum.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thanks.

the tag initially was like this:
<applet code="CApplet.class" width="500" height="200"></applet>

Then change it to:
<applet code="CApplet.class" Archive="jdom.jar" width="500" height="200">
</applet>

This jdom jar is the one i downloaded from the Internet and then imported it in the project libraries..

but the error is the same!

While searching the net, I found that i may have to import one jar file that will integrate the applet and the jdom, is that right? or I should create another jar file so whenever the jdom is imported in the applet, it will be imported from the java jdk jar files, not the jdom real one..

I don't think I got the idea clear, and there aren't many posts on the net about this issue.

Can anyone help me with this , and I'll appreciate that.

Thanks in advance for the Applet forum.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing you need to do with the jar file, nor do you need any other jar file.

The attribute is named archive, not Archive; you should fix that.

Where does the jar file live relative to your HTML file? You talk about "project libraries" - that makes me think you're using an IDE. That often doesn't work so well for running applets. Try running the HTML directly in the browser, and keep the jar file in that directory as well.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,

thanks. I changed the Attribute to "archive", but the error is the same. The jdom jar file resides in the home directory where the applet and the index file are both under webapps under apache under the root directory. I tried copying the jdom file into the same directory of the applet using the "sudo" command, but whenever there is changes in the eclipse, it disapears from there and can't make the link.

do you have any idea of what is going on there and how to solve this?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what Eclipse is doing, but if it's causing problems then I'd start by running the applet in the browser without Eclipse running at all.
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello..

the problem has been solved successfully

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic