我已經通過iReport創建了jrxml報告。然後我用JasperServer運行它,它工作得很好。我有這個URL生成PDF報告:使用Jasper Server運行jrxlm報告
http://localhost:8081/jasperserver/flow.html/flowFile/my_report.pdf
它運作良好,但是當我試圖刷新頁面,我得到這個錯誤:
An id is required to lookup a FlowDefinition
而且當我嘗試調用的JasperServer這個REST服務客戶端應用程序我得到這個錯誤:
com.sun.jersey.api.client.UniformInterfaceException: Client response status: 500
這是Java客戶端應用程序來調用REST服務:
public final static String serverUrl = "http://localhost:8081/jasperserver/flow.html/flowFile/my_report.xls";
public final static String serverUser = "jasperadmin";
public final static String serverPassword = "jasperadmin";
static File outPutDir= new File(System.getProperty("java.io.tmpdir"));
public static void main(String[] args) {
try {
Report report = new Report();
report.setUrl("/reports/samples/Employees");
report.setOutputFolder(outPutDir.getAbsolutePath());
JasperserverRestClient client = JasperserverRestClient.getInstance(serverUrl, serverUser, serverPassword);
File reportFile = client.getReportAsFile(report);
} catch (Exception e) {
e.printStackTrace();
}
}
'我得到這個錯誤com.sun.jersey.api.client.UniformInterfaceException:客戶端響應狀態:500' - 你檢查日誌文件嗎? –