2015-02-11 34 views
0

我試過搜索這個主題,但沒有任何東西似乎涵蓋了我確切的問題。我有一個java和jsp程序,我希望能夠將錯誤報告給我的Bugzilla安裝。我一直在測試我創建的針對Bugzilla垃圾填埋場的方法,但是我無法使其工作。不能通過J2Bugzilla向Bugzilla報告新bug

我的問題是,我已經嘗試了所有的示例代碼,我仍然以同樣的錯誤,似乎源於executeMethod()。

這裏是我的JSP頁面的樣本這就要求我的Java類的方法:

<jsp:useBean id="error" class="bug.TestClass" scope="session"/> <% String result = error.reportBug("error"); out.print(result);%>

Java方法,我已經勾勒出以Bugzillla垃圾填埋場的用戶名和密碼,但我已籤他們是正確的:

public static String reportBug(String bugError) { 
    try { 
     BugzillaConnector conn = new BugzillaConnector(); 
     conn.connectTo("http://landfill.bugzilla.org/"); 
     BugzillaMethod logIn = new LogIn ("*****@hotmail.com", "****"); 
     conn.executeMethod(logIn); 

     BugFactory factory = new BugFactory(); 
     Bug bug = factory.newBug() 
     .setOperatingSystem("WINDOWS") 
     .setPlatform("PC") 
     .setPriority("P1") 
     .setProduct("FoodReplicator") 
     .setComponent("Salt") 
     .setSummary(bugError) 
     .setVersion("1.0") 
     .setDescription("It doesn't work.") 
     .createBug(); 

     ReportBug report = new ReportBug(bug); 
     conn.executeMethod(report); 
     int id = report.getID(); 

     result += "Successful"; 

    } catch (Exception e) { 
     result = e.toString(); 
    } 
    return result; 
} 

,這裏是我得到的錯誤,當我打開jsp頁面:

com.j2bugzilla.base.BugzillaException: An unknown error was encountered; fault code: 0 

我一直在爲此工作幾天,所以任何幫助將非常感激。謝謝

回答

0

我遇到了同樣的問題。然後我將j2bugzilla jar從2.0更新到2.2.1。然後它工作。