2015-05-12 46 views
0

我對Jhipster和angularjs相當新,我試圖將Birt引擎集成到使用H2嵌入式數據庫的JHipster應用程序中。
我發現this page詳細說明如何將birt引擎集成到彈簧應用程序中,但我不知道如何將其應用於我的應用程序。JHipster應用程序中的Birt集成

這裏是在jhipster項目進行了修改:

  • 添加依賴於POM以org.eclipse.birt.runtime
  • 在子創建的類車,CarServiceImpl,BirtView,BirtEngineFactory和BirtDataServiceConfiguration如文章中所述的包裝報告。
  • 我在子包配置中添加了BirtWebConfiguration類。我刪除了Application類中已經考慮到的@ComponentScan行。
  • 我在SRC創建一個空的報告/主/ web應用/報告/ toto.rptdesign

我的問題是:

  • 訪問應用主頁面「PageNotFound例外」當有以下消息「在名爲'dispatcherServlet'的DispatcherServlet中沒有找到具有URI [/]的HTTP請求的映射」。
    我認爲這是由於似乎覆蓋其餘路徑配置的BirtWebConfiguration。
    我應該如何定義一個新的休息終點/報告?
  • 訪問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]

感謝您的幫助。

+0

我用同樣的文章,BIRT與JHipster整合,它工作得很好(但該網址是公開的,而不是與安全性集成)。具體來說,你能描述一下你遇到的問題嗎? –

+0

嗨Rori。我剛剛編輯了我的問題,詳細說明了我面臨的問題。 – WhilyMs

回答

0

是否已創建BirtView Bean?例如,在配置/ 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; 
} 
+0

感謝@Rori,它現在適用於我。我的問題是在BirtWebConfiguration中。註釋ComponentScan和EnableWebMvc將被刪除。在BirtView中設置applicationContext有什麼用處?我認爲這已經完成了,這要歸功於BirtEngineFactory.setApplicationContext()方法。 – WhilyMs

相關問題