JHipster应用程序中的Birt集成

时间:2015-05-12 07:21:16

标签: birt jhipster

我是Jhipster和angularjs的新手,我正在尝试使用H2 embedeed数据库将Birt引擎集成到JHipster应用程序中。
我发现this page详细说明了如何在弹簧应用程序中集成birt引擎,但我不知道如何将它应用于我的应用程序。

以下是在jhipster项目中执行的修改:

  • 在pom
  • 中添加对org.eclipse.birt.runtime的依赖
  • 如本文所述,在子包报告中创建Car,CarServiceImpl,BirtView,BirtEngineFactory和BirtDataServiceConfiguration类。
  • 我在子包配置中添加了BirtWebConfiguration类。我删除了已在Application类中考虑的@ComponentScan行。
  • 我在src / main / webapp / reports / toto.rptdesign
  • 中创建了一个空报告

我的问题是:

  • 访问应用程序主页时出现“PageNotFound异常”,并显示以下消息“在DispatcherServlet中找不到带有URI [/]的HTTP请求的映射,名称为'dispatcherServlet'”。我认为这是由于BirtWebConfiguration似乎覆盖了其余的路径配置。
    如何定义新的休息终点/报告?
  • 访问http://localhost:8080/reports页面时,会引发百事可乐异常 [ERROR] org.thymeleaf.TemplateEngine - [THYMELEAF][http-nio-127.0.0.1-8090-exec-5] Exception processing template "birtView": Error resolving template "birtView", template might not exist or might not be accessible by any of the configured Template Resolvers [ERROR] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "birtView", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause org.thymeleaf.exceptions.TemplateInputException: Error resolving template "birtView", template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:245) ~[thymeleaf-2.1.3.RELEASE.jar:na] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.3.RELEASE.jar:na] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.3.RELEASE.jar:na] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) ~[thymeleaf-2.1.3.RELEASE.jar:na] at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335) ~[thymeleaf-spring4-2.1.3.RELEASE.jar:na] at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring4-2.1.3.RELEASE.jar:na]

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

BirtView bean是否已创建?例如,在config / LocaleConfiguration.java中:

@Override
public void addViewControllers(ViewControllerRegistry registry) {
    registry.addViewController("/reports").setViewName("birtView");
}

@Bean 
public BirtView birtView(){ 
    BirtView birtView = new BirtView(); 
    birtView.setDataSource(dataSource);
    birtView.setAppContext(applicationContext);
    birtView.setBirtEngine(this.engine().getObject());
    return birtView; 
}