{"id":35767,"date":"2024-11-26T13:09:13","date_gmt":"2024-11-26T05:09:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/35767\/"},"modified":"2024-11-26T13:09:13","modified_gmt":"2024-11-26T05:09:13","slug":"jdk%e5%8a%a8%e6%80%81%e4%bb%a3%e7%90%86%e5%92%8ccglib%e5%8a%a8%e6%80%81%e4%bb%a3%e7%90%86%e8%8e%b7%e5%8f%96%e4%bb%a3%e7%90%86%e5%af%b9%e8%b1%a1%e4%b8%banull%e7%9a%84%e5%8e%9f%e5%9b%a0%e6%98%af","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/35767\/","title":{"rendered":"JDK\u52a8\u6001\u4ee3\u7406\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173072485369932.jpg\" class=\"aligncenter\" title=\"JDK\u52a8\u6001\u4ee3\u7406\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" alt=\"JDK\u52a8\u6001\u4ee3\u7406\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>JDK\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>\u5728JDK\u52a8\u6001\u4ee3\u7406\u4e2d\uff0c\u8c03\u7528Proxy.newProxyInstance\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u5b89\u5168\u7ba1\u7406\u5668\uff08System.getSecurityManager()\uff09\u4e0d\u4e3anull\u3002\u5982\u679c\u5b89\u5168\u7ba1\u7406\u5668\u4e3anull\uff0c\u5219\u4f1a\u5bfc\u81f4\u4ee3\u7406\u5bf9\u8c61\u4e3a\u7a7a\u3002<\/p>\n<p><strong>\u89e3\u51b3<\/strong><\/p>\n<ul>\n<li>\u68c0\u67e5\u7cfb\u7edf\u4e2d\u662f\u5426\u6b63\u786e\u914d\u7f6e\u4e86\u5b89\u5168\u7ba1\u7406\u5668\u3002<\/li>\n<li>\u786e\u4fddJava\u5e94\u7528\u542f\u52a8\u65f6\u4f20\u9012\u4e86-Djava.security.manager\u53c2\u6570\u3002<\/li>\n<\/ul>\n<p><strong>CGLIB\u52a8\u6001\u4ee3\u7406\u7684\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>CGLIB\u52a8\u6001\u4ee3\u7406\u4e2d\uff0cEnhancer.create()\u65b9\u6cd5\u8fd4\u56de\u7684\u4ee3\u7406\u5bf9\u8c61\u53ef\u80fd\u662fnull\u3002\u8fd9\u662f\u56e0\u4e3a\u5728MethodInterceptor.intercept\u65b9\u6cd5\u4e2d\uff0c\u6ca1\u6709\u8c03\u7528proxy.invokeSuper\u65b9\u6cd5\uff0c\u5bfc\u81f4\u65b9\u6cd5\u6267\u884c\u88ab\u62e6\u622a\uff0c\u4f46\u539f\u65b9\u6cd5\u6ca1\u6709\u6267\u884c\u3002<\/p>\n<p><strong>\u89e3\u51b3<\/strong><\/p>\n<p>\u5728MethodInterceptor.intercept\u65b9\u6cd5\u4e2d\uff0c\u6dfb\u52a0proxy.invokeSuper(obj, args)\u8bed\u53e5\uff0c\u4ee5\u8c03\u7528\u539f\u59cb\u65b9\u6cd5\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fJDK\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JDK\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u95ee\u9898\u5206\u6790 \u5728JDK\u52a8\u6001\u4ee3\u7406\u4e2d\uff0c\u8c03\u7528Proxy.newProxyInstance\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u5b89\u5168\u7ba1\u7406\u5668\uff08System.getSecurityManager()\uff09\u4e0d\u4e3anull\u3002\u5982\u679c\u5b89\u5168\u7ba1\u7406\u5668\u4e3anull\uff0c\u5219\u4f1a\u5bfc\u81f4\u4ee3\u7406\u5bf9\u8c61\u4e3a\u7a7a\u3002 \u89e3\u51b3 \u68c0\u67e5\u7cfb\u7edf\u4e2d\u662f\u5426\u6b63\u786e\u914d\u7f6e\u4e86\u5b89\u5168\u7ba1\u7406\u5668\u3002 \u786e\u4fddJava\u5e94\u7528\u542f\u52a8\u65f6\u4f20\u9012\u4e86-Djava.security.manager\u53c2\u6570\u3002 CGLIB\u52a8\u6001\u4ee3\u7406\u7684\u95ee\u9898\u5206\u6790 CGLIB\u52a8\u6001\u4ee3\u7406\u4e2d\uff0cEnhancer.create()\u65b9\u6cd5\u8fd4\u56de\u7684\u4ee3\u7406\u5bf9\u8c61\u53ef\u80fd\u662fnull\u3002\u8fd9\u662f\u56e0\u4e3a\u5728MethodInterceptor.intercept\u65b9\u6cd5\u4e2d\uff0c\u6ca1\u6709\u8c03\u7528proxy.invokeSuper\u65b9\u6cd5\uff0c\u5bfc\u81f4\u65b9\u6cd5\u6267\u884c\u88ab\u62e6\u622a\uff0c\u4f46\u539f\u65b9\u6cd5\u6ca1\u6709\u6267\u884c\u3002 \u89e3\u51b3 \u5728MethodInterceptor.intercept\u65b9\u6cd5\u4e2d\uff0c\u6dfb\u52a0proxy.invokeSuper(obj, args)\u8bed\u53e5\uff0c\u4ee5\u8c03\u7528\u539f\u59cb\u65b9\u6cd5\u3002 \u4ee5\u4e0a\u5c31\u662fJDK\u548cCGLIB\u52a8\u6001\u4ee3\u7406\u83b7\u53d6\u4ee3\u7406\u5bf9\u8c61\u4e3anull\u7684\u539f\u56e0\u662f\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-35767","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=35767"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35767\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=35767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=35767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=35767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}