{"id":43338,"date":"2025-06-12T07:11:38","date_gmt":"2025-06-11T23:11:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/43338.html"},"modified":"2025-06-12T07:11:38","modified_gmt":"2025-06-11T23:11:38","slug":"%e3%80%90java%e3%80%91%e3%80%90%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%91%e7%ba%bf%e7%a8%8b%e4%b8%8a%e4%b8%8b%e6%96%87%e4%b8%a2%e5%a4%b1-%e6%98%af%e6%8c%87%e4%bb%80%e4%b9%88%ef%bc%8c%e3%80%90websphere","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/43338.html","title":{"rendered":"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E2%96%A0%E5%89%8D%E8%A8%80-toc\" style=\"margin-left:0px\">\u25a0\u524d\u8a00<\/p>\n<p id=\"%E2%96%A0%E6%AD%A3%E6%96%87%E5%BC%80%E5%A7%8B-toc\" style=\"margin-left:0px\">\u25a0\u6b63\u6587\u5f00\u59cb<\/p>\n<p id=\"%E7%BA%BF%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%E7%9A%84%E6%A0%B8%E5%BF%83%E7%BB%84%E6%88%90%E9%83%A8%E5%88%86-toc\" style=\"margin-left:80px\">\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7684\u6838\u5fc3\u7ec4\u6210\u90e8\u5206<\/p>\n<p id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E5%87%BA%E7%8E%B0%E4%B8%8A%E4%B8%8B%E6%96%87%E4%B8%A2%E5%A4%B1%EF%BC%9F-toc\" style=\"margin-left:80px\">\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u4e0a\u4e0b\u6587\u4e22\u5931&#xff1f;<\/p>\n<p id=\"%E7%9B%B4%E8%A7%82%E7%A4%BA%E4%BE%8B%E8%AF%B4%E6%98%8E-toc\" style=\"margin-left:80px\">\u76f4\u89c2\u793a\u4f8b\u8bf4\u660e<\/p>\n<p id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%8A%E4%B8%8B%E6%96%87%E5%A6%82%E6%AD%A4%E9%87%8D%E8%A6%81%EF%BC%9F-toc\" style=\"margin-left:80px\">\u4e3a\u4ec0\u4e48\u4e0a\u4e0b\u6587\u5982\u6b64\u91cd\u8981&#xff1f;<\/p>\n<p id=\"%E8%A7%A3%E5%86%B3%E4%B8%8A%E4%B8%8B%E6%96%87%E4%B8%A2%E5%A4%B1%E7%9A%84%E5%85%B3%E9%94%AE-toc\" style=\"margin-left:80px\">\u89e3\u51b3\u4e0a\u4e0b\u6587\u4e22\u5931\u7684\u5173\u952e<\/p>\n<p id=\"%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:80px\">\u603b\u7ed3<\/p>\n<p id=\"%E2%96%A0%E5%A6%82%E6%9E%9C%E6%88%91%E6%83%B3%E5%9C%A8servlet%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%BA%BF%E7%A8%8B%EF%BC%8C%E4%BB%A3%E7%A0%81%E5%BA%94%E8%AF%A5%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:0px\">\u25a0\u5982\u679c\u6211\u60f3\u5728servlet\u4e2d\u4f7f\u7528\u7ebf\u7a0b&#xff0c;\u4ee3\u7801\u5e94\u8be5\u5982\u4f55\u5b9e\u73b0<\/p>\n<p id=\"%E6%8E%A8%E8%8D%90%E6%96%B9%E6%A1%88%EF%BC%9A%E4%BD%BF%E7%94%A8%20ManagedExecutorService%EF%BC%88WebSphere%20%E6%89%98%E7%AE%A1%E7%BA%BF%E7%A8%8B%E6%B1%A0%EF%BC%89-toc\" style=\"margin-left:80px\">\u63a8\u8350\u65b9\u6848&#xff1a;\u4f7f\u7528 ManagedExecutorService&#xff08;WebSphere \u6258\u7ba1\u7ebf\u7a0b\u6c60&#xff09;<\/p>\n<p id=\"%E5%A4%87%E9%80%89%E6%96%B9%E6%A1%88%EF%BC%9A%E6%89%8B%E5%8A%A8%E7%AE%A1%E7%90%86%E7%BA%BF%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%88%E5%A6%82%E6%9E%9C%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20ManagedExecutorService%EF%BC%89-toc\" style=\"margin-left:80px\">\u5907\u9009\u65b9\u6848&#xff1a;\u624b\u52a8\u7ba1\u7406\u7ebf\u7a0b\u4e0a\u4e0b\u6587&#xff08;\u5982\u679c\u65e0\u6cd5\u4f7f\u7528 ManagedExecutorService&#xff09;<\/p>\n<p id=\"%E5%85%B3%E9%94%AE%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4%EF%BC%88WebSphere%20%E6%8E%A7%E5%88%B6%E5%8F%B0%EF%BC%89-toc\" style=\"margin-left:80px\">\u5173\u952e\u914d\u7f6e\u6b65\u9aa4&#xff08;WebSphere \u63a7\u5236\u53f0&#xff09;<\/p>\n<p id=\"%E4%B8%A4%E7%A7%8D%E6%96%B9%E6%A1%88%E5%AF%B9%E6%AF%94-toc\" style=\"margin-left:80px\">\u4e24\u79cd\u65b9\u6848\u5bf9\u6bd4<\/p>\n<p id=\"%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5%E5%BB%BA%E8%AE%AE-toc\" style=\"margin-left:80px\">\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/p>\n<p id=\"%E5%AE%8C%E6%95%B4%E7%A4%BA%E4%BE%8B%EF%BC%88%E7%94%9F%E4%BA%A7%E7%BA%A7%E4%BB%A3%E7%A0%81%EF%BC%89-toc\" style=\"margin-left:80px\">\u5b8c\u6574\u793a\u4f8b&#xff08;\u751f\u4ea7\u7ea7\u4ee3\u7801&#xff09;<\/p>\n<p id=\"%E2%96%A0ManagedExecutorService%20%E8%BF%99%E4%B8%AA%E7%B1%BB%EF%BC%8C%E5%9C%A8%E9%82%A3%E4%B8%AAjar%E4%B8%AD-toc\" style=\"margin-left:0px\">\u25a0ManagedExecutorService \u8fd9\u4e2a\u7c7b&#xff0c;\u5728\u90a3\u4e2ajar\u4e2d<\/p>\n<p id=\"%E8%A7%84%E8%8C%83%E5%AE%9A%E4%B9%89%E5%8C%85%EF%BC%88%E9%80%9A%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:80px\">\u89c4\u8303\u5b9a\u4e49\u5305&#xff08;\u901a\u7528&#xff09;<\/p>\n<p id=\"%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:80px\">\u603b\u7ed3<\/p>\n<p id=\"%E6%B3%A8%E6%84%8F%EF%BC%9A%E4%B8%8D%E9%80%82%E7%94%A8WebSphere%208.5.5%EF%BC%8C%E6%B2%A1%E6%9C%89%E3%80%90com.ibm.ws.concurrent.jar%E3%80%91%E8%BF%99%E4%B8%AAjar-toc\" style=\"margin-left:80px\">\u6ce8\u610f&#xff1a;\u4e0d\u9002\u7528WebSphere 8.5.5&#xff0c;\u6ca1\u6709\u3010com.ibm.ws.concurrent.jar\u3011\u8fd9\u4e2ajar<\/p>\n<p id=\"%E5%90%84%E4%B8%AAWebSphere%E7%89%88%E6%9C%AC%E7%9B%B8%E5%85%B3%E7%9A%84jar-toc\" style=\"margin-left:0px\">\u25a0\u5404\u4e2aWebSphere\u7248\u672c\u4e2d&#xff0c;\u7ebf\u7a0b&#xff08;\u7ebf\u7a0b\u6c60&#xff09;\u76f8\u5173\u7684jar<\/p>\n<p id=\"WebSphere%20Liberty%20%E6%98%AF%E4%BB%80%E4%B9%88-toc\" style=\"margin-left:0px\">\u25a0WebSphere Liberty \u662f\u4ec0\u4e48<\/p>\n<p id=\"%F0%9F%9A%80%20%E6%A0%B8%E5%BF%83%E7%89%B9%E6%80%A7-toc\" style=\"margin-left:80px\">&#x1f680; \u6838\u5fc3\u7279\u6027<\/p>\n<p id=\"%F0%9F%8F%A2%20%E4%B8%8E%E4%BC%A0%E7%BB%9F%20WebSphere%20%E7%9A%84%E5%85%B3%E7%B3%BB-toc\" style=\"margin-left:80px\">&#x1f3e2; \u4e0e\u4f20\u7edf WebSphere \u7684\u5173\u7cfb<\/p>\n<p id=\"%E2%96%A0%E6%88%91%E5%9C%A8WebSphere%208.5.5%E4%B8%AD%EF%BC%8C%E6%89%BE%E5%88%B0%E4%BA%86runtime.jar%2C%E4%BD%86%E6%98%AF%E9%87%8C%E9%9D%A2%E6%B2%A1%E6%9C%89%E3%80%90com.ibm.ws.threading.WSManagedExecutorService%E3%80%91%E8%BF%99%E4%B8%AA%E7%B1%BB-toc\" style=\"margin-left:0px\">\u25a0\u6211\u5728WebSphere 8.5.5\u4e2d&#xff0c;\u627e\u5230\u4e86runtime.jar,\u4f46\u662f\u91cc\u9762\u6ca1\u6709\u3010com.ibm.ws.threading.WSManagedExecutorService\u3011\u8fd9\u4e2a\u7c7b<\/p>\n<p id=\"%F0%9F%94%8D%20%E6%A0%B9%E6%9C%AC%E5%8E%9F%E5%9B%A0%E5%88%86%E6%9E%90-toc\" style=\"margin-left:80px\">&#x1f50d; \u6839\u672c\u539f\u56e0\u5206\u6790<\/p>\n<p id=\"%E7%B1%BB%E3%80%90com.ibm.ws.threading.ThreadPoolManager%E3%80%91%E4%B9%9F%E6%B2%A1%E6%9C%89%E6%89%BE%E5%88%B0%EF%BC%8C%E8%80%8C%E4%B8%94%E6%A0%B9%E6%9C%AC%E4%B8%8D%E5%AD%98%E5%9C%A8%C2%A0com.ibm.ws.threading%20%E8%BF%99%E4%B8%AA%E5%8C%85%E3%80%82-toc\" style=\"margin-left:80px\">\u7c7b\u3010com.ibm.ws.threading.ThreadPoolManager\u3011\u4e5f\u6ca1\u6709\u627e\u5230&#xff0c;\u800c\u4e14\u6839\u672c\u4e0d\u5b58\u5728\u00a0com.ibm.ws.threading \u8fd9\u4e2a\u5305\u3002<\/p>\n<p id=\"%E2%96%A0WorkManager-toc\" style=\"margin-left:0px\">\u25a0WorkManager &#xff08;\u3010JNDI\u3011wm\/default&#xff09;(\u8fd9\u4e2a\u6709&#xff0c;\u95ee\u989890%\u4ee5\u4e0a\u53ef\u7528\u89e3\u51b3)<\/p>\n<p id=\"0.%20%E4%BB%A3%E7%A0%81-toc\" style=\"margin-left:80px\">0. \u4ee3\u7801<\/p>\n<p id=\"1.%20%E5%90%AF%E7%94%A8%E5%BC%82%E6%AD%A5%20Beans%20%E6%94%AF%E6%8C%81-toc\" style=\"margin-left:80px\">1. \u542f\u7528\u5f02\u6b65 Beans \u652f\u6301<\/p>\n<p id=\"2.%20%E9%85%8D%E7%BD%AE%E8%B5%84%E6%BA%90%E5%BC%95%E7%94%A8-toc\" style=\"margin-left:80px\">2. \u914d\u7f6e\u8d44\u6e90\u5f15\u7528<\/p>\n<p id=\"3.%E5%AE%9E%E9%99%85WebSphere%E7%94%BB%E9%9D%A2-toc\" style=\"margin-left:80px\">3.\u5b9e\u9645WebSphere\u753b\u9762<\/p>\n<p id=\"4.%E5%85%B3%E4%BA%8E%E3%80%90resource%20references%E3%80%91%E9%9C%80%E8%A6%81%E5%9C%A8%E5%AE%89%E8%A3%85%E6%97%B6%E6%8C%87%E5%AE%9A%E3%80%82-toc\" style=\"margin-left:80px\">4.\u5173\u4e8e\u3010resource references\u3011\u9700\u8981\u5728\u5b89\u88c5\u65f6\u6307\u5b9a\u3002<\/p>\n<p id=\"5.WorkManager%E7%9B%B8%E5%85%B3%E7%9A%84JNDI%E3%80%90wm%2Fdefault%E3%80%91%E8%AE%BE%E5%AE%9A%E5%90%8E%E7%9A%84%E6%95%88%E6%9E%9C-toc\" style=\"margin-left:80px\">5.WorkManager\u76f8\u5173\u7684JNDI\u3010wm\/default\u3011\u8bbe\u5b9a\u540e\u7684\u6548\u679c<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E2%96%A0%E5%89%8D%E8%A8%80\">\u25a0\u524d\u8a00<\/h2>\n<p><span style=\"color:#98c091\">Web\u5e94\u7528\u4e2d&#xff0c;\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387&#xff0c;\u67d0\u6bb5\u548c\u4e3b\u4e1a\u52a1\u65e0\u5173\u7684\u5904\u7406&#xff0c;\u4f7f\u7528\u5f02\u6b65\u5904\u7406\u6765\u5904\u7406\u3002<\/span><\/p>\n<p><span style=\"color:#98c091\">&#xff08;\u4f7f\u7528\u7684\u670d\u52a1\u5668\u662fWebSphere&#xff09;<\/span><\/p>\n<p><span style=\"color:#98c091\">\u7ed3\u679c\u62a5\u5982\u4e0b\u9519\u8bef<\/span><\/p>\n<p><span style=\"color:#fe2c24\">WebContextsService getStandardContext Failed to retrieve application name<\/span><\/p>\n<p><span style=\"color:#4da8ee\">\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u9020\u6210\u7684&#xff0c;<\/span><\/p>\n<p><span style=\"color:#4da8ee\">\u56e0\u6b64&#xff0c;\u6574\u7406\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931<\/span><\/p>\n<p>&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<h2 id=\"%E2%96%A0%E6%AD%A3%E6%96%87%E5%BC%80%E5%A7%8B\">\u25a0\u6b63\u6587\u5f00\u59cb<\/h2>\n<h4 id=\"%E7%BA%BF%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%E7%9A%84%E6%A0%B8%E5%BF%83%E7%BB%84%E6%88%90%E9%83%A8%E5%88%86\">\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u7684\u6838\u5fc3\u7ec4\u6210\u90e8\u5206<\/h4>\n<li>\n<p>\u7c7b\u52a0\u8f7d\u5668&#xff08;ClassLoader&#xff09;<\/p>\n<ul>\n<li>\n<p>Web \u5e94\u7528\u6709\u72ec\u7acb\u7684\u7c7b\u52a0\u8f7d\u5668&#xff08;\u9694\u79bb\u5176\u4ed6\u5e94\u7528&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u8d1f\u8d23\u52a0\u8f7d\u5e94\u7528\u4e2d\u7684\u7c7b\u3001\u8d44\u6e90\u548c\u5e93<\/p>\n<\/li>\n<li>\n<p>\u4e22\u5931\u540e\u679c&#xff1a;ClassNotFoundException\u3001NoClassDefFoundError<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>JNDI&#xff08;Java Naming and Directory Interface&#xff09;\u4e0a\u4e0b\u6587<\/p>\n<ul>\n<li>\n<p>\u63d0\u4f9b\u5bf9\u5e94\u7528\u670d\u52a1\u5668\u8d44\u6e90\u7684\u8bbf\u95ee&#xff08;\u5982\u6570\u636e\u6e90\u3001JMS \u961f\u5217&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4e22\u5931\u540e\u679c&#xff1a;NamingException\u3001\u65e0\u6cd5\u67e5\u627e\u00a0java:comp\/env\u00a0\u8d44\u6e90<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Web \u5e94\u7528\u4e0a\u4e0b\u6587&#xff08;ServletContext&#xff09;<\/p>\n<ul>\n<li>\n<p>\u5305\u542b Web \u5e94\u7528\u5143\u6570\u636e&#xff1a;\u5e94\u7528\u540d\u79f0\u3001\u4e0a\u4e0b\u6587\u8def\u5f84\u3001\u521d\u59cb\u5316\u53c2\u6570<\/p>\n<\/li>\n<li>\n<p>\u4e22\u5931\u540e\u679c&#xff1a;getStandardContext failed to retrieve application name<span style=\"color:#fe2c24\">&#xff08;\u6211\u9047\u5230\u7684\u9519\u8bef&#xff09;<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b89\u5168\u4e0a\u4e0b\u6587&#xff08;Security Context&#xff09;<\/p>\n<ul>\n<li>\n<p>\u5305\u542b\u7528\u6237\u8ba4\u8bc1\/\u6388\u6743\u4fe1\u606f&#xff08;\u5982 Principal\u3001\u89d2\u8272&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4e22\u5931\u540e\u679c&#xff1a;NullPointerException\u00a0\u6216\u6743\u9650\u68c0\u67e5\u5931\u8d25<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4e8b\u52a1\u4e0a\u4e0b\u6587&#xff08;Transaction Context&#xff09;<\/p>\n<ul>\n<li>\n<p>\u7ba1\u7406\u6570\u636e\u5e93\u4e8b\u52a1\u8fb9\u754c<\/p>\n<\/li>\n<li>\n<p>\u4e22\u5931\u540e\u679c&#xff1a;\u4e8b\u52a1\u65e0\u6cd5\u63d0\u4ea4\/\u56de\u6eda<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h4 id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E5%87%BA%E7%8E%B0%E4%B8%8A%E4%B8%8B%E6%96%87%E4%B8%A2%E5%A4%B1%EF%BC%9F\">\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u4e0a\u4e0b\u6587\u4e22\u5931&#xff1f;<\/h4>\n<li>\n<p>\u7ebf\u7a0b\u521b\u5efa\u65b9\u5f0f<\/p>\n<p> \/\/ \u81ea\u5b9a\u4e49\u7ebf\u7a0b\u4e0d\u4f1a\u7ee7\u627f\u4e0a\u4e0b\u6587<br \/>\nnew Thread(() -&gt; {<br \/>\n    \/\/ \u6b64\u5904\u4e22\u5931\u6240\u6709\u4e0a\u4e0b\u6587!<br \/>\n}).start(); <\/p>\n<\/li>\n<li>\n<p>Web \u5bb9\u5668\u7ba1\u7406\u7684\u7ebf\u7a0b vs \u81ea\u5b9a\u4e49\u7ebf\u7a0b<\/p>\n<table>\n<tr>\u7279\u6027Web \u5bb9\u5668\u7ebf\u7a0b (\u5982 HTTP \u8bf7\u6c42\u7ebf\u7a0b)\u81ea\u5b9a\u4e49\u7ebf\u7a0b<\/tr>\n<tbody>\n<tr>\n<td>\u7c7b\u52a0\u8f7d\u5668<\/td>\n<td>\u81ea\u52a8\u8bbe\u7f6e\u6b63\u786e<\/td>\n<td>\u9ed8\u8ba4\u4f7f\u7528\u7cfb\u7edf\u7c7b\u52a0\u8f7d\u5668<\/td>\n<\/tr>\n<tr>\n<td>JNDI \u4e0a\u4e0b\u6587<\/td>\n<td>\u81ea\u52a8\u53ef\u7528<\/td>\n<td>InitialContext()\u00a0\u5931\u8d25<\/td>\n<\/tr>\n<tr>\n<td>ServletContext<\/td>\n<td>\u901a\u8fc7\u00a0getServletContext()\u00a0\u83b7\u53d6<\/td>\n<td>\u8fd4\u56de\u00a0null\u00a0\u6216\u629b\u51fa\u5f02\u5e38<\/td>\n<\/tr>\n<tr>\n<td>\u4e8b\u52a1\u4f20\u64ad<\/td>\n<td>\u652f\u6301<\/td>\n<td>\u4e8b\u52a1\u8fb9\u754c\u4e2d\u65ad<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>WebSphere \u7684\u4e0a\u4e0b\u6587\u9694\u79bb\u673a\u5236<\/p>\n<ul>\n<li>\n<p>\u4e3a\u6bcf\u4e2a\u5e94\u7528\u521b\u5efa\u72ec\u7acb\u7684\u6c99\u7bb1\u73af\u5883<\/p>\n<\/li>\n<li>\n<p>\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u88ab\u89c6\u4e3a&#034;\u5916\u90e8\u7ebf\u7a0b&#034;&#xff0c;\u65e0\u6743\u8bbf\u95ee\u5e94\u7528\u6c99\u7bb1<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<hr \/>\n<h4 id=\"%E7%9B%B4%E8%A7%82%E7%A4%BA%E4%BE%8B%E8%AF%B4%E6%98%8E\">\u76f4\u89c2\u793a\u4f8b\u8bf4\u660e<\/h4>\n<p>\u5047\u8bbe\u5728 Servlet \u4e2d\u542f\u52a8\u7ebf\u7a0b&#xff1a;<\/p>\n<p>public class MyServlet extends HttpServlet {<br \/>\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp) {<br \/>\n        \/\/ \u6b63\u786e\u73af\u5883 (\u6709\u4e0a\u4e0b\u6587)<br \/>\n        String appName &#061; getServletContext().getContextPath(); \/\/ \u6210\u529f\u83b7\u53d6<\/p>\n<p>        new Thread(() -&gt; {<br \/>\n            \/\/ \u5371\u9669\u533a\u57df (\u4e0a\u4e0b\u6587\u4e22\u5931)!<br \/>\n            try {<br \/>\n                \/\/ \u5c1d\u8bd5\u83b7\u53d6\u76f8\u540c\u4fe1\u606f<br \/>\n                Context ctx &#061; new InitialContext();<br \/>\n                String name &#061; (String) ctx.lookup(&#034;java:app\/AppName&#034;); \/\/ \u629b\u51fa\u5f02\u5e38!<br \/>\n            } catch (NamingException e) {<br \/>\n                \/\/ \u62a5\u9519: getStandardContext failed to retrieve application name<br \/>\n            }<br \/>\n        }).start();<br \/>\n    }<br \/>\n} <\/p>\n<hr \/>\n<h4 id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%8A%E4%B8%8B%E6%96%87%E5%A6%82%E6%AD%A4%E9%87%8D%E8%A6%81%EF%BC%9F\">\u4e3a\u4ec0\u4e48\u4e0a\u4e0b\u6587\u5982\u6b64\u91cd\u8981&#xff1f;<\/h4>\n<p>\u5f53\u8c03\u7528\u4ee5\u4e0b API \u65f6\u4f1a\u4f9d\u8d56\u4e0a\u4e0b\u6587&#xff1a;<\/p>\n<p>\/\/ \u4f9d\u8d56 Web \u4e0a\u4e0b\u6587<br \/>\nservletContext.getResource(&#034;\/WEB-INF\/config.xml&#034;); <\/p>\n<p>\/\/ \u4f9d\u8d56 JNDI \u4e0a\u4e0b\u6587<br \/>\ndataSource &#061; (DataSource) new InitialContext().lookup(&#034;jdbc\/myDB&#034;);<\/p>\n<p>\/\/ \u4f9d\u8d56\u7c7b\u52a0\u8f7d\u5668<br \/>\nClass.forName(&#034;com.myapp.CustomClass&#034;); <\/p>\n<p>\/\/ \u4f9d\u8d56\u5b89\u5168\u4e0a\u4e0b\u6587<br \/>\nrequest.isUserInRole(&#034;Admin&#034;); <\/p>\n<hr \/>\n<h4 id=\"%E8%A7%A3%E5%86%B3%E4%B8%8A%E4%B8%8B%E6%96%87%E4%B8%A2%E5%A4%B1%E7%9A%84%E5%85%B3%E9%94%AE\">\u89e3\u51b3\u4e0a\u4e0b\u6587\u4e22\u5931\u7684\u5173\u952e<\/h4>\n<p>\u5fc5\u987b\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4e4b\u4e00\u4f20\u9012\u4e0a\u4e0b\u6587&#xff1a;<\/p>\n<li>\n<p>\u663e\u5f0f\u4f20\u9012\u6570\u636e<\/p>\n<p> \/\/ \u5728 Web \u7ebf\u7a0b\u4e2d\u9884\u5148\u83b7\u53d6\u503c<br \/>\nString appName &#061; getServletContext().getContextPath();<br \/>\nexecutor.submit(new MyTask(appName)); \/\/ \u4f20\u9012\u503c\u800c\u975e\u4f9d\u8d56\u4e0a\u4e0b\u6587 <\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u6258\u7ba1\u7ebf\u7a0b\u670d\u52a1&#xff08;\u63a8\u8350&#xff09;<\/p>\n<p> &#064;Resource<br \/>\nprivate ManagedExecutorService managedExecutor; \/\/ WebSphere \u6258\u7ba1<\/p>\n<p>managedExecutor.submit(() -&gt; {<br \/>\n    \/\/ WebSphere \u81ea\u52a8\u6ce8\u5165\u4e0a\u4e0b\u6587<br \/>\n    Context ctx &#061; new InitialContext(); \/\/ \u73b0\u5728\u6b63\u5e38\u5de5\u4f5c\u4e86!<br \/>\n}); <\/p>\n<\/li>\n<li>\n<p>\u624b\u52a8\u6062\u590d\u4e0a\u4e0b\u6587&#xff08;\u590d\u6742&#xff09;<\/p>\n<p> \/\/ \u5728 Web \u7ebf\u7a0b\u4e2d\u6355\u83b7\u5f53\u524d\u7c7b\u52a0\u8f7d\u5668<br \/>\nClassLoader originalClassLoader &#061; Thread.currentThread().getContextClassLoader();<\/p>\n<p>new Thread(() -&gt; {<br \/>\n    \/\/ \u624b\u52a8\u6062\u590d\u7c7b\u52a0\u8f7d\u5668<br \/>\n    Thread.currentThread().setContextClassLoader(originalClassLoader);<br \/>\n    \/\/ \u6ce8\u610f&#xff1a;\u8fd9\u65e0\u6cd5\u6062\u590d JNDI \u6216 ServletContext!<br \/>\n}).start(); <\/p>\n<\/li>\n<hr \/>\n<h4 id=\"%E6%80%BB%E7%BB%93\">\u603b\u7ed3<\/h4>\n<p>\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u672c\u8d28\u662f&#xff1a;\u5f53\u4ee3\u7801\u8131\u79bb Web \u5bb9\u5668\u7ba1\u63a7\u7684\u7ebf\u7a0b\u65f6&#xff0c;\u5e94\u7528\u670d\u52a1\u5668\u65e0\u6cd5\u81ea\u52a8\u63d0\u4f9b\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883\u4fe1\u606f\u3002\u89e3\u51b3\u7684\u5173\u952e\u5728\u4e8e&#xff1a;<\/p>\n<li>\n<p>\u907f\u514d\u5728\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u4e2d\u76f4\u63a5\u8bbf\u95ee Web API<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u670d\u52a1\u5668\u6258\u7ba1\u7ebf\u7a0b\u6c60&#xff08;ManagedExecutorService&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5728 Web \u7ebf\u7a0b\u4e2d\u9884\u5148\u83b7\u53d6\u6570\u636e\u5e76\u4f20\u9012\u503c<\/p>\n<\/li>\n<p>\u8fd9\u6b63\u662f\u60a8\u9047\u5230\u7684\u00a0getStandardContext failed to retrieve application name\u00a0\u7684\u6839\u672c\u539f\u56e0\u2014\u2014\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u4e2d\u65e0\u6cd5\u5173\u8054\u5230 Web \u5e94\u7528\u7684\u00a0ServletContext\u3002<\/p>\n<\/p>\n<p>&#061;&#061;&#061;<\/p>\n<\/p>\n<h2 id=\"%E2%96%A0%E5%A6%82%E6%9E%9C%E6%88%91%E6%83%B3%E5%9C%A8servlet%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%BA%BF%E7%A8%8B%EF%BC%8C%E4%BB%A3%E7%A0%81%E5%BA%94%E8%AF%A5%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0\">\u25a0\u5982\u679c\u6211\u60f3\u5728servlet\u4e2d\u4f7f\u7528\u7ebf\u7a0b&#xff0c;\u4ee3\u7801\u5e94\u8be5\u5982\u4f55\u5b9e\u73b0<\/h2>\n<p>\u5728 Servlet \u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49\u7ebf\u7a0b\u65f6&#xff0c;\u4e3a\u4e86\u6b63\u786e\u5904\u7406\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u95ee\u9898&#xff08;\u7279\u522b\u662f\u5728 WebSphere \u73af\u5883\u4e2d&#xff09;&#xff0c;\u5f3a\u70c8\u63a8\u8350\u4f7f\u7528 Java EE \u6807\u51c6\u7684\u00a0ManagedExecutorService\u3002\u4ee5\u4e0b\u662f\u5b8c\u6574\u7684\u5b9e\u73b0\u65b9\u6848&#xff1a;<\/p>\n<h4 id=\"%E6%8E%A8%E8%8D%90%E6%96%B9%E6%A1%88%EF%BC%9A%E4%BD%BF%E7%94%A8%20ManagedExecutorService%EF%BC%88WebSphere%20%E6%89%98%E7%AE%A1%E7%BA%BF%E7%A8%8B%E6%B1%A0%EF%BC%89\">\u63a8\u8350\u65b9\u6848&#xff1a;\u4f7f\u7528 ManagedExecutorService&#xff08;WebSphere \u6258\u7ba1\u7ebf\u7a0b\u6c60&#xff09;<\/h4>\n<p>import javax.annotation.Resource;<br \/>\nimport javax.servlet.ServletException;<br \/>\nimport javax.servlet.annotation.WebServlet;<br \/>\nimport javax.servlet.http.HttpServlet;<br \/>\nimport javax.servlet.http.HttpServletRequest;<br \/>\nimport javax.servlet.http.HttpServletResponse;<br \/>\nimport javax.enterprise.concurrent.ManagedExecutorService;<br \/>\nimport java.io.IOException;<br \/>\nimport java.io.PrintWriter;<\/p>\n<p>&#064;WebServlet(&#034;\/asyncTask&#034;)<br \/>\npublic class ThreadedServlet extends HttpServlet {<\/p>\n<p>    \/\/ \u6ce8\u5165 WebSphere \u6258\u7ba1\u7684\u7ebf\u7a0b\u6c60\u670d\u52a1<br \/>\n    &#064;Resource<br \/>\n    private ManagedExecutorService managedExecutor;<\/p>\n<p>    &#064;Override<br \/>\n    protected void doGet(HttpServletRequest request, HttpServletResponse response)<br \/>\n            throws ServletException, IOException {<\/p>\n<p>        response.setContentType(&#034;text\/plain&#034;);<br \/>\n        PrintWriter out &#061; response.getWriter();<\/p>\n<p>        \/\/ \u63d0\u4ea4\u4efb\u52a1\u5230\u6258\u7ba1\u7ebf\u7a0b\u6c60&#xff08;\u81ea\u52a8\u4f20\u9012\u7ebf\u7a0b\u4e0a\u4e0b\u6587&#xff09;<br \/>\n        managedExecutor.submit(() -&gt; {<br \/>\n            try {<br \/>\n                \/\/ \u5728\u6258\u7ba1\u7ebf\u7a0b\u4e2d\u5b89\u5168\u8bbf\u95ee\u4e0a\u4e0b\u6587<br \/>\n                String appName &#061; (String) new InitialContext().lookup(&#034;java:app\/AppName&#034;);<br \/>\n                String contextPath &#061; request.getServletContext().getContextPath();<\/p>\n<p>                \/\/ \u6267\u884c\u5b9e\u9645\u4e1a\u52a1\u903b\u8f91<br \/>\n                processTask(appName, contextPath);<\/p>\n<p>                out.println(&#034;Task completed successfully in managed thread!&#034;);<br \/>\n            } catch (Exception e) {<br \/>\n                out.println(&#034;Error in managed thread: &#034; &#043; e.getMessage());<br \/>\n                e.printStackTrace();<br \/>\n            }<br \/>\n        });<\/p>\n<p>        out.println(&#034;Background task started using ManagedExecutorService&#8230;&#034;);<br \/>\n    }<\/p>\n<p>    private void processTask(String appName, String contextPath) {<br \/>\n        \/\/ \u8fd9\u91cc\u662f\u5b9e\u9645\u7684\u4e1a\u52a1\u903b\u8f91<br \/>\n        System.out.println(&#034;Processing task for application: &#034; &#043; appName);<br \/>\n        System.out.println(&#034;Context path: &#034; &#043; contextPath);<br \/>\n        \/\/ \u6a21\u62df\u8017\u65f6\u64cd\u4f5c<br \/>\n        try {<br \/>\n            Thread.sleep(2000);<br \/>\n        } catch (InterruptedException e) {<br \/>\n            Thread.currentThread().interrupt();<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"%E5%A4%87%E9%80%89%E6%96%B9%E6%A1%88%EF%BC%9A%E6%89%8B%E5%8A%A8%E7%AE%A1%E7%90%86%E7%BA%BF%E7%A8%8B%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%88%E5%A6%82%E6%9E%9C%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20ManagedExecutorService%EF%BC%89\">\u5907\u9009\u65b9\u6848&#xff1a;\u624b\u52a8\u7ba1\u7406\u7ebf\u7a0b\u4e0a\u4e0b\u6587&#xff08;\u5982\u679c\u65e0\u6cd5\u4f7f\u7528 ManagedExecutorService&#xff09;<\/h4>\n<p>import javax.servlet.ServletException;<br \/>\nimport javax.servlet.annotation.WebServlet;<br \/>\nimport javax.servlet.http.HttpServlet;<br \/>\nimport javax.servlet.http.HttpServletRequest;<br \/>\nimport javax.servlet.http.HttpServletResponse;<br \/>\nimport java.io.IOException;<br \/>\nimport java.io.PrintWriter;<br \/>\nimport java.util.concurrent.ExecutorService;<br \/>\nimport java.util.concurrent.Executors;<br \/>\nimport javax.naming.InitialContext;<\/p>\n<p>&#064;WebServlet(&#034;\/manualThread&#034;)<br \/>\npublic class ManualThreadServlet extends HttpServlet {<\/p>\n<p>    \/\/ \u521b\u5efa\u666e\u901a\u7ebf\u7a0b\u6c60&#xff08;\u4e0d\u63a8\u8350&#xff0c;\u4ec5\u4f5c\u6f14\u793a&#xff09;<br \/>\n    private final ExecutorService executor &#061; Executors.newFixedThreadPool(5);<\/p>\n<p>    &#064;Override<br \/>\n    protected void doGet(HttpServletRequest request, HttpServletResponse response)<br \/>\n            throws ServletException, IOException {<\/p>\n<p>        response.setContentType(&#034;text\/plain&#034;);<br \/>\n        PrintWriter out &#061; response.getWriter();<\/p>\n<p>        \/\/ \u5728Web\u7ebf\u7a0b\u4e2d\u9884\u5148\u83b7\u53d6\u6240\u9700\u4e0a\u4e0b\u6587\u4fe1\u606f<br \/>\n        final String appName &#061; getPredefinedAppName();<br \/>\n        final String contextPath &#061; request.getServletContext().getContextPath();<br \/>\n        final ClassLoader contextClassLoader &#061; Thread.currentThread().getContextClassLoader();<\/p>\n<p>        \/\/ \u63d0\u4ea4\u4efb\u52a1\u5230\u666e\u901a\u7ebf\u7a0b\u6c60<br \/>\n        executor.submit(() -&gt; {<br \/>\n            \/\/ \u4fdd\u5b58\u539f\u59cb\u7c7b\u52a0\u8f7d\u5668&#xff08;\u7528\u4e8e\u6062\u590d&#xff09;<br \/>\n            ClassLoader originalClassLoader &#061; Thread.currentThread().getContextClassLoader();<\/p>\n<p>            try {<br \/>\n                \/\/ \u624b\u52a8\u8bbe\u7f6e\u4e0a\u4e0b\u6587\u7c7b\u52a0\u8f7d\u5668<br \/>\n                Thread.currentThread().setContextClassLoader(contextClassLoader);<\/p>\n<p>                \/\/ \u4f7f\u7528\u9884\u5148\u83b7\u53d6\u7684\u4e0a\u4e0b\u6587\u4fe1\u606f<br \/>\n                processTask(appName, contextPath);<\/p>\n<p>                out.println(&#034;Task completed in manual thread!&#034;);<br \/>\n            } catch (Exception e) {<br \/>\n                out.println(&#034;Error in manual thread: &#034; &#043; e.getMessage());<br \/>\n                e.printStackTrace();<br \/>\n            } finally {<br \/>\n                \/\/ \u6062\u590d\u539f\u59cb\u7c7b\u52a0\u8f7d\u5668<br \/>\n                Thread.currentThread().setContextClassLoader(originalClassLoader);<br \/>\n            }<br \/>\n        });<\/p>\n<p>        out.println(&#034;Background task started using manual thread&#8230;&#034;);<br \/>\n    }<\/p>\n<p>    private String getPredefinedAppName() {<br \/>\n        try {<br \/>\n            \/\/ \u5728Web\u7ebf\u7a0b\u4e2d\u9884\u5148\u83b7\u53d6\u5e94\u7528\u540d\u79f0<br \/>\n            return (String) new InitialContext().lookup(&#034;java:app\/AppName&#034;);<br \/>\n        } catch (Exception e) {<br \/>\n            return &#034;default-app&#034;;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    private void processTask(String appName, String contextPath) {<br \/>\n        \/\/ \u4e1a\u52a1\u903b\u8f91\u540c\u4e0a<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void destroy() {<br \/>\n        \/\/ \u5173\u95ed\u7ebf\u7a0b\u6c60<br \/>\n        executor.shutdown();<br \/>\n        super.destroy();<br \/>\n    }<br \/>\n} <\/p>\n<h4 id=\"%E5%85%B3%E9%94%AE%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4%EF%BC%88WebSphere%20%E6%8E%A7%E5%88%B6%E5%8F%B0%EF%BC%89\">\u5173\u952e\u914d\u7f6e\u6b65\u9aa4&#xff08;WebSphere \u63a7\u5236\u53f0&#xff09;<\/h4>\n<li>\n<p>\u542f\u7528\u5e76\u53d1\u7b56\u7565&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u767b\u5f55 WebSphere \u7ba1\u7406\u63a7\u5236\u53f0<\/p>\n<\/li>\n<li>\n<p>\u5bfc\u822a\u5230&#xff1a;\u8d44\u6e90 &gt; \u5e76\u53d1\u7b56\u7565<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u6216\u4f7f\u7528\u9ed8\u8ba4\u7684\u5e76\u53d1\u7b56\u7565<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7ed1\u5b9a\u5230\u5e94\u7528&#xff08;\u53ef\u9009&#xff0c;\u901a\u5e38\u81ea\u52a8\u6ce8\u5165\u5373\u53ef\u5de5\u4f5c&#xff09;&#xff1a; \u5728\u00a0ibm-application-bnd.xml\u00a0\u4e2d\u6dfb\u52a0&#xff1a;<\/p>\n<p> &lt;application-bnd&gt;<br \/>\n    &lt;managed-executor-service name&#061;&#034;concurrent\/executorSvc&#034; \/&gt;<br \/>\n&lt;\/application-bnd&gt;  <\/li>\n<h4 id=\"%E4%B8%A4%E7%A7%8D%E6%96%B9%E6%A1%88%E5%AF%B9%E6%AF%94\">\u4e24\u79cd\u65b9\u6848\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u7279\u6027ManagedExecutorService\u624b\u52a8\u7ebf\u7a0b\u7ba1\u7406<\/tr>\n<tbody>\n<tr>\n<td>\u4e0a\u4e0b\u6587\u4f20\u64ad<\/td>\n<td>\u81ea\u52a8\u5b8c\u6574\u4f20\u64ad&#xff08;\u7c7b\u52a0\u8f7d\u5668\u3001JNDI\u3001\u5b89\u5168\u7b49&#xff09;<\/td>\n<td>\u4ec5\u80fd\u624b\u52a8\u4f20\u9012\u7c7b\u52a0\u8f7d\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u8d44\u6e90\u7ba1\u7406<\/td>\n<td>WebSphere \u81ea\u52a8\u7ba1\u7406\u751f\u547d\u5468\u671f<\/td>\n<td>\u9700\u624b\u52a8\u5173\u95ed\u7ebf\u7a0b\u6c60<\/td>\n<\/tr>\n<tr>\n<td>\u4e8b\u52a1\u652f\u6301<\/td>\n<td>\u652f\u6301\u4e8b\u52a1\u4e0a\u4e0b\u6587\u4f20\u64ad<\/td>\n<td>\u4e0d\u652f\u6301\u4e8b\u52a1\u4f20\u64ad<\/td>\n<\/tr>\n<tr>\n<td>Servlet API \u8bbf\u95ee<\/td>\n<td>\u53ef\u76f4\u63a5\u8bbf\u95ee&#xff08;\u5982\u00a0request\u3001response&#xff09;<\/td>\n<td>\u53ea\u80fd\u8bbf\u95ee\u9884\u5148\u83b7\u53d6\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>WebSphere \u517c\u5bb9\u6027<\/td>\n<td>\u5b8c\u5168\u517c\u5bb9<\/td>\n<td>\u53ef\u80fd\u4ecd\u6709\u4e0a\u4e0b\u6587\u95ee\u9898<\/td>\n<\/tr>\n<tr>\n<td>\u4ee3\u7801\u590d\u6742\u5ea6<\/td>\n<td>\u7b80\u5355&#xff08;\u58f0\u660e\u5f0f\u6ce8\u5165&#xff09;<\/td>\n<td>\u590d\u6742&#xff08;\u9700\u624b\u52a8\u7ba1\u7406\u4e0a\u4e0b\u6587&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u63a8\u8350\u5ea6<\/td>\n<td>\u2b50\u2b50\u2b50\u2b50\u2b50&#xff08;\u9996\u9009\u65b9\u6848&#xff09;<\/td>\n<td>\u2b50\u2b50&#xff08;\u5907\u9009\u65b9\u6848&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5%E5%BB%BA%E8%AE%AE\">\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/h4>\n<li>\n<p>\u9996\u9009\u6258\u7ba1\u7ebf\u7a0b\u6c60&#xff1a;<\/p>\n<p> &#064;Resource<br \/>\nprivate ManagedExecutorService executor; \/\/ \u59cb\u7ec8\u4f7f\u7528\u8fd9\u4e2a  <\/li>\n<li>\n<p>\u907f\u514d\u5728\u5b50\u7ebf\u7a0b\u4e2d\u76f4\u63a5\u4f7f\u7528 Servlet API&#xff1a;<\/p>\n<p> \/\/ \u9519\u8bef\u505a\u6cd5&#xff08;\u53ef\u80fd\u5f15\u53d1\u95ee\u9898&#xff09;&#xff1a;<br \/>\nmanagedExecutor.submit(() -&gt; {<br \/>\n    request.getSession(); \/\/ \u53ef\u80fd\u4e0d\u5b89\u5168<br \/>\n});<\/p>\n<p>\/\/ \u6b63\u786e\u505a\u6cd5&#xff08;\u9884\u5148\u83b7\u53d6\u6240\u9700\u6570\u636e&#xff09;&#xff1a;<br \/>\nString sessionId &#061; request.getSession().getId();<br \/>\nmanagedExecutor.submit(() -&gt; processSession(sessionId));  <\/li>\n<li>\n<p>\u5904\u7406\u7ebf\u7a0b\u4e2d\u7684\u5f02\u5e38&#xff1a;<\/p>\n<p> managedExecutor.submit(() -&gt; {<br \/>\n    try {<br \/>\n        \/\/ \u4e1a\u52a1\u903b\u8f91<br \/>\n    } catch (Exception e) {<br \/>\n        \/\/ 1. \u8bb0\u5f55\u65e5\u5fd7<br \/>\n        \/\/ 2. \u4e0d\u8981\u541e\u6389\u5f02\u5e38<br \/>\n        \/\/ 3. \u8003\u8651\u901a\u77e5\u4e3b\u7ebf\u7a0b<br \/>\n    }<br \/>\n}); <\/p>\n<\/li>\n<li>\n<p>\u751f\u547d\u5468\u671f\u7ba1\u7406&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e0d\u9700\u8981\u624b\u52a8\u5173\u95ed\u00a0ManagedExecutorService<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e8e\u666e\u901a\u7ebf\u7a0b\u6c60&#xff0c;\u5728\u00a0Servlet.destroy()\u00a0\u4e2d\u5173\u95ed&#xff1a;<\/p>\n<p> &#064;Override<br \/>\npublic void destroy() {<br \/>\n    executor.shutdown();<br \/>\n    try {<br \/>\n        if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {<br \/>\n            executor.shutdownNow();<br \/>\n        }<br \/>\n    } catch (InterruptedException e) {<br \/>\n        executor.shutdownNow();<br \/>\n        Thread.currentThread().interrupt();<br \/>\n    }<br \/>\n} <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4 id=\"%E5%AE%8C%E6%95%B4%E7%A4%BA%E4%BE%8B%EF%BC%88%E7%94%9F%E4%BA%A7%E7%BA%A7%E4%BB%A3%E7%A0%81%EF%BC%89\">\u5b8c\u6574\u793a\u4f8b&#xff08;\u751f\u4ea7\u7ea7\u4ee3\u7801&#xff09;<\/h4>\n<p>&#064;WebServlet(&#034;\/task&#034;)<br \/>\npublic class ProductionReadyServlet extends HttpServlet {<\/p>\n<p>    &#064;Resource<br \/>\n    private ManagedExecutorService managedExecutor;<\/p>\n<p>    private static final Logger logger &#061; LoggerFactory.getLogger(ProductionReadyServlet.class);<\/p>\n<p>    &#064;Override<br \/>\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp)<br \/>\n            throws IOException {<\/p>\n<p>        \/\/ \u9884\u5148\u83b7\u53d6\u6240\u9700\u4e0a\u4e0b\u6587\u4fe1\u606f<br \/>\n        String appName &#061; (String) req.getServletContext().getAttribute(&#034;app.name&#034;);<br \/>\n        String clientIP &#061; req.getRemoteAddr();<\/p>\n<p>        \/\/ \u63d0\u4ea4\u4efb\u52a1<br \/>\n        managedExecutor.submit(new TrackedTask(appName, clientIP));<\/p>\n<p>        resp.getWriter().write(&#034;Task submitted successfully&#034;);<br \/>\n    }<\/p>\n<p>    \/\/ \u5c01\u88c5\u4efb\u52a1\u7684\u5185\u90e8\u7c7b<br \/>\n    private class TrackedTask implements Runnable {<br \/>\n        private final String appName;<br \/>\n        private final String clientIP;<\/p>\n<p>        TrackedTask(String appName, String clientIP) {<br \/>\n            this.appName &#061; appName;<br \/>\n            this.clientIP &#061; clientIP;<br \/>\n        }<\/p>\n<p>        &#064;Override<br \/>\n        public void run() {<br \/>\n            MDC.put(&#034;app&#034;, appName); \/\/ \u65e5\u5fd7\u4e0a\u4e0b\u6587<br \/>\n            MDC.put(&#034;client&#034;, clientIP);<\/p>\n<p>            try {<br \/>\n                logger.info(&#034;Starting background task&#034;);<br \/>\n                \/\/ \u4e1a\u52a1\u903b\u8f91&#8230;<br \/>\n                logger.info(&#034;Task completed&#034;);<br \/>\n            } catch (Exception e) {<br \/>\n                logger.error(&#034;Task failed&#034;, e);<br \/>\n            } finally {<br \/>\n                MDC.clear();<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<p>\u4f7f\u7528\u8fd9\u79cd\u6a21\u5f0f&#xff0c;\u60a8\u53ef\u4ee5&#xff1a;<\/p>\n<li>\n<p>\u5b89\u5168\u5730\u5728\u540e\u53f0\u7ebf\u7a0b\u6267\u884c\u4efb\u52a1<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u7559\u5fc5\u8981\u7684\u4e0a\u4e0b\u6587\u4fe1\u606f<\/p>\n<\/li>\n<li>\n<p>\u83b7\u5f97\u5b8c\u5584\u7684\u9519\u8bef\u5904\u7406\u548c\u65e5\u5fd7\u8ddf\u8e2a<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u5168\u517c\u5bb9 WebSphere \u73af\u5883<\/p>\n<\/li>\n<li>\n<p>\u907f\u514d\u00a0getStandardContext failed\u00a0\u9519\u8bef<\/p>\n<\/li>\n<p>\u5bf9\u4e8e\u5927\u591a\u6570\u573a\u666f&#xff0c;\u4f7f\u7528\u00a0ManagedExecutorService\u00a0\u5e76\u9075\u5faa\u4e0a\u8ff0\u6a21\u5f0f\u5373\u53ef\u89e3\u51b3\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u95ee\u9898\u3002<\/p>\n<\/p>\n<p>&#061;&#061;<\/p>\n<h2 id=\"%E2%96%A0ManagedExecutorService%20%E8%BF%99%E4%B8%AA%E7%B1%BB%EF%BC%8C%E5%9C%A8%E9%82%A3%E4%B8%AAjar%E4%B8%AD\">\u25a0ManagedExecutorService \u8fd9\u4e2a\u7c7b&#xff0c;\u5728\u90a3\u4e2ajar\u4e2d<\/h2>\n<h4 id=\"%E8%A7%84%E8%8C%83%E5%AE%9A%E4%B9%89%E5%8C%85%EF%BC%88%E9%80%9A%E7%94%A8%EF%BC%89\">\u89c4\u8303\u5b9a\u4e49\u5305&#xff08;\u901a\u7528&#xff09;<\/h4>\n<ul>\n<li>\n<p>\u5305\u540d:\u00a0javax.enterprise.concurrent&#xff08;Java EE 7\/8&#xff09;\u6216\u00a0jakarta.enterprise.concurrent&#xff08;Jakarta EE 9&#043;&#xff09;<\/p>\n<\/li>\n<li>\n<p>API JAR:<\/p>\n<ul>\n<li>\n<p>Java EE 7\/8:\u00a0javax.enterprise.concurrent-api.jar&#xff08;\u4f8b\u5982 WildFly\/JBoss \u63d0\u4f9b&#xff09;<\/p>\n<\/li>\n<li>\n<p>Jakarta EE 9&#043;:\u00a0jakarta.enterprise.concurrent-api.jar<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8bf4\u660e&#xff1a; \u6b64 JAR \u4ec5\u5305\u542b\u63a5\u53e3\u5b9a\u4e49&#xff08;\u5982\u00a0ManagedExecutorService&#xff09;&#xff0c;\u4e0d\u5305\u542b\u5b9e\u73b0\u3002\u5b9e\u73b0\u7531\u5e94\u7528\u670d\u52a1\u5668\u63d0\u4f9b<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"%E6%80%BB%E7%BB%93\">\u603b\u7ed3<\/h4>\n<ul>\n<li>\n<p>\u5f00\u53d1\u9636\u6bb5&#xff1a;\u4f9d\u8d56\u00a0javax.enterprise.concurrent-api\u00a0\u6216\u00a0jakarta.enterprise.concurrent-api\u00a0\u7f16\u5199\u63a5\u53e3\u4ee3\u7801\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd0\u884c\u65f6&#xff1a;\u5b9e\u73b0\u7c7b\u7531\u5e94\u7528\u670d\u52a1\u5668\u63d0\u4f9b&#xff08;\u5982 WebSphere \u7684\u00a0com.ibm.ws.concurrent.jar&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u5efa\u8bae&#xff1a;\u901a\u8fc7\u00a0&#064;Resource\u00a0\u6ce8\u5165\u6216 JNDI \u83b7\u53d6\u5b9e\u4f8b&#xff0c;\u907f\u514d\u624b\u52a8\u521b\u5efa\u7ebf\u7a0b\u6c60<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"%E6%B3%A8%E6%84%8F%EF%BC%9A%E4%B8%8D%E9%80%82%E7%94%A8WebSphere%208.5.5%EF%BC%8C%E6%B2%A1%E6%9C%89%E3%80%90com.ibm.ws.concurrent.jar%E3%80%91%E8%BF%99%E4%B8%AAjar\">\u6ce8\u610f&#xff1a;\u4e0d\u9002\u7528WebSphere 8.5.5&#xff0c;\u6ca1\u6709\u3010com.ibm.ws.concurrent.jar\u3011\u8fd9\u4e2ajar<\/h4>\n<p>WebSphere 8.5.5 \u91cc\u9762\u6ca1\u6709\u00a0<\/p>\n<p>WebSphere 8.5.5<\/p>\n<p>\u57288.5.5\u7248\u672c\u4e2d&#xff0c;\u5e76\u53d1\u5de5\u5177\u7684\u5b9e\u73b0\u901a\u5e38\u5728\u4ee5\u4e0bjar\u5305\u4e2d&#xff1a;<\/p>\n<p>&#8211; &#096;com.ibm.ws.concurrent_1.0.0.jar&#096; (\u5728\u4f20\u7edf\u7248\u672c\u4e2d\u53ef\u80fd\u662f&#096;com.ibm.ws.concurrent.jar&#096;)<\/p>\n<p>&#8211; \u6216\u8005\u5408\u5e76\u5230&#096;com.ibm.ws.runtime.jar&#096;\u4e2d&#xff08;\u56e0\u4e3a\u5e76\u53d1\u5de5\u5177\u662f\u8fd0\u884c\u65f6\u7684\u4e00\u90e8\u5206&#xff09;<span style=\"color:#fe2c24\">\u6709<\/span><\/p>\n<\/p>\n<p>WebSphere 9.0\u53ca\u4ee5\u4e0a<\/p>\n<p>\u57289.0\u53ca\u66f4\u9ad8\u7248\u672c\u4e2d&#xff0c;\u901a\u5e38\u6709\u72ec\u7acb\u7684\u5e76\u53d1jar\u5305&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>&#8211; &#096;com.ibm.ws.concurrent_1.0.0.jar&#096;<\/p>\n<p>&#8211; &#096;com.ibm.ws.concurrent.cdi_1.0.0.jar&#096;&#xff08;\u7528\u4e8eCDI\u96c6\u6210&#xff09;<\/p>\n<h2 id=\"%E5%90%84%E4%B8%AAWebSphere%E7%89%88%E6%9C%AC%E7%9B%B8%E5%85%B3%E7%9A%84jar\">\u25a0\u5404\u4e2aWebSphere\u7248\u672c\u4e2d&#xff0c;\u7ebf\u7a0b&#xff08;\u7ebf\u7a0b\u6c60&#xff09;\u76f8\u5173\u7684jar<\/h2>\n<p>&#061;&#061;&#061;<\/p>\n<p><span style=\"color:#98c091\">\u6211\u5728WebSphere 8.5.5\u4e2d&#xff0c;\u627e\u5230\u4e86runtime.jar,<\/span><span style=\"color:#be191c\">\u4f46\u662f<\/span><span style=\"color:#98c091\">\u91cc\u9762\u6ca1\u6709\u3010com.ibm.ws.threading.WSManagedExecutorService\u3011\u8fd9\u4e2a\u7c7b<\/span><\/p>\n<\/p>\n<p>&#8211; \u786e\u4fdd\u7248\u672c\u81f3\u5c11\u4e3a8.5.5.0&#xff08;\u521d\u59cb\u7248\u672c&#xff09;<\/p>\n<p>&#8211; \u63a8\u8350\u5347\u7ea7\u52308.5.5.20\u6216\u66f4\u9ad8<\/p>\n<\/p>\n<p>2. \u8003\u8651\u529f\u80fd\u7f3a\u5931&#xff1a;<\/p>\n<p>&#8211; <span style=\"color:#fe2c24\">\u67d0\u4e9b\u7cbe\u7b80\u5b89\u88c5\u53ef\u80fd\u672a\u5305\u542b\u5e76\u53d1\u5de5\u5177<\/span><\/p>\n<p>&#8211; \u91cd\u65b0\u5b89\u88c5\u65f6\u9009\u62e9\u201c\u5b8c\u6574\u529f\u80fd\u201d<\/p>\n<\/p>\n<p>3. \u4f7f\u7528\u4f20\u7edfWorkManager&#xff1a;<\/p>\n<p>&#061;&#061;&#061;<\/p>\n<table>\n<tr>WebSphere \u7248\u672c\u5b9e\u73b0\u4f4d\u7f6e\u5b9e\u73b0\u7c7b\u540d<\/tr>\n<tbody>\n<tr>\n<td>8.5.x \u53ca\u66f4\u65e9<\/td>\n<td>lib\/com.ibm.ws.runtime.jar<\/td>\n<td>com.ibm.ws.threading.WSManagedExecutorService<\/td>\n<\/tr>\n<tr>\n<td>9.x&#043;<\/td>\n<td>plugins\/com.ibm.ws.concurrent_*.jar<\/td>\n<td>com.ibm.ws.concurrent.WSManagedExecutorService<\/td>\n<\/tr>\n<tr>\n<td>Liberty<\/td>\n<td>wlp\/lib\/com.ibm.websphere.concurrent_*.jar<\/td>\n<td>com.ibm.ws.concurrent.WSManagedExecutorServiceImpl<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#061;&#061;&#061;<\/p>\n<h2 id=\"WebSphere%20Liberty%20%E6%98%AF%E4%BB%80%E4%B9%88\">\u25a0WebSphere Liberty \u662f\u4ec0\u4e48<\/h2>\n<p>&#061;&#061;&#061;<\/p>\n<p>WebSphere Liberty \u662f IBM \u63a8\u51fa\u7684\u65b0\u4e00\u4ee3\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u5e94\u7528\u670d\u52a1\u5668&#xff0c;\u4e13\u4e3a\u4e91\u539f\u751f\u548c\u5fae\u670d\u52a1\u67b6\u6784\u8bbe\u8ba1\u3002\u5b83\u662f\u4f20\u7edf WebSphere Application Server&#xff08;WAS&#xff09;\u7684\u73b0\u4ee3\u5316\u66ff\u4ee3\u54c1&#xff0c;\u4ee3\u8868\u4e86\u5e94\u7528\u670d\u52a1\u5668\u6280\u672f\u7684\u672a\u6765\u53d1\u5c55\u65b9\u5411\u3002<\/p>\n<h4 id=\"%F0%9F%9A%80%20%E6%A0%B8%E5%BF%83%E7%89%B9%E6%80%A7\">&#x1f680; \u6838\u5fc3\u7279\u6027<\/h4>\n<table>\n<tr>\u7279\u6027\u4f20\u7edf WebSphereWebSphere Liberty<\/tr>\n<tbody>\n<tr>\n<td>\u67b6\u6784<\/td>\n<td>\u5355\u4f53\u5f0f&#xff0c;\u91cd\u91cf\u7ea7<\/td>\n<td>\u6a21\u5757\u5316&#xff0c;\u8f7b\u91cf\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u542f\u52a8\u65f6\u95f4<\/td>\n<td>\u5206\u949f\u7ea7&#xff08;30s-5min&#xff09;<\/td>\n<td>\u79d2\u7ea7&#xff08;&lt;3s&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5185\u5b58\u5360\u7528<\/td>\n<td>\u9ad8&#xff08;GB\u7ea7&#xff09;<\/td>\n<td>\u6781\u4f4e&#xff08;&lt;100MB&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u914d\u7f6e\u65b9\u5f0f<\/td>\n<td>XML &#043; \u63a7\u5236\u53f0<\/td>\n<td>\u58f0\u660e\u5f0f\u914d\u7f6e&#xff08;server.xml&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u8fd0\u884c\u65f6\u6a21\u578b<\/td>\n<td>\u5168\u529f\u80fd\u8fd0\u884c<\/td>\n<td>\u6309\u9700\u52a0\u8f7d\u7279\u6027<\/td>\n<\/tr>\n<tr>\n<td>\u4e91\u652f\u6301<\/td>\n<td>\u6709\u9650<\/td>\n<td>\u539f\u751f\u4e91\u96c6\u6210&#xff08;K8s,OpenShift&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#061;&#061;&#061;<\/p>\n<h4 id=\"%F0%9F%8F%A2%20%E4%B8%8E%E4%BC%A0%E7%BB%9F%20WebSphere%20%E7%9A%84%E5%85%B3%E7%B3%BB\">&#x1f3e2; \u4e0e\u4f20\u7edf WebSphere \u7684\u5173\u7cfb<\/h4>\n<table>\n<tr>\u7ef4\u5ea6WebSphere TraditionalWebSphere Liberty<\/tr>\n<tbody>\n<tr>\n<td>\u5b9a\u4f4d<\/td>\n<td>\u4f01\u4e1a\u7ea7\u5173\u952e\u4e1a\u52a1\u7cfb\u7edf<\/td>\n<td>\u4e91\u539f\u751f\/\u5fae\u670d\u52a1\/\u654f\u6377\u5f00\u53d1<\/td>\n<\/tr>\n<tr>\n<td>\u8bb8\u53ef\u8bc1<\/td>\n<td>\u9700\u5355\u72ec\u8d2d\u4e70<\/td>\n<td>\u514d\u8d39\u5f00\u53d1\u8005\u7248\u00a0&#043; \u5546\u4e1a\u7248<\/td>\n<\/tr>\n<tr>\n<td>\u8fc1\u79fb\u8def\u5f84<\/td>\n<td>&#8211;<\/td>\n<td>\u63d0\u4f9b\u00a0\u4f20\u7edf\u5230Liberty\u8fc1\u79fb\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td>\u7ba1\u7406\u65b9\u5f0f<\/td>\n<td>\u96c6\u4e2d\u5f0f\u7ba1\u7406\u63a7\u5236\u53f0<\/td>\n<td>REST API &#043; \u547d\u4ee4\u884c &#043; \u56fe\u5f62\u754c\u9762<\/td>\n<\/tr>\n<tr>\n<td>\u7248\u672c\u66f4\u65b0<\/td>\n<td>\u5e74\u5ea6\u5927\u7248\u672c<\/td>\n<td>\u5b63\u5ea6\u6eda\u52a8\u66f4\u65b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#061;&#061;&#061;<\/p>\n<h2 id=\"%E2%96%A0%E6%88%91%E5%9C%A8WebSphere%208.5.5%E4%B8%AD%EF%BC%8C%E6%89%BE%E5%88%B0%E4%BA%86runtime.jar%2C%E4%BD%86%E6%98%AF%E9%87%8C%E9%9D%A2%E6%B2%A1%E6%9C%89%E3%80%90com.ibm.ws.threading.WSManagedExecutorService%E3%80%91%E8%BF%99%E4%B8%AA%E7%B1%BB\"><span style=\"color:#4da8ee\">\u25a0\u6211\u5728WebSphere 8.5.5\u4e2d&#xff0c;\u627e\u5230\u4e86runtime.jar,\u4f46\u662f\u91cc\u9762\u6ca1\u6709\u3010com.ibm.ws.threading.WSManagedExecutorService\u3011\u8fd9\u4e2a\u7c7b<\/span><\/h2>\n<p>&#061;&#061;&#061;<\/p>\n<p><span style=\"color:#be191c\">com.ibm.ws.threading.ThreadPoolManager \u8fd9\u91cc\u7c7b\u4e5f\u6ca1\u6709\u5440&#xff0c;\u6839\u672c\u5c31\u4e0d\u5b58\u5728\u00a0com.ibm.ws.threading \u8fd9\u4e2a\u5305\u3002<\/span><\/p>\n<p>&#061;&#061;&#061;<\/p>\n<h4 id=\"%F0%9F%94%8D%20%E6%A0%B9%E6%9C%AC%E5%8E%9F%E5%9B%A0%E5%88%86%E6%9E%90\">&#x1f50d; \u6839\u672c\u539f\u56e0\u5206\u6790<\/h4>\n<p>\u5728 WebSphere 8.5.5 \u4e2d&#xff1a;<\/p>\n<li>\n<p>ManagedExecutorService\u00a0\u7684\u5b9e\u73b0\u4e0d\u662f\u901a\u8fc7\u5355\u72ec\u7684\u7c7b \u800c\u662f\u901a\u8fc7\u52a8\u6001\u4ee3\u7406\u673a\u5236\u5b9e\u73b0<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u9645\u5de5\u4f5c\u7c7b&#xff1a; com.ibm.ws.threading.ThreadPoolManager<\/p>\n<\/li>\n<li>\n<p>\u4f4d\u7f6e&#xff1a; plugins\/com.ibm.ws.runtime.jar\u00a0(\u4e0d\u662f\u00a0lib\/\u00a0\u76ee\u5f55)<\/p>\n<\/li>\n<p>&#061;&#061;&#061;<\/p>\n<p># Linux\/Unix<br \/>\njar -tvf $WAS_INSTALL_ROOT\/plugins\/com.ibm.ws.runtime.jar | grep ThreadPoolManager<\/p>\n<p># Windows<br \/>\njar -tvf &#034;%WAS_INSTALL_ROOT%\\\\plugins\\\\com.ibm.ws.runtime.jar&#034; | findstr ThreadPoolManager <\/p>\n<h4 id=\"%E7%B1%BB%E3%80%90com.ibm.ws.threading.ThreadPoolManager%E3%80%91%E4%B9%9F%E6%B2%A1%E6%9C%89%E6%89%BE%E5%88%B0%EF%BC%8C%E8%80%8C%E4%B8%94%E6%A0%B9%E6%9C%AC%E4%B8%8D%E5%AD%98%E5%9C%A8%C2%A0com.ibm.ws.threading%20%E8%BF%99%E4%B8%AA%E5%8C%85%E3%80%82\">\u7c7b<span style=\"color:#956fe7\">\u3010<\/span>com.ibm.ws.threading.ThreadPoolManager\u3011\u4e5f\u6ca1\u6709\u627e\u5230&#xff0c;\u800c\u4e14\u6839\u672c\u4e0d\u5b58\u5728\u00a0com.ibm.ws.threading \u8fd9\u4e2a\u5305\u3002<\/h4>\n<p>&#061;&#061;&#061;<\/p>\n<p><span style=\"color:#98c091\">\u867d\u7136\u627e\u5230\u4e86runtime.jar,\u4f46\u662f&#xff0c;jar\u91cc\u9762\u6ca1\u6709\u3010<\/span><span style=\"color:#956fe7\">com.ibm.ws.threading<\/span><span style=\"color:#98c091\">\u3011\u8fd9\u4e2a\u5305<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"534\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231133-684a0d2527845.png\" width=\"861\" \/><\/p>\n<p>&#061;&#061;&#061;<\/p>\n<h2 id=\"%E2%96%A0WorkManager\"><span style=\"color:#956fe7\">\u25a0WorkManager &#xff08;\u3010JNDI\u3011wm\/default&#xff09;(\u8fd9\u4e2a\u6709&#xff0c;\u95ee\u989890%\u4ee5\u4e0a\u53ef\u7528\u89e3\u51b3)<\/span><\/h2>\n<p><span style=\"color:#956fe7\">&#061;&#061;&#061;<\/span><\/p>\n<p>ls $WAS_INSTALL_ROOT\/AppServer\/lib\/asynchbeans.jar<\/p>\n<p><span style=\"color:#956fe7\">&#061;&#061;&#061;&#061;<\/span><\/p>\n<h4 id=\"0.%20%E4%BB%A3%E7%A0%81\">0. \u4ee3\u7801<\/h4>\n<p><span style=\"color:#956fe7\">&#061;&#061;<\/span><\/p>\n<p>import com.ibm.websphere.asynchbeans.Work;<br \/>\nimport com.ibm.websphere.asynchbeans.WorkManager;<br \/>\nimport javax.naming.InitialContext;<br \/>\nimport javax.servlet.annotation.WebServlet;<br \/>\nimport javax.servlet.http.HttpServlet;<\/p>\n<p>&#064;WebServlet(&#034;\/workManager&#034;)<br \/>\npublic class WorkManagerServlet extends HttpServlet {<\/p>\n<p>    protected void doGet(javax.servlet.http.HttpServletRequest request,<br \/>\n                         javax.servlet.http.HttpServletResponse response) {<\/p>\n<p>        try {<br \/>\n            WorkManager wm &#061; (WorkManager) new InitialContext()<br \/>\n                .lookup(&#034;java:comp\/env\/wm\/default&#034;);<\/p>\n<p>            wm.startWork(new Work() {<br \/>\n                &#064;Override<br \/>\n                public void run() {<br \/>\n                    System.out.println(&#034;Task running via WorkManager&#034;);<br \/>\n                    performTask();<br \/>\n                }<\/p>\n<p>                &#064;Override<br \/>\n                public void release() {<br \/>\n                    \/\/ \u6e05\u7406\u8d44\u6e90<br \/>\n                }<br \/>\n            });<br \/>\n        } catch (Exception e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<br \/>\n    }<\/p>\n<p>    private void performTask() {<br \/>\n        \/\/ \u540c\u4e0a<br \/>\n    }<br \/>\n} <\/p>\n<p>&#061;&#061;&#061;<\/p>\n<h4 id=\"1.%20%E5%90%AF%E7%94%A8%E5%BC%82%E6%AD%A5%20Beans%20%E6%94%AF%E6%8C%81\">1. \u542f\u7528\u5f02\u6b65 Beans \u652f\u6301<\/h4>\n<p>\u5728 WebSphere \u63a7\u5236\u53f0\u4e2d&#xff1a; &#xff08;\u5b9e\u9645WebSphere\u753b\u9762&#xff0c;\u548c\u4e0b\u9762\u4e0d\u592a\u76f8\u7b26&#xff09;<\/p>\n<li>\n<p>\u5bfc\u822a\u5230&#xff1a;\u5e94\u7528\u7a0b\u5e8f\u670d\u52a1\u5668 &gt; [\u60a8\u7684\u670d\u52a1\u5668] &gt; \u5bb9\u5668\u670d\u52a1 &gt; \u5f02\u6b65 Beans<\/p>\n<\/li>\n<li>\n<p>\u52fe\u9009\u00a0\u542f\u7528\u5f02\u6b65 Beans \u652f\u6301<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u5e76\u91cd\u542f\u670d\u52a1\u5668<\/p>\n<\/li>\n<p>&#061;&#061;<\/p>\n<h4 id=\"2.%20%E9%85%8D%E7%BD%AE%E8%B5%84%E6%BA%90%E5%BC%95%E7%94%A8\">2. \u914d\u7f6e\u8d44\u6e90\u5f15\u7528<\/h4>\n<p>\u5728\u00a0web.xml\u00a0\u4e2d\u6dfb\u52a0&#xff1a;<\/p>\n<p>&lt;resource-ref&gt;<br \/>\n    &lt;res-ref-name&gt;wm\/default&lt;\/res-ref-name&gt;<br \/>\n    &lt;res-type&gt;com.ibm.websphere.asynchbeans.WorkManager&lt;\/res-type&gt;<br \/>\n&lt;\/resource-ref&gt; <\/p>\n<p>\u5728\u00a0ibm-web-bnd.xml\u00a0\u4e2d\u6dfb\u52a0\u7ed1\u5b9a&#xff1a;<\/p>\n<p>&lt;resource-ref name&#061;&#034;wm\/default&#034;<br \/>\n              binding-name&#061;&#034;java:comp\/env\/wm\/default&#034;\/&gt; <\/p>\n<p>&#061;&#061;&#061;<\/p>\n<h4 id=\"3.%E5%AE%9E%E9%99%85WebSphere%E7%94%BB%E9%9D%A2\">3.\u5b9e\u9645WebSphere\u753b\u9762<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"875\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231133-684a0d254dfed.png\" width=\"1091\" \/><\/p>\n<p>&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"761\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231133-684a0d25a6b99.png\" width=\"1143\" \/><\/p>\n<p>&#061;&#061;&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"709\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231134-684a0d260039b.png\" width=\"1158\" \/><\/p>\n<p>&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"813\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231134-684a0d2649978.png\" width=\"1108\" \/><\/p>\n<p>&#061;&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"782\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231134-684a0d269f968.png\" width=\"1081\" \/><\/p>\n<p>&#061;&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"848\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231135-684a0d2703156.png\" width=\"1646\" \/><\/p>\n<p>&#061;&#061;<\/p>\n<h4 id=\"4.%E5%85%B3%E4%BA%8E%E3%80%90resource%20references%E3%80%91%E9%9C%80%E8%A6%81%E5%9C%A8%E5%AE%89%E8%A3%85%E6%97%B6%E6%8C%87%E5%AE%9A%E3%80%82\">4.\u5173\u4e8e\u3010resource references\u3011\u9700\u8981\u5728\u5b89\u88c5\u65f6\u6307\u5b9a\u3002<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"888\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231135-684a0d2793446.png\" width=\"1723\" \/><\/p>\n<p>&#061;&#061;<\/p>\n<p>\u5b89\u88c5\u524d\u7684web.xml<\/p>\n<p>\u4f7f\u7528\u4e0b\u9762\u7684ear\u518d\u6539\u9020\u4e00\u4e0b<\/p>\n<p>hello-world-ear\/EnterpriseHelloWorld.ear at master \u00b7 imago-storm\/hello-world-ear \u00b7 GitHub<\/p>\n<p>&lt;web-app xmlns&#061;&#034;http:\/\/xmlns.jcp.org\/xml\/ns\/javaee&#034; xmlns:xsi&#061;&#034;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#034; xsi:schemaLocation&#061;&#034;http:\/\/xmlns.jcp.org\/xml\/ns\/javaee http:\/\/xmlns.jcp.org\/xml\/ns\/javaee\/web-app_3_1.xsd&#034; version&#061;&#034;3.1&#034;&gt;<\/p>\n<p>&lt;session-config&gt;<br \/>\n    &lt;session-timeout&gt; 30 &lt;\/session-timeout&gt;<br \/>\n&lt;\/session-config&gt;<br \/>\n&lt;welcome-file-list&gt;<br \/>\n    &lt;welcome-file&gt;index.html&lt;\/welcome-file&gt;<br \/>\n&lt;\/welcome-file-list&gt;<\/p>\n<p>&lt;resource-ref&gt;<br \/>\n    &lt;res-ref-name&gt;wm\/default&lt;\/res-ref-name&gt;<br \/>\n    &lt;res-type&gt;com.ibm.websphere.asynchbeans.WorkManager&lt;\/res-type&gt;<br \/>\n&lt;\/resource-ref&gt;<\/p>\n<p>&lt;resource-ref&gt;<br \/>\n    &lt;description&gt;Resource reference for database&lt;\/description&gt;<br \/>\n    &lt;res-ref-name&gt;jdbc\/dbname&lt;\/res-ref-name&gt;<br \/>\n    &lt;res-type&gt;javax.sql.DataSource&lt;\/res-type&gt;<br \/>\n    &lt;res-auth&gt;Container&lt;\/res-auth&gt;<br \/>\n&lt;\/resource-ref&gt;<\/p>\n<p>&lt;\/web-app&gt; <\/p>\n<p>&#061;&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"828\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231136-684a0d282f200.png\" width=\"1266\" \/><\/p>\n<p>&#061;&#061;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"940\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231136-684a0d2885395.png\" width=\"1573\" \/><\/p>\n<p>&#061;&#061;&#061;<\/p>\n<h4 id=\"5.WorkManager%E7%9B%B8%E5%85%B3%E7%9A%84JNDI%E3%80%90wm%2Fdefault%E3%80%91%E8%AE%BE%E5%AE%9A%E5%90%8E%E7%9A%84%E6%95%88%E6%9E%9C\">5.WorkManager\u76f8\u5173\u7684JNDI\u3010wm\/default\u3011\u8bbe\u5b9a\u540e\u7684\u6548\u679c<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"815\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231137-684a0d2943948.png\" width=\"1168\" \/><\/p>\n<p>&#061;&#061;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb866\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf6\u6b21\u3002Web\u5e94\u7528\u4e2d\uff0c\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387\uff0c\u67d0\u6bb5\u548c\u4e3b\u4e1a\u52a1\u65e0\u5173\u7684\u5904\u7406\uff0c\u4f7f\u7528\u5f02\u6b65\u5904\u7406\u6765\u5904\u7406\u3002\uff08\u4f7f\u7528\u7684\u670d\u52a1\u5668\u662fWebSphere\uff09\u7ed3\u679c\u62a5\u5982\u4e0b\u9519\u8bef\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u9020\u6210\u7684\uff0c\u56e0\u6b64\uff0c\u6574\u7406\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u3002<\/p>\n","protected":false},"author":2,"featured_media":43327,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4020,99,1583,87,43],"topic":[],"class_list":["post-43338","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-websphere","tag-java","tag-java-web","tag-87","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/43338.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb866\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf6\u6b21\u3002Web\u5e94\u7528\u4e2d\uff0c\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387\uff0c\u67d0\u6bb5\u548c\u4e3b\u4e1a\u52a1\u65e0\u5173\u7684\u5904\u7406\uff0c\u4f7f\u7528\u5f02\u6b65\u5904\u7406\u6765\u5904\u7406\u3002\uff08\u4f7f\u7528\u7684\u670d\u52a1\u5668\u662fWebSphere\uff09\u7ed3\u679c\u62a5\u5982\u4e0b\u9519\u8bef\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u9020\u6210\u7684\uff0c\u56e0\u6b64\uff0c\u6574\u7406\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/43338.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-11T23:11:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231133-684a0d2527845.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/43338.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/43338.html\",\"name\":\"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-11T23:11:38+00:00\",\"dateModified\":\"2025-06-11T23:11:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/43338.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/43338.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/43338.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/43338.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb866\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf6\u6b21\u3002Web\u5e94\u7528\u4e2d\uff0c\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387\uff0c\u67d0\u6bb5\u548c\u4e3b\u4e1a\u52a1\u65e0\u5173\u7684\u5904\u7406\uff0c\u4f7f\u7528\u5f02\u6b65\u5904\u7406\u6765\u5904\u7406\u3002\uff08\u4f7f\u7528\u7684\u670d\u52a1\u5668\u662fWebSphere\uff09\u7ed3\u679c\u62a5\u5982\u4e0b\u9519\u8bef\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u9020\u6210\u7684\uff0c\u56e0\u6b64\uff0c\u6574\u7406\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/43338.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-11T23:11:38+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250611231133-684a0d2527845.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/43338.html","url":"https:\/\/www.wsisp.com\/helps\/43338.html","name":"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-11T23:11:38+00:00","dateModified":"2025-06-11T23:11:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/43338.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/43338.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/43338.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010java\u3011\u3010\u670d\u52a1\u5668\u3011\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u4e22\u5931 \u662f\u6307\u4ec0\u4e48\uff0c\u3010WebSphere\u4e2d\u5982\u4f55\u89e3\u51b3\u3011"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/43338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=43338"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/43338\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/43327"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=43338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=43338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=43338"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=43338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}