0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PinpointのWebSphere PluginをOpenLibertyに対応する

Last updated at Posted at 2022-01-08

WebSphere PluginをOpenLibertyにデプロイして、うまく動かないことが分かりました。
Githubコミュニティに見た感じに、現時点にOpenLibertyの動作にまだ対応されていないです。
本文には、対応できる方法を説明します。

1)libertyのbootstrap.propertiesに以下の設定を追加する
org.osgi.framework.bootdelegation=com.navercorp.pinpoint.bootstrap.,com.navercorp.pinpoint.common.,com.navercorp.pinpoint.exception.,com.navercorp.pinpoint.profiler.

2)WebspherePlugin.java
①#addWSWebContainer()に以下のように変更する
transformTemplate.transform("com.ibm.ws.webcontainer.WSWebContainer", WSWebContainerTransform.class);

transformTemplate.transform("com.ibm.ws.webcontainer.WebContainer", WSWebContainerTransform.class);
②WSWebContainerTransform#doInTransform()に以下のように変更
target.getDeclaredMethod("handleRequest","com.ibm.websphere.servlet.request.IRequest", "com.ibm.websphere.servlet.response.IResponse","com.ibm.ws.webcontainer.VirtualHost", "com.ibm.wsspi.webcontainer.RequestProcessor");

3)WebsphereDetector.javaの変更
DEFAULT_EXPECTED_MAIN_CLASSの定数値を以下のように変更する
private static final String DEFAULT_EXPECTED_MAIN_CLASS = "com.ibm.ws.kernel.boot.cmdline.EnvCheck";

4)java-ibmフォルダに以下のクラスを作成する
①com.ibm.websphere.servlet.response.StoredResponse.java
public IResponse getIResponse() {
return null;
}
public int getStatusCode() {
return 0;
}
②com.ibm.ws.webcontainer.VirtualHost.java
//dummy
③com.ibm.wsspi.webcontainer.RequestProcessor.java ※インタフェース
public void handleRequest(ServletRequest req, ServletResponse res) throws Exception;

動かしてみた結果
image.png

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?