cannot load XML data when using an applet

Hi,

I am using a JApplet in a browser and when doing so I am selecting a path to an .xml file and trying to load it into my program (this all works when the Java program is an application). Here is part of the error I am getting in the java Console:

selectedFilepillar2filePath= C:\Documents and Settings\main\My Documents\workspace\data\apology.xml
Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: proxml/XMLInOut
[...]

the proxml is a processing extension that deals with XML - for those of you who do not know my current situation, I am using a java based program (processing) along with Java to write my programs - I do not think the processing XML extension is the problem - it feels like permissions problem – I mean a JApplet can access a users hard drive right?

Any Ideas?

Thanks,

waffe  
waffeAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
> I mean a JApplet can access a users hard drive right?

By default no, you'll need to sign the applet.

> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: proxml/XMLInOut

though that suggests its not finding a class it needs.
make sure any jars it needs are specified in the archive parameter of the applet tag

0
 
waffeAuthor Commented:
> [...] archive parameter of the applet tag

where is this?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
waffeAuthor Commented:
Thanks objects, that about raps it up for me and what I need to do - Sign the Applet!

But shouldn't something like an ImageIcon be able to load an image that is in the jar file? This is not the local harddrive it is on the server in the jar? - Error in console: java.security.AccessControlException: access denied (java.io.FilePermission ../beginningBtn2.png read)

Will signing the applet solve this problem too?

Thanks,

waffe
0
 
objectsCommented:
yes it can load an image from a jar.
In which case you need to load it as a resource instead of a file

eg.  new ImageIcon(getClass().getResource("beginningBtn2.png"));
0
 
Mayank SAssociate Director - Product EngineeringCommented:
If you specify the path as a file, it might try to search for it in the hard-drive.

Read about signing here: http://www.mindprod.com/jgloss/signedapplets.html
0
 
waffeAuthor Commented:
Thanks all!

waffe
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.