我如何从jasperserver获得报告

时间:2012-11-06 09:11:32

标签: java swing noclassdeffounderror jasperserver

有了这段代码,我得到了错误:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/axis/EngineConfiguration 

我正在尝试在Jasper服务器上获取报告。 (关于Jasper服务器的文档不够)。我该如何解决?

    JServer server = new JServer();
    server.setUrl("http://localhost:8080/jasperserver/services/repository");
    server.setUsername("jasperadmin");
    server.setPassword("jasperadmin");
    WSClient client = new WSClient(server);

    ResourceDescriptor resourceDescriptor = new ResourceDescriptor();
    resourceDescriptor.setUriString ("/reports/samples/AllAccounts");
  Map<String, Object> parameterMap = new HashMap<String, Object>();
   parameterMap.put("MY_PARAMETER_NAME", "myparametervalue");
    JasperPrint printer = client.runReport(resourceDescriptor, parameterMap);
    JasperViewer.viewReport(printer, false, Locale.ENGLISH);

1 个答案:

答案 0 :(得分:3)

要解决该错误,需要将包含EngineConfiguration类的Jar添加到应用程序的运行时类路径中。

搜索EngineConfiguration at JarFinder应该会列出可能的嫌疑人名单。