JHipster 应用程序中的 Birt 集成
Birt integration in JHipster application
我是 Jhipster 的新手,angularjs 我正在尝试使用 H2 嵌入式数据库将 Birt 引擎集成到 JHipster 应用程序中。
我发现 this page 详细说明了如何将 birt 引擎集成到 spring 应用程序中,但我不知道如何将其应用到我的应用程序中。
以下是在 jhipster 项目中进行的修改:
- 在 pom
中添加对 org.eclipse.birt.runtime 的依赖
- 按照文中所述在子包报告中创建 classes Car、CarServiceImpl、BirtView、BirtEngineFactory 和 BirtDataServiceConfiguration。
- 我在子包配置中添加了 BirtWebConfiguration class。我删除了应用程序 class.
中已考虑的 @ComponentScan 行
- 我在 src/main/webapp/reports/toto.rptdesign
中创建了一个空报表
我的问题是:
- 访问应用程序主页时 "PageNotFound exception" 显示以下消息 "No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'dispatcherServlet'"。
我认为这是由于 BirtWebConfiguration 似乎覆盖了其余路径配置。
我该如何定义一个新的 rest 端点 /reports ?
- 访问http://localhost:8080/reports页面时,抛出thymeleaf异常
[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]
感谢您的帮助。
是否创建了 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;
}
我是 Jhipster 的新手,angularjs 我正在尝试使用 H2 嵌入式数据库将 Birt 引擎集成到 JHipster 应用程序中。
我发现 this page 详细说明了如何将 birt 引擎集成到 spring 应用程序中,但我不知道如何将其应用到我的应用程序中。
以下是在 jhipster 项目中进行的修改:
- 在 pom 中添加对 org.eclipse.birt.runtime 的依赖
- 按照文中所述在子包报告中创建 classes Car、CarServiceImpl、BirtView、BirtEngineFactory 和 BirtDataServiceConfiguration。
- 我在子包配置中添加了 BirtWebConfiguration class。我删除了应用程序 class. 中已考虑的 @ComponentScan 行
- 我在 src/main/webapp/reports/toto.rptdesign 中创建了一个空报表
我的问题是:
- 访问应用程序主页时 "PageNotFound exception" 显示以下消息 "No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'dispatcherServlet'"。
我认为这是由于 BirtWebConfiguration 似乎覆盖了其余路径配置。
我该如何定义一个新的 rest 端点 /reports ? - 访问http://localhost:8080/reports页面时,抛出thymeleaf异常
[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]
感谢您的帮助。
是否创建了 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;
}