Skip to main content

AccessControlException using JXTable

4 replies [Last post]
grlea
Offline
Joined: 2004-05-26

Hey all.

I'm using a JXTable in an unsigned WebStart application (Log Summariser).

I have had some Mac users complaining that the application won't launch on their machines.

Erik Vickroy has been kind enough to do some digging into it for me, and managed to produce the following stack trace on a Windows XP machine (though I've never reproduced it myself).

Any insight into the cause of the problem or any possible solutions would be greatly appreciated. I wouldn't have thought that WebStart would disallow the use of getDecalredField(), although Erik is pretty certain it does, but perhaps it is only blocking this for classes in the boot classpath.

At any rate, JXTable throws this exception in some WebStart deployments and not on others. Please comment if you can!

Thanks,

Graham.

<br />
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)<br />
   at java.security.AccessControlContext.checkPermission(Unknown Source)<br />
   at java.security.AccessController.checkPermission(Unknown Source)<br />
   at java.lang.SecurityManager.checkPermission(Unknown Source)<br />
   at java.lang.SecurityManager.checkMemberAccess(Unknown Source)<br />
   at java.lang.Class.checkMemberAccess(Unknown Source)<br />
   at java.lang.Class.getDeclaredField(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.getRowModelField(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.getSuperRowModel(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.updateSelectionAndRowModel(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.tableChanged(Unknown Source)<br />
   at javax.swing.JTable.setModel(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.setModel(Unknown Source)<br />
   at javax.swing.JTable.(Unknown Source)<br />
   at javax.swing.JTable.(Unknown Source)<br />
   at org.jdesktop.swingx.JXTable.(Unknown Source)<br />
   at org.grlea.logSummariser.gui.components.CountTable.(Unknown Source)<br />
   at org.grlea.logSummariser.gui.components.CountTable.(Unknown Source)<br />
   at org.grlea.logSummariser.gui.factories.HitCounterComponentFactory.createTable(Unknown Source)<br />
   at org.grlea.logSummariser.gui.factories.AbstractHitCounterComponentFactory.createComponent(Unknown Source)<br />
   at org.grlea.logSummariser.gui.factories.AbstractHitCounterComponentFactory.createComponent(Unknown Source)<br />
   at org.grlea.logSummariser.HitCounter.getComponent(Unknown Source)<br />
   at org.grlea.logSummariser.gui.components.LogAnalystPanel.(Unknown Source)<br />
   at org.grlea.logSummariser.gui.LogSummariserResultsFrame.(Unknown Source)<br />
   at org.grlea.logSummariser.gui.LogSummariserGui.(Unknown Source)<br />
   at org.grlea.logSummariser.javanet.AccessLogSummariserGui.(Unknown Source)<br />
   at org.grlea.logSummariser.javanet.AccessLogSummariserGui$1.run(Unknown Source)<br />
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)<br />
   at java.awt.EventQueue.dispatchEvent(Unknown Source)<br />
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)<br />
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)<br />
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)<br />
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)<br />
   at java.awt.EventDispatchThread.run(Unknown Source)<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kleopatra

Graham,

just an afterthought: which table version do you have? The stacktrace
looks supiciously like the one reported in #164-swingx (and some forum
threads around that time - which links are most probable broken), which
was fixed and I can't find any obvious regression ... the bailing code
sections normally are not touched.

So let#s compare versions before I dig into it -

the current
* $Id: JXTable.java,v 1.101 2006/01/25 16:45:18 kleopatra Exp $

the one where the old should have been fixed, is 1.71

Cheers
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

grlea
Offline
Joined: 2004-05-26

> just an afterthought: which table version do you
> have? The stacktrace
> looks supiciously like the one reported in
> #164-swingx (and some forum
> threads around that time - which links are most
> probable broken), which
> was fixed and I can't find any obvious regression ...
> the bailing code
> sections normally are not touched.

The version Erik will have been running is 1.55.

Erik has an interesting theory on the cause, which is that it is the printing of the stack trace that is causing the failure (on Mac OSX only), not the original AccessControlException that you are catching. This being the case, upgrading JXTable may be the solution, because the stack trace is no longer printed but instead a log message is recorded (without the exception).

I'll try upgrading and see how Erik goes with it.

Thanks again,

Graham.

grlea
Offline
Joined: 2004-05-26

Yep. Upgrading SwingX, to a version of JXTable that doesn't print the stack trace, has fixed the problem.

Kleopatra

Hi Graham,

Some background: JXTable is doing something incredibly dirty in trying
to access one of super's private fields via reflection (to enable
individual rowHeights). So we expect an exception to be thrown in this case.

But: this dirty behaviour must be explicitly enabled by
setRowHeightEnabled(), this method checks for the permission to do so
which might throw the exception which is caught and property stays
disabled. This should not show up anywhere (except in a log). The
exception should nver be triggered in a "normal" run (that is without
trying to enable individual rowheights) and definitely must not prevent
an application to start up. (so many "shoulds" and "must nots" are
always a bad sign :-)

Hmmm, this used to behave correctly (there's a closed bug related to it,
dont have the number ready) but - lately I fixed a virulent update issue
"near" it, maybe I was sloppy and introduced a regression. Will check as
soon as possible and come back to you!

Thanks
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net