Skip to content

XStream loading problem #2

@fh250049

Description

@fh250049

Code was compiled with Xstream 1.4.11 which is not able to load, due to security features added to XStream.

need to add to POM.xml

com.thoughtworks.xstream
xstream
1.4.20

add the below lines:
public static String buildXmlFromRuleset(Ruleset tree) {
Class<?>[] classes = new Class[] { Ruleset.class,Rule.class,DelphiRule.class, Property.class};

XStream xstream = new XStream();   

XStream.setupDefaultSecurity(xstream); // support for Xstream 1.4.20
xstream.allowTypes(classes); // support for Xstream 1.4.20

and in:
private static Ruleset buildRuleSetFromXml(String configuration) {

Class<?>[] classes = new Class[] { Ruleset.class,Rule.class,DelphiRule.class, Property.class};

XStream xstream = new XStream();    
    XStream.setupDefaultSecurity(xstream);

    xstream.allowTypes(classes); // support for Xstream 1.4.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions