我在JBoss Seam应用程序中使用RestEasy而且我得到一个奇怪的异常,但这并不是很有用。我的Seam 2.2.2.GA应用程序中有以下罐子:
我已经设置了我的资源路径,如下所示:
@Path("/chartSvc")
@Stateless
@Name("chartAction")
@Scope(ScopeType.CONVERSATION)
public class ChartAction implements Serializable, ChartActionLocal{
public ChartAction() {}
@GET
@Path("/populateChart")
@Produces("text/plain")
public String populateChart() {
String chartData = generateDummyChartData();
return chartData;
}
现在当我尝试在/ seam / resource / svc / chartSvc / populateChart访问我的URL时,我得到了这个例外:
javax.servlet.ServletException: Servlet execution threw an exception
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:63)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
root cause
java.lang.NoSuchMethodError: org.jboss.resteasy.specimpl.PathSegmentImpl.parseSegments(Ljava/lang/String;)Ljava/util/List;
org.jboss.seam.resteasy.ResteasyResourceAdapter.extractUriInfo(ResteasyResourceAdapter.java:198)
org.jboss.seam.resteasy.ResteasyResourceAdapter$1.process(ResteasyResourceAdapter.java:128)
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
org.jboss.seam.resteasy.ResteasyResourceAdapter.getResource(ResteasyResourceAdapter.java:121)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:63)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
我的资源从未被触及,这表明这可能是我的设置,但我不知道从哪里开始调试,因为我确信我有所有正确版本的库。任何人都可以帮我开始调试吗?这是我的第一个接缝应用。
答案 0 :(得分:1)
问题结果是rest easy-jaxrs.jar和jboss-seam-resteasy.jar之间的版本不兼容。 jboss-seam-resteasy.jar是2.2.0.GA,其余的是easy-jaxrs.jar。但是,你需要resteasy-jaxrs.jar-1.1-RC2.jar来使用jboss-seam-resteasy-2.2.0.GA.jar。那个罐子更换解决了我的问题。