2015-07-06 62 views
0

我到處搜索,但不是沒有如何解決它,請幫助。想取JIRA數據。我該如何解決java.lang.NoClassDefFoundError:com/atlassian/jira/rest/client/internal/async/AsynchronousJiraRestClientFactory異常?

我使用類似的代碼 http://invariantproperties.com/2013/08/07/using-the-jira-rest-java-client-introduction/

變得異常:

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/atlassian/jira/rest/client/internal/async/AsynchronousJiraRestClientFactory 
    org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1287) 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624) 
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 

根源

java.lang.NoClassDefFoundError: com/atlassian/jira/rest/client/internal/async/AsynchronousJiraRestClientFactory 
    jira.HelloWorldController.jiramethod(HelloWorldController.java:58) 
    jira.HelloWorldController.handleRequestInternal(HelloWorldController.java:32) 
    org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154) 
    org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624) 
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 

root cause 

java.lang.ClassNotFoundException: com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory 
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) 
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) 
    jira.HelloWorldController.jiramethod(HelloWorldController.java:58) 
    jira.HelloWorldController.handleRequestInternal(HelloWorldController.java:32) 
    org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154) 
    org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) 
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) 
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) 
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) 
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624) 
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 

不知道該怎麼辦。

我是新來JIRA,我一直在尋找的最後2天的解決方案。

+0

你錯過了你的類路徑JAR。最後的真相是你必須找出哪一個。這是我能找到的最接近的:http://stackoverflow.com/a/24388543/460557 –

+0

這一個更好:https://answers.atlassian.com/questions/199648/rest-java-client-library-maven - 依賴 –

+0

嗨,你可以發佈你的'pom.xml'文件嗎? –

回答

0

嘗試使用在你的pom.xml以下依賴性

<dependency> 
     <groupId>org.openengsb.wrapped</groupId> 
     <artifactId>jira-rest-java-client-api</artifactId> 
     <version>2.0.0-m32.w1</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.openengsb.wrapped</groupId> 
     <artifactId>jira-rest-java-client-core</artifactId> 
     <version>2.0.0-m32.w1</version> 
     <scope>provided</scope> 
    </dependency> 
相關問題