简体   繁体   English

Tomcat Servlet中的内部服务器错误

[英]Internal server error in a tomcat servlet

I am writing a java servlet for a REST interface using jersey. 我正在使用Jersey为REST接口编写Java servlet。 I have the following really weird problem: As soon as I POST to some resource I receive an internal server error (status 500). 我有以下非常奇怪的问题:一旦我发布到某些资源,就会收到内部服务器错误(状态500)。 the localhost_access_log*.txt shows entries of the form localhost_access_log * .txt显示以下形式的条目

0:0:0:0:0:0:0:1 - - [27/Jan/2015:18:04:30 +0100] "POST /server/rest/requests HTTP/1.1" 500 1039

indicating the problem. 表明问题所在。 However, I see no concrete error message, ie some kind of exception being thrown on the console (I am currently using eclipse). 但是,我没有看到具体的错误消息,即控制台上引发了某种异常(我目前正在使用eclipse)。 After the indication 指示后

INFO: Server startup in 5476 ms

Nothing appears any more. 什么也没有出现。 The start goes smooth without any problems as well. 开始也很顺利,也没有任何问题。 Also, it seems like the error occurs before any of my handler code is executed, as a corresponding breakpoint in eclipse is never reached. 另外,由于从未到达eclipse中的相​​应断点,因此似乎在执行我的任何处理程序代码之前就发生了错误。 Does anyone have any ideas on how to get a handle on what is actually happening? 是否有人对如何处理实际发生的事情有任何想法?

Well, I finally got it. 好吧,我终于明白了。 I was using genson to convert between JSON / Java classes. 我正在使用genson在JSON / Java类之间进行转换。 Unfortunately the package silently fails when it receives malformed input and the server reacts by returning the internal error message... 不幸的是,当程序包收到格式错误的输入并且服务器通过返回内部错误消息做出反应时,它默默地失败了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM