使用oss上传文件到阿里云oss报错:
While executing [invoke] encountered [java.lang.NoClassDefFoundError] : [Could not initialize class org.apache.http.impl.conn.ManagedHttpClientConnectionFactory at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.(PoolingHttpClientConnectionManager.java:572)
原因:必须将阿里云oss的jar包优先载入(否则会载入低版本的httpclient httpcore的jar包导致阿里云oss删除出错)
所以 classpath 优先写下面的路劲:
tibco.class.path.extended /opt/tibco/tpcl/5.9/jdbc/httpclient-4.4.1.jar:/opt/tibco/tpcl/5.9/jdbc/httpcore-4.4.1.jar:
最好同时注释掉以下行:
#bw.plugin.http.client.usePersistentConnectionManager=true
#bw.plugin.http.client.usePersistentConnectionManagerForSSL=true
网友评论