我使用groovy http-builder並使用RestClient從JIRA訪問Web服務。 在開發模式下,它工作正常,但是當我的Tomcat服務器上部署的戰爭,它拋出異常,因爲Grails和Jira使用RESTClient集成
"org.apache.commons.collections.map.ListOrderedMap: method()V not found. Stacktrace follows: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [list] of controller [com.tristar.JiraController] caused exception: Runtime error executing action at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action ... 3 more Caused by: java.lang.reflect.InvocationTargetException ... 3 more Caused by: java.lang.NoSuchMethodError: org.apache.commons.collections.map.ListOrderedMap: method()V not found at net.sf.json.JSONObject.(JSONObject.java:1603) at groovyx.net.http.EncoderRegistry.encodeJSON(EncoderRegistry.java:301) at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setBody(HTTPBuilder.java:1200) at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setPropertiesFromMap(HTTPBuilder.java:1111) at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.(HTTPBuilder.java:946) at groovyx.net.http.RESTClient.post(RESTClient.java:140) at com.tristar.JiraController.list(JiraController.groovy:221) "
def jiraApiUrl = 'http://ipAddress:8080/rest/api/2/' def jiraClient = new RESTClient(jiraApiUrl) def searchResults = jiraClient.post(requestContentType: JSON, path: 'search', body: [jql: "project=XYZ AND (status=Open OR status='In Progress') AND issuetype!=Epic AND issuetype!='Technical task'", startAt: offset, maxResults: params.max, fields: ['summary', 'description','issuetype']])
我怎樣才能解決這個問題?
嘗試在構建之前進行全面清理。 'grails clean && rm -rf ./target/ && grails refresh-dependencies && grails war'。此外,您可以嘗試通過下一個命令「grails dev war」進行構建。 – wwarlock
我已經完成了所有這些事情,但沒有成功。任何方式,我已經改變了我的執行情況,現在它工作正常。謝謝 – arvind
請描述您的更改作爲答案 – wwarlock