解决weblogic.net.http.SOAPHttpsURLConnection incompatible with javax.net.ssl.HttpsURLConnection

1. 按照网上的办法,可以修改代码解决问题,但是由于我们使用的是别人的jar包,不能修改代码,:
URL url = new URL(null, "https://www.baidu.",new sun.net.www.protocol.https.Handler());
// 指定了handler后openConnection()返回了HttpsURLConnection类型对象
 HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();

2. 配置weblogic,在startWeblogic.sh文件中添加参数:-DUseSunHttpHandler=true,我最终添加了一行:MEM_ARGS="${MEM_ARGS} -DUseSunHttpHandler=true"
     
路径

${DOMAIN_HOME}/bin/startWebLogic.sh

修改(红色为要添加的):

===============================================================

if [ "${DERBY_FLAG}" = "true" ] ; then
         ${WL_HOME}/common/derby/bin/startNetworkServer.sh  >"${DOMAIN_HOME}/derby.log" 2>&1 

fi

JAVA_OPTIONS="${SAVE_JAVA_OPTIONS}  -DUseSunHttpHandler=true"

SAVE_JAVA_OPTIONS=""

CLASSPATH="${SAVE_CLASSPATH}"

SAVE_CLASSPATH=""

trap 'stopAll' 1 2 3 15
========================================

 

 

posted @ 2016-10-26 16:09  Earic  阅读(3346)  评论(0编辑  收藏  举报