Changing HttpURLConnection in running jvm

允我心安 提交于 2019-12-07 16:10:00

问题


Is it possible to change the http handler in jax-ws? For example: from weblogic.net.http.HttpURLConnection to sun.net.www.protocol.http.HttpURLConnection.


回答1:


you can try to using -DUseSunHttpHandler=true in the weblogic.

manage weblogic by using WLST (non-clustered)

add jvm arguments in the managered server env script under $WLS_DOMAIN_HOME/bin/setDomainEnv.sh

  JAVA_OPTIONS=-DUseSunHttpHandler=true 
  export JAVA_OPTIONS 

manage weblogic by using Weblogic console (Clustered)

Add -DUseSunHttpHandler=true to Arguments in a or b.

  • In Admin Console navigate to Home > Summary of Servers > <managed server name> > Configuration > Server Start Tab.

  • In the config file $WLS_DOMAIN_HOME/config/config.xml with xml-path server > server-start > arguments




回答2:


Implement your own URLConnectionFactory, which resturns the desired HttpURLConnection and set it when constructing the Jersey Client.

URLConnectionClientHandler urlConnectionClientHandler = new URLConnectionClientHandler(
    new MyURLConnectionFactory());
Client client = new Client(urlConnectionClientHandler);


来源:https://stackoverflow.com/questions/11546023/changing-httpurlconnection-in-running-jvm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!