Getting “java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet” in Eclipse + jboss 5.1.0

删除回忆录丶 提交于 2019-12-05 09:45:33

First of RestEasy is only supported out the box from version 6 of JBoss IIRC.

Heres a link to the rest easy website if you do need to download it. http://www.jboss.org/resteasy

  1. I make the assumption that you allready have a Preferences>Server>Runtime Environment> configured for JBoss. If not do that first.

  2. Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet. This tells me that if you got 1 above right you have not added it to your buildpath yet as Properties>Java Build Path>Add Library>Server Runtime. The runtime contains the servletapi.

  3. org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap lives in the resteasy-jaxrs-2.3.0.GA.jar jar. Dump it in your WEB_INF/lib folder. DO NOT add it to your build path via Eclipse. Eclipse takes care of that it self.

  4. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher. Same as 3 above.

  5. <param-name>resteasy.scan</param-name> This functionality I believe is a runtime dependency and lives in the scannotation-1.0.3.jar. Dump it in WEB_INF/lib. Again, Eclipse takes care of the classpath.

  6. This is after all a JAX-RS project so dump jaxrs-api-2.3.0.GA.jar to your in WEB_INF/lib. This will bring in the @Path, @Get, etc annotations for use in your resource classes.

  7. I also have jaxb-api-2.2.3.jar, javassist-3.8.0.GA.jar and jackson-jaxrs-1.8.5.jar in my WEB-INF/lib but from here on out it depends what functionality you are going to use and which providers loggers etc.


I hope I nailed the essentials jars, if anyone spots a missing one please correct. My first try at JAX-RS I just dumped the whole shebang of 56 jars in WEB-INF/lib (Not a good idea)

Have Fun!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!