微信公众号开发将war包导入新浪sae出现错误
Posted gavanwanggw
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了微信公众号开发将war包导入新浪sae出现错误相关的知识,希望对你有一定的参考价值。
JAVA_Error: Error for /wechat.do
java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58)
at demo.process.TulingApiProcess.getTulingResult(TulingApiProcess.java:39)
at demo.process.WechatProcess.processWechatMag(WechatProcess.java:23)
at demo.servlet.WechatServlet.doPost(WechatServlet.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)
java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58)
at demo.process.TulingApiProcess.getTulingResult(TulingApiProcess.java:39)
at demo.process.WechatProcess.processWechatMag(WechatProcess.java:23)
at demo.servlet.WechatServlet.doPost(WechatServlet.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478) yq32.javaruntime
百度没有百度到 FQ去google说是可能是httpclient包冲突的问题 可是war包中仅仅有一个,没有办法去了新浪云计算平台开发论坛。
最后知道真相的我眼泪掉下来原来新浪sae临时仅仅支持httpclient4.1.x。
然后换成http4.1.x结果成功了。另附新浪sae的说明文档提供的
地址下载完整的jar包依赖包链接:http://sae4java.sinaapp.com/lib/sae-1.1.0-depend.zip
总结:以后使用一些第三方平台一定要事先阅读其说明文档。避免像无头苍蝇一样胡乱百度。
以上是关于微信公众号开发将war包导入新浪sae出现错误的主要内容,如果未能解决你的问题,请参考以下文章
使用新浪云(SAE)实现基于mySql和微信公众平台的关键字请求响应服务
从Python爬虫到SAE云和微信公众号:新浪SAE上搭建微信服务