2013-01-13 96 views
0

我在一個JBoss Seam應用程序中使用了RestEasy,並且出現了一個奇怪的異常,這個異常沒有多少內容。我在我的Seam 2.2.2.GA應用以下jar文件:RestEasy,JBoss Seam神祕異常

  • JAXRS-API 2.2.0.GA.jar
  • RestEasy的-JAXRS-2.2.0.GA.jar
  • 的JBoss -seam-RestEasy的-2.2.0.GA.jar

我已經安裝到我的資源的路徑,像這樣:

@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; 
} 

現在,當我嘗試訪問我的網址/縫/資源/ SVC/chartSvc /普惠TechArt的,我得到這個異常:

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) 

我的資源是從來不碰這表明,這可能是一些與我的設置,但我不知道從哪裏開始調試,因爲我相信我擁有所有正確的版本的圖書館。任何人都可以幫助我開始調試嗎?這是我的第一個縫應用程序。

回答

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。該罐替換解決了我的問題。