{"id":322,"date":"2023-02-25T06:17:31","date_gmt":"2023-02-24T22:17:31","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=322"},"modified":"2023-04-30T14:54:31","modified_gmt":"2023-04-30T06:54:31","slug":"xstream-exception-com-thoughtworks-xstream-security-forbiddenclassexception","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/xstream-exception-com-thoughtworks-xstream-security-forbiddenclassexception\/","title":{"rendered":"XStream\u5f02\u5e38com.thoughtworks.xstream.security.ForbiddenClassException"},"content":{"rendered":"<p>\u5728\u4f7f\u7528<code>XStream<\/code>\u89e3\u6790\u7684\u8fc7\u7a0b\u4e2d\u9047\u5230<code>com.thoughtworks.xstream.security.ForbiddenClassException<\/code>\u5f02\u5e38\u7684\u95ee\u9898\uff0c\u89e3\u51b3\u65b9\u5f0f\uff1a<\/p>\n<pre><code class=\"language-java\">xStream = new XStream();\n\/\/\u5c3d\u91cf\u9650\u5236\u6240\u9700\u7684\u6700\u4f4e\u6743\u9650 \u8fd9\u6761\u8bed\u53e5\u89e3\u51b3\u8be5\u95ee\u9898\nxStream.addPermission(AnyTypePermission.ANY);\n\n\/\/\u5bf9\u8c61\u8bbe\u7f6e\u9ed8\u8ba4\u5b89\u5168\u9632\u62a4 \n\/\/\u4f1a\u5bfc\u81f4com.thoughtworks.xstream.security.ForbiddenClassException\n\/\/xStream.setupDefaultSecurity(xStream);\n\/\/\u5bf9\u7c7b\u5f00\u542f\u6ce8\u89e3\nxStream.processAnnotations(FaultInfo.class);<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/stackoverflow.com\/questions\/30812293\/com-thoughtworks-xstream-security-forbiddenclassexception\">https:\/\/stackoverflow.com\/questions\/30812293\/com-thoughtworks-xstream-security-forbiddenclassexception<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528XStream\u89e3\u6790\u7684\u8fc7\u7a0b\u4e2d\u9047\u5230com.thoughtworks.xstream.security.For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[106],"class_list":["post-322","post","type-post","status-publish","format-standard","hentry","category-java-basic","tag-xstream"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}