2013-01-31 63 views
1

我有一個使用BIRT的桌面應用程序。在jar文件中,我在資源文件夾中有設計和庫文件的目錄。即使他們是在同一個文件夾,當我運行的應用程序,我得到這表明它無法找到rptlibrary文件例外:無法加載BIRT庫

<list-property name="libraries"> 
    <structure> 
     <property name="fileName">pdv.rptlibrary</property> 
     <property name="namespace">pdv</property> 
    </structure> 
</list-property> 

Jan 31, 2013 11:29:33 AM org.eclipse.birt.report.model.core.LayoutModule loadLibrarySilently 
WARNING: Syntax error found, and see error details. 
Error.DesignFileException.SYNTAX_ERROR - 1 errors found! 
1.) org.eclipse.birt.report.model.parser.DesignParserException (code = Error.DesignParserException.FILE_NOT_FOUND, message : The file "pdv.rptlibrary" is not found.) 

如果我在rptlibrary改變從圖書館標籤於:

<list-property name="libraries"> 
    <structure> 
     <property name="fileName">modelos_relatorio/pdv.rptlibrary</property> 
     <property name="namespace">pdv</property> 
    </structure> 
</list-property> 

它的工作原理,但我得到了一些錯誤,當嘗試在Eclipse中預覽,那麼,有沒有一種方法,我可以在代碼中改變呢?

回答

3

你在設計器中設置資源文件夾是什麼?這可以在窗口 - >首選項中進行配置。 enter image description here

您可以爲整個工作區或僅針對特定項目進行配置。如果您在應用程序中使用API​​,則應該能夠在您的EngineConfig中設置資源路徑,或者設置IResourceLocator接口的特定實例,這實際上只需要實現兩個名爲findResource的方法。示例中您可以查看源代碼中的org.eclipse.birt.report.model.util.ResourceLocatorImplBase類。