在Jetty中运行servlet时获取HTTP 500 [英] Getting HTTP 500 when running servlet in Jetty

查看:274
本文介绍了在Jetty中运行servlet时获取HTTP 500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个servlet运行正常,直到前几天。但是我唯一改变的是我用于maven的nexus repo。我通过mvn jetty运行servlet:运行



但是当我尝试访问该网站而不是看到主页时,我看到:

  HTTP错误500 

问题访问/。原因:

jregex / Pattern

我可以访问其他网址的/favicon.ico。但是我在这个jregex / Pattern错误中找不到任何东西,而且看起来并不像jregex库正在使用代码。



我也不要在日志中看到任何问题。看起来,主页的请求不会发送到我的servlet,而是请求其他页面。



这是在Arch Linux和Mac OS X 10.7上发生的。 p>

这几乎肯定是一个依赖关系问题,因为替换了我的〜/ .m2 文件夹与旧的旧的nexus服务器)它的工作。



有时我也得到:

  HTTP错误:503 

访问/。原因:

SERVICE_UNAVAILABLE


解决方案

我将首先比较您更改 pom之前和之后创建的耳朵 / war .XML 。这应该会导致您更改的jar文件。一切都是开源的,从maven repo下载源码并进行比较。 \



编辑: JRegex 是一个java库, Perl regexp支持。
也许更改maven repo导致下载其他版本的依赖关系,并且它们与JRegex有一些可选的依赖关系。 (你应该可以检查)。



尝试将JRegex添加到依赖关系中,看看会发生什么。 (请注意,如果您是在生产中,并且匆忙,那么这可能是一种解决方法)


I have a servlet that was running fine until a few days ago. But the only thing that I've changed is the nexus repo I'm using for maven. I'm running the servlet via mvn jetty:run

But when I try to access the site instead of seeing the home page, I see:

HTTP ERROR 500

Problem accessing /. Reason:

    jregex/Pattern

I can access other url's fine such as /favicon.ico. But I can't find anything on this jregex/Pattern error and it doesn't look like the jregex library is being used in the code at all.

I also don't see any problems in the logs. It looks like requests for the homepage are not making it to my servlet but requests for other pages are.

This is happening on both Arch Linux and Mac OS X 10.7

This is almost certainly a dependency issue because after replacing my ~/.m2 folder with an old one (with dependencies from the old nexus server) it works.

Sometimes I also get:

HTTP ERROR: 503

Problem accessing /. Reason:

    SERVICE_UNAVAILABLE

解决方案

I would start with comparing the ear / war file created before and after you changed your pom.xml. This should lead you to jar files that were changed. Assumming everything is open source, download sources from maven repo and compare them. \

Edit: JRegex is a java library with Perl regexp support. Perhaps changing maven repo caused downloading other versions of your dependencies, and they have some optional dependency to JRegex. (You should be able to check that).

Try adding JRegex to your dependencies and see what happens. (Note this whould be a workaround if you're in production and in a hurry)

这篇关于在Jetty中运行servlet时获取HTTP 500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆