网上很多人提到war包部署出现如下错误问题:
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/catering/cater_chain
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1360)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1354)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1008)
at com.test.TestJson.sendRequest(TestJson.java:177)
at com.test.TestJson.main(TestJson.java:148)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/catering/cater_chain
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at com.test.TestJson.sendRequest(TestJson.java:176)
... 1 more |
在我项目中也遇到同样的问题。(服务端与客户端以接口数据流的形式交互(json))
部署描述
|
异常情况
|
1.通过MyEclipse部署到jetty-6.1.14
|
接口访问正常
|
IE访问正常
|
2.通过war部署到jetty-6.1.14
|
接口访问正常
|
IE访问正常
|
3.通过MyEclipse部署到apache-tomcat-7.0.34
|
接口访问正常
|
IE访问正常
|
4.通过war部署到apache-tomcat-7.0.34
|
接口访问异常
|
IE访问正常
|
解决方法:
1. 服务端使用response.getWriter().print("message");可解决。
我之前使用的模式是:
client(send json[IO])-->
(get json[IO])server(send json[request])-->
(get json[request])view(send view_json[IO])-->
client
2. 在tomcat的F:\Program Files\apache-tomcat-7.0.34\lib目录下添加一个jar包:javax.servlet.jsp.jstl.jar可解决。
|
分享到:
相关推荐
java.io.IOException: Server returned HTTP response code: 403 for URL 处理过程记录 BASIC AUTH2 POST接口,解决403问题
解决删除目录提示:System.IO.IOException: 目录不是空的
java.security.InvalidKeyException:illegal Key Size 微信开发过程中,JDK6的版本
Eclipse 进行 ANT 时错误 Javadoc failed java.io.IOException Cannot run program javadoc
NULL 博文链接:https://yizhilong28.iteye.com/blog/1154098
把 java 代码直接改成 jsp,上传时产生 如下异常: 2012-12-31 8:59:21 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet jsp threw exception java.io.IOException: ...
本人的一片博客,http://blog.csdn.net/jackieriver/article/details/78882194,所需要的一些插件
针对java.io.IOException: entity content is too long [180278508] for the configured buffer limit [157286400]异常,将 DEFAULT_BUFFER_LIMIT修改为150M
it.sauronsoftware.jave.EncoderException: java.io.IOException: Cannot run program "C:\Users\moxiao\AppData\Local\Temp\jave-1\ffmpeg.exe": CreateProcess error=740, 请求的操作需要提升。 在最新的liunx ...
Http-Multipart-Data-Parser-master,如需要http post接口开发、http post传文件等操作可以参考,源码的最原始地址忘记了,这个是从上面down下来新版,各位可参考
复制并覆盖%JAVA_HOME%/jre/lib/security下的local_policy.jar 和 US_export_policy.jar
Android Build 时报错: java.io.IOException: Could not parse XML from android/accounts/annotati...Android构建时报错: app:lintVitalRelease[Fatal Error] :3:214: 与元素类型 “item” 相关联的 “name” ...
Java.io.IOException: The same input jar [E:\Android\myProgram\angel\libs\alipaySdk-20160825.jar] is specified twice. 首先 看一下我项目中关于此jar的配置,我在libs中导入了alipaySdk-20160825.jar,
报错:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.-附件资源
JSSE(Java Security Socket Extension) 是Sun为了解决在Internet上的实现安全信息传输的解决方案。它实现了SSL和TSL(传输层安全)协议。在JSSE中包含了数据加密,服务器验证,消息完整性和客户端验证等技术。通过...
android 二进制xml 解析。AXMLPrinter2反编译的时候报错解决
java安装路径Java\jre\lib\security下替换这两个架包,即可解决 java.security.cert.CertificateException: Unable to initialize, java.io.IOException: Short read of DER length
通过解读源码,在windows下ok,而在linux下解析格式有所不同才导致上面的各种异常,最终修改了源码包中的Encoder.java,整合ffmpeg-2.7.2-x64版本 参考文献: 1、jave-1.0.2源码下载地址:...
Exception in thread “main” java. lang . UnsatisfiedLinkError: org. apache . hadoop. io. nativeio. NativeIOSWindows . access0 (Ijava/ lang/String;I)Z 原因:在调用NativeIO中的...