Skip to content

XStream loading problem #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fh250049 opened this issue Sep 14, 2023 · 0 comments
Open

XStream loading problem #2

fh250049 opened this issue Sep 14, 2023 · 0 comments

Comments

@fh250049
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant