JXList throws AccessControlException in webstartable

View: New views
8 Messages — Rating Filter:   Alert me  

JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

just noticed: running an experimental (uncomplete) webstartable of the demos at

https://swinglabs-demos.dev.java.net/demos/swingxset6/swingxset.jnlp

and one of the demos in functionality I get a longish stack trace (most is some logging I don't quite know where it comes from, need to check) which starts with:

[code]
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.swing)
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at org.jdesktop.swingx.plaf.basic.core.BasicXListUI.getInputMap(BasicXListUI.java:851)
        at org.jdesktop.swingx.plaf.basic.core.BasicXListUI.installKeyboardActions(BasicXListUI.java:840)
        at org.jdesktop.swingx.plaf.basic.core.BasicXListUI.installUI(BasicXListUI.java:1078)
        at javax.swing.JComponent.setUI(Unknown Source)
        at javax.swing.JList.setUI(Unknown Source)
        at org.jdesktop.swingx.JXList.updateUI(JXList.java:1465)
        at javax.swing.JList.<init>(Unknown Source)
        at javax.swing.JList.<init>(Unknown Source)
        at org.jdesktop.swingx.JXList.<init>(JXList.java:291)
        at org.jdesktop.swingx.JXList.<init>(JXList.java:243)
        at org.jdesktop.swingx.demo.search.SearchDemo.initComponents(SearchDemo.java:228)

[/code]

looks like access to the sun packages is not allowed. BasicXListUI is a modified copy of BasicListUI, the barking line 851 tries to access sun.swing.DefaultLookup. While I could hack around this - change to use/lookup UIManager instead - a more serious problem is the use of sun.swing.SynthUI in SynthXListUI: no idea of how not to use it and still make the style lookup work as expected.

Comments, please?

Thanks
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367275

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
>  a longish
> stack trace (most is some logging I don't quite know
> where it comes from, need to check)

nothing goes over animated error logging <g>

[code]
Problem invoking method public void com.sun.swingset3.DemoPanel$LoadAnimationPanel.setTriState(int)
in object com.sun.swingset3.DemoPanel$LoadAnimationPanel[....] in setValue
java.lang.IllegalAccessException: Class org.jdesktop.animation.timing.interpolation.PropertySetter can not
access a member of class com.sun.swingset3.DemoPanel$LoadAnimationPanel with modifiers "public"
Problem invoking method public void com.sun.swingset3.DemoPanel$LoadAnimationPanel.setTriState(int)
in object com.sun.swingset3.DemoPanel$LoadAnimationPanel[....] in setValue
java.lang.IllegalAccessException: Class org.jdesktop.animation.timing.interpolation.PropertySetter can not
access a member of class com.sun.swingset3.DemoPanel$LoadAnimationPanel with modifiers "public"
Problem invoking method public void com.sun.swingset3.DemoPanel$LoadAnimationPanel.setTriState(int)
in object com.sun.swingset3.DemoPanel$LoadAnimationPanel[....] in setValue
java.lang.IllegalAccessException: Class org.jdesktop.animation.timing.interpolation.PropertySetter can not
access a member of class com.sun.swingset3.DemoPanel$LoadAnimationPanel with modifiers "public"
... and on and on and on ...
[/code]

Base problem for the never-ending stream of log lines was a silently swallowed error in Demo.createDemoComponent (pointing fingers, of course <g>): the caller of the creation method had not much of a chance to notice anything was wrong (well, probably could have checked against null but didn't - but anyway: what are exceptions good for ;-) and created a Animator which happily tried to set the state of a not existing part ...

The endless logging is quick-fixed now, the underlying accessControlException not.

CU
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367286

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don't use the following imports:
[code]
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
import sun.swing.UIAction;
[/code]

We have a replacement for UIAction, but not the other two.  Web start doesn't like you poking around in sun packages since you don't have permissions.  This also makes the code unusable on the Mac/Linux, etc.

Karl
[Message sent by forum member 'kschaefe' (kschaefe@...)]

http://forums.java.net/jive/thread.jspa?messageID=367291

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Karl,

> Don't use the following imports:
> [code]
> import sun.swing.DefaultLookup;
> import sun.swing.SwingUtilities2;
> import sun.swing.UIAction;
> [/code]
>

> We have a replacement for UIAction, but not the other
> two.  Web start doesn't like you poking around in sun
> packages since you don't have permissions.  This also
> makes the code unusable on the Mac/Linux, etc.
>

as I already said: I can imagine to tripse around those - but not how to get around

[code]
sun.swing.SynthUI
[/code]

Ideas?

Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367299

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Don't use the following imports:
> [code]
> import sun.swing.DefaultLookup;
> import sun.swing.SwingUtilities2;
> import sun.swing.UIAction;
> [/code]
>
> We have a replacement for UIAction

forgot a bit of nitpicking - we don't have a replacement, we have a class with the same/very similar api but that's more or less useless: the idea of the sun class is to support per-instance enablement detection on shared actions. So the important method is

[code]
boolean isEnabled(Object sender);
[/code]

which is messaged somewhere in the handling chain of keybindings which guarantees to pass the key to the one-and-only first which is enabled. Without that method - detected by typechecking the action against sun.UIAction - shared actions are (strictly speaking) not possible, the key will be consumed irrespective of actual per-component state which might decide about enablement.

Even though it doesn't seem so - I do agree that the dependencies on the sun packages must be removed (as much as possible). Will open a issue to not forget doing it soon.

CU
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367308

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
> Even though it doesn't seem so - I do agree that the
> dependencies on the sun packages must be removed (as
> much as possible). Will open a issue to not forget
> doing it soon.
>

for your convenience, the issue is

https://swingx.dev.java.net/issues/show_bug.cgi?id=1186

Dependency on SwingUtilities2 is done - pssst: c&p'ed the relevant methods into SwingXUtilities. Rip-out sun.UIAction from the context of BasicXListUI shouldn't be such a big issue: the method with the sender is used to disable discontinous selection for selectionModels different from DefaultListSelectionModel (huch?), reverting the DefaultLookup back to UIManager shouldn't pose any problems (being optimistic <g>).

But: a major obstacle could be the dnd support and access to AppContext ... digging tasks for tomorrow ;-)

CU
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367323

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's cool, but as for SynthUI...uhm, yeah.  How does anybody work with that?

Best bet would be to see what Wolfgang was doing in support of our components for Synthetica.  He's probably encountered this type of issue before.

Karl
[Message sent by forum member 'kschaefe' (kschaefe@...)]

http://forums.java.net/jive/thread.jspa?messageID=367326

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


Re: JXList throws AccessControlException in webstartable

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> That's cool, but as for SynthUI...uhm, yeah.  How
> does anybody work with that?
>

turned out that it didn't make much of difference: right now it's only used in the copied SynthBorder so copied as well. Expect problems when we go serious and implement SynthSomeThingUI for the really new SwingX components, but shrug ... we'll have to solve it then ;-)

For now, all dependencies are removed, SwingX deployable as webstartable.

Thanks for pushing me :-)
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367412

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