473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Applet Issue

3
I created an applet that i want to post on my site. I wrote it and compiled it and it works fine on my computer. But when I upload it to my server, I keep getting this error and I am not sure what I need to do to fix it. Can anyone help me?!?!



Java Plug-in 1.6.0_10-ea
Using JRE version 1.6.0_10-ea Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Me

java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unkn own Source)
at java.lang.System.getProperty(Unknown Source)
at java.io.Win32FileSystem.getUserPath(Unknown Source)
at java.io.Win32FileSystem.resolve(Unknown Source)
at java.io.File.getAbsolutePath(Unknown Source)
at javax.swing.filechooser.WindowsFileSystemView.isFl oppyDrive(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI$BasicFil eView.getIcon(Unknown Source)
at javax.swing.JFileChooser.getIcon(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI$Director yComboBoxRenderer.getListCellRendererComponent(Unk nown Source)
at javax.swing.plaf.basic.BasicListUI.updateLayoutSta te(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayo utState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI$Handler.valueCh anged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelect ion(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelect ion(Unknown Source)
at javax.swing.DefaultListSelectionModel.setSelection Interval(Unknown Source)
at javax.swing.JList.setSelectedIndex(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.setListSele ction(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.access$300( Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.ite mStateChanged(Unknown Source)
at javax.swing.JComboBox.fireItemStateChanged(Unknown Source)
at javax.swing.JComboBox.selectedItemChanged(Unknown Source)
at javax.swing.JComboBox.contentsChanged(Unknown Source)
at javax.swing.AbstractListModel.fireContentsChanged( Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI$Director yComboBoxModel.setSelectedItem(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI$Director yComboBoxModel.addItem(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI$Director yComboBoxModel.access$900(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.doDirect oryChanged(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.access$1 200(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI$5.proper tyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChang e(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChang e(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at javax.swing.JFileChooser.setCurrentDirectory(Unkno wn Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at fUpload.<init>(fUpload.java:25)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Jan 6 '08 #1
2 1726
chaarmann
785 Expert 512MB
An applet runs on the client, not on the server. It runs inside a Sandbox of the browser (in opposition to an "application"), so it should NEVER have the rights to access local directories on the client!
So it is fully normal that you get an "security exception" when you try to access a directory. It would be very bad if you can actually do it. You said, it runs on your PC, then your PC is open for all Hackers; everybody can send you an hidden applet in a webpage now and read all your passwords and online-banking details etc. that are stored on your PC. So I would advise you to put back the original security settings of your browser as fast as possible! And don't lower the security of your server, only to "get the program running". Think of alternative methods to handle files (upload etc.) or read additional data (Ajax).
Jan 6 '08 #2
BigDaddyLH
1,216 Expert 1GB
I agree with everything chaarmann said. If you want some help, you need to tell us about your program. So far, you have only shown what goes wrong. We have no idea what your program is meant to do, what your goal is.

My rule of thumb is to never write applets. Not everyone is so anti-applet, but to me the time of the applet has come and gone, if it was ever here. If you really want to write a Swing GUI, I would suggest writing a normal desktop application. But as I just wrote, I don't know what you are trying to do.
Jan 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Paul | last post by:
Hello, I've been reading up on security in Java Applets and whilst I understand the concept, I can't successfully get my applet to read a file on my local machine. I discovered from...
1
by: WMMorgan | last post by:
There's a website I like to visit that has an user-interactive java application. There's a "visual applet" component and "control applet" component. (No, it's not an adult or porno site.) But...
1
by: nathanlaan | last post by:
This is the stupidest thing I have ever seen. Java 1.2, 1.3, and 1.4.1, and 1.4.2 all define the Applet.getDocumentBase() method differently! How am I supposed to get the directory of the document...
4
by: Warrick Wilson | last post by:
I've got a web page that uses frames. One of the frames loads an HTML page that redirects to a 3rd HTML page. This third page loads a Java applet - ProScroll.class - that runs a "news ticker"...
5
by: Rowland | last post by:
Hi, I know this question has prob. been asked a million times, but I couldn't find it in the FAQ, so here goes : I'm trying to write a Java applet to call a dll that resides on the web server...
2
by: SPG | last post by:
Hi, We have an applet which is not loading on some systems. We suspect it is a security issue, but cannot be sure as of yet. Is there any way of programatically trapping the failure so we can...
2
by: Julian Hayward | last post by:
I recently "inherited" a project which involves an applet on a web page, and some Javascript event handling functions. The handler definition looks like this: <SCRIPT LANGUAGE=javascript...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
13
by: fullofbeans | last post by:
This is one of my web sites. http://www.metcalfeps.ocdsb.ca/ I can't get the applet to load. It's a picture of the school and has a ripple effect. I have www.java.com listed in the security...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.