?
Solved

cannot load XML data when using an applet

Posted on 2006-06-07
7
Medium Priority
?
221 Views
Last Modified: 2012-05-05
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  
0
Comment
Question by:waffe
  • 3
  • 3
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 240 total points
ID: 16858738
> 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
 

Author Comment

by:waffe
ID: 16858751
> [...] archive parameter of the applet tag

where is this?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:waffe
ID: 16858831
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
 
LVL 92

Expert Comment

by:objects
ID: 16859125
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16859504
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
 

Author Comment

by:waffe
ID: 16863638
Thanks all!

waffe
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

829 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