Skip to main content

Re: [JAVAHELP] file permission error

No replies
Anonymous

>Hi,
>Im trying to use javahelp to deliver help through an applet on a webpage.
Using the call to >HelpSet.findHelpSet to get the URL to the helpset
returns null. Constructing the URL >manually results in a file permission
access denied exception.
>Im running the webserver and the applet on the same machine so I have put
the helpset.jar >file in the JVM classpath using the control panel and I
have also added the helpset.jar file >to the archive tag of the webpage,
neither of which fix the problem.
>The same code which points to the same helpset works correctly from a
standalone program.
>
>I am new to both applet programming and to javahelp so it may be some
really basic thing >that I am missing. Any suggestions?
>
>Thanks

Are you using jh2.0_01? If so, have you defined a Favorites view in the
helpset?
The favorites.xml file that is written to the users HOME directory is
outside Java's "sandbox" and hence causes a security access error. See the
Java Console dump when you activate the applet:

Parsing failed for null
Exception caught while parsing
nulljava.security.AccessControlException: access denied
(java.io.FilePermission C:\Documents and
Settings\ChrisM\.JavaHelp\Favorites.xml read)
Exception occurred during event dispatching:
java.lang.NullPointerException
at
javax.help.plaf.basic.BasicFavoritesNavigatorUI.reloadData(BasicFavoritesNavigatorUI.java:288)
at
javax.help.plaf.basic.BasicFavoritesNavigatorUI.installUI(BasicFavoritesNavigatorUI.java:226)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.help.JHelpNavigator.setUI(JHelpNavigator.java:249)
at javax.help.JHelpNavigator.updateUI(JHelpNavigator.java:268)
at javax.help.JHelpNavigator.(JHelpNavigator.java:97)
at
javax.help.JHelpFavoritesNavigator.(JHelpFavoritesNavigator.java:55)
at javax.help.FavoritesView.createNavigator(FavoritesView.java:105)
at javax.help.JHelp.setupNavigators(JHelp.java:140)
at javax.help.JHelp.(JHelp.java:118)
at
javax.help.WindowPresentation.createJHelp(WindowPresentation.java:672)
at
javax.help.WindowPresentation.createHelpWindow(WindowPresentation.java:705)
at
javax.help.WindowPresentation.setDisplayed(WindowPresentation.java:336)
at
javax.help.DefaultHelpBroker.setDisplayed(DefaultHelpBroker.java:178)
at sunw.demo.browser.HelpButton.actionPerformed(HelpButton.java:92)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I've not yet managed to find a way of granting security permissions to this
file and hence I have resorted to removing the Favorites Veiw from the
helpset.

====================================================
Chris Morris
Technical Author
SAA Consultants Ltd
http://www.saaconsultants.com
http://www.reims.net
====================================================

javahelp1@JAVADESKTOP
.ORG To: JAVAHELP-INTEREST@JAVA.SUN.COM
Sent by: Discussion cc:
list of JavaHelp Subject: [JAVAHELP] file permission error

06/02/2004 06:38
Please respond to
javahelp-interest

Hi,
Im trying to use javahelp to deliver help through an applet on a webpage.
Using the call to HelpSet.findHelpSet to get the URL to the helpset returns
null. Constructing the URL manually results in a file permission access
denied exception.
Im running the webserver and the applet on the same machine so I have put
the helpset.jar file in the JVM classpath using the control panel and I
have also added the helpset.jar file to the archive tag of the webpage,
neither of which fix the problem.
The same code which points to the same helpset works correctly from a
standalone program.

I am new to both applet programming and to javahelp so it may be some
really basic thing that I am missing. Any suggestions?

Thanks

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at
http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.