mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.13k stars 234 forks source link

Custom image resources do not have permissions, ForbiddenClassException #685

Open xcfdszzr opened 2 years ago

xcfdszzr commented 2 years ago

image

design-library-icons.xml

   <IconSet id="design-editor" nearClass="com.cxplan.rpa.ui.extension.DesignLibraryIconSet" base="icons/"
     xmlns="http://weblookandfeel.com/XmlIconSet">

            <!-- Java 32x32 icon -->
        <!-- File Chooser icons -->
        <SvgIcon id="icon_add_image" path="javatest.svg" size="16,16"/>
    </IconSet>

design-library-extension.xml

image

mgarin commented 2 years ago

This is a pretty weird error. I've never encountered it before, but judging by a few topics on SO like - https://stackoverflow.com/questions/30812293/com-thoughtworks-xstream-security-forbiddenclassexception it is most probably something related to the permission settings introduced in recent XStream update.

So a few things to pinpoint the problem:

mgarin commented 2 years ago

Also, as a possible temporary/quick fix - does this solve the issue for you?

XmlUtils.getXStream ().addPermission ( AnyTypePermission.ANY );

I already have this added in latest snapshot versions, but I'm pretty sure it was missing in previous release version.