Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hibernate and BIRT integration
yasin
I am working on a project that must use Hibernate for mapping database.
I completed project but report has error :
The following items have errors:
Help me please...
ReportDesign (id = 1):
+ There are errors evaluating script " importPackage(Packages.org.eclipse.birt.samples.scripted.hibernate);
cul = CustomerList();
customers = cul.listCustomers("from Customer");
iterator = customers.iterator();
":
{1}.
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script " importPackage(Packages.org.eclipse.birt.samples.scripted.hibernate);
cul = CustomerList();
customers = cul.listCustomers("from Customer");
iterator = customers.iterator();
":
{1}.
+ There are errors evaluating script " if(iterator.hasNext() == false ){
return false;
}
var customer = iterator.next( );
row["CUSTOMERNUMBER"] = customer.getCustomerNumber();
row["COUNTRY"] = customer.getCountry();
row["CONTACTLASTNAME"] = customer.getContactLastName();
row["CONTACTFIRSTNAME"] = customer.getContactFirstName();
row["PHONE"] = customer.getPhone();
row["SALESREPEMPLOYEENUMBER"] = customer.getSalesRepEmployeeNumber();
row["CUSTOMERNAME"] = customer.getCustomerName();
return true;
":
{1}.
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script " if(iterator.hasNext() == false ){
return false;
}
var customer = iterator.next( );
row["CUSTOMERNUMBER"] = customer.getCustomerNumber();
row["COUNTRY"] = customer.getCountry();
row["CONTACTLASTNAME"] = customer.getContactLastName();
row["CONTACTFIRSTNAME"] = customer.getContactFirstName();
row["PHONE"] = customer.getPhone();
row["SALESREPEMPLOYEENUMBER"] = customer.getSalesRepEmployeeNumber();
row["CUSTOMERNAME"] = customer.getCustomerName();
return true;
":
{1}.
+ Unhandled exception when executing script.
Find more posts tagged with
Comments
JasonW
hit the plus sign in the error and post the stack trace to a reply.
timofei
Hello Jason W. I have the same problem here is my stack trace, I hope you are able to help.
org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "importPackage(Packages.hibernate);
cul = CustomerList();
customers = cul.listCustomers("from Shift_Activity");
iterator = customers.iterator();":
{1}.
at org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor.handleJS(DtEScriptExecutor.java:77)
at org.eclipse.birt.report.engine.script.internal.DataSetScriptExecutor.handleJS(DataSetScriptExecutor.java:196)
at org.eclipse.birt.report.engine.script.internal.ScriptDataSetScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:77)
at org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open(ScriptDataSetRuntime.java:79)
at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.java:244)
at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java:220)
at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:945)
at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:160)
at org.eclipse.birt.report.engine.data.dte.QueryResultSet.(QueryResultSet.java:92)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:129)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:79)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:253)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1755)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:77)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:45)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:45)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:42)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:63)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:211)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:237)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:90)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1246)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:155)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(BirtDocumentProcessor.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: There are errors evaluating script "__bm_OPEN()":
ReferenceError: "CustomerList" is not defined. (#3).. See next exception for more information.
There are errors evaluating script "__bm_OPEN()":
ReferenceError: "CustomerList" is not defined. (#3).
at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:118)
at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:717)
at org.eclipse.birt.data.engine.script.JSMethodRunner.runScript(JSMethodRunner.java:76)
at org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor.handleJS(DtEScriptExecutor.java:71)
... 75 more
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "__bm_OPEN()":
ReferenceError: "CustomerList" is not defined. (#3).
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:307)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:268)
at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:713)
... 77 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "CustomerList" is not defined. (#3)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1678)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:1963)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:106)
at org.mozilla.javascript.gen.c12._c1(:3)
at org.mozilla.javascript.gen.c12.call()
at
JasonW
Where is this defined?
CustomerList(); Where do you have this jar?
How are you running the report Designer?, Server?
Jason
timofei
I have the Customer classes in a folder I created {tomcatWebApps}/reports/org.eclipse.birt.samples.scripted.hibernate/. Where should those .jars be located? I am working on this in the designer but testing it as a tomcat webapp.
If I am doing this wrong please let me know how I can use hibernate with birt.
JasonW
Are you using the example Web Viewer or are you righting your own servlet?
If you are using the viewer, put the jars in the scriptlib directory. You can change the directory in the web.xml if needed.
If you are using the report engine api may sure to have:
config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, this.getClass().getClassLoader());
config.getAppContext().put(EngineConstants.WEBAPP_CLASSPATH_KEY, "c:/jars/mjo.jar");
Where config is the EnigineConfig and the second entry allows you to add to the classpath.
Jason
timofei
I guess I am confuse, where did you start your process of hibernating birt?
JasonW
Are you getting the errors in the designer?
Try putting your hibernate jars in the viewer plugin scriptlib directory:
C:birtbirt-report-designer-all-in-one-2_3_2eclipsepluginsorg.eclipse.birt.report.viewer_2.3.2.r232_20090212birtscriptlib
Jason
timofei
no I am getting the errors in the tomcat web viewer. When I place the plug-ins in the designer I don't see any changes.
JasonW
Can you try putting the jars in the WEB-INF/lib directory of the deployed viewer?
timofei
No good here is the error I am getting:
org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details: The driver org.eclipse.birt.report.data.oda.hibernate's initial entry point cannot be found or cannot be instantiated. Unable to load or instantiate the custom ODA driver class.
Here is the stack trace:
org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details:
The driver org.eclipse.birt.report.data.oda.hibernate's initial entry point cannot be found or cannot be instantiated.
Unable to load or instantiate the custom ODA driver class.
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1121)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1085)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:88)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:45)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:45)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:42)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:63)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:211)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:237)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:90)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1246)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:155)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(BirtDocumentProcessor.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.eclipse.birt.report.data.adapter.api.AdapterException: An exception occurred during processing. Please see the following message for details:
The driver org.eclipse.birt.report.data.oda.hibernate's initial entry point cannot be found or cannot be instantiated.
Unable to load or instantiate the custom ODA driver class.
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:493)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:115)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:79)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:253)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1755)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:77)
... 61 more
Caused by: org.eclipse.birt.data.engine.core.DataException: The driver org.eclipse.birt.report.data.oda.hibernate's initial entry point cannot be found or cannot be instantiated.
Unable to load or instantiate the custom ODA driver class.
at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHelper(Driver.java:100)
at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDriverHelper(DriverManager.java:98)
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:144)
at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:236)
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:223)
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdi
JasonW
what source are you using for the ODA? For some reason I thought you were using script, not an oda? Can you upload?
Jason
timofei
I am used the oda from accurate. I here is the link with the zip files scroll half way down. <a class='bbc_url' href='
http://www.actuate.com/products/resources/?articleid=11719'>http://www.actuate.com/products/resources/?articleid=11719</a>
. Thanks for all the help.
JasonW
I will take a look at this, but you may be interested in JBoss' implementation of a BIRT ODA to Hibernate<br />
<a class='bbc_url' href='
http://docs.jboss.org/tools/whatsnew/birt/birt-news-1.0.0.Alpha1.html'>JBoss
BIRT Integration</a><br />
<br />
<br />
<br />
<a class='bbc_url' href='
https://jira.jboss.org/jira/browse/JBIDE-2220'>https://jira.jboss.org/jira/browse/JBIDE-2220</a>
;
timofei
I thought about using JBoss, but in our deployment systems we have to use Tomcat. Is there a way you can give me an example of what files goes in what directory in a tomcat instance or jboss directory? Thanks
JasonW
Take a look at this page:<br />
<a class='bbc_url' href='
http://www.jboss.org/tools/download/stable/3_0_0_GA.html'>3.0.0
- JBoss Community</a><br />
<br />
and look at this download<br />
JBoss Birt Tools - Hibernate and Seam extensions for Eclipse BIRT<br />
In that download it will have two plugins that you can use<br />
org.jboss.tools.birt.oda.ui_1.0.0.GA-R200903141626-H5.jar<br />
org.jboss.tools.birt.oda_1.0.0.GA-R200903141626-H5.jar<br />
<br />
You should be able to put both of these in your plugins directory for the designer. You should only need the<br />
org.jboss.tools.birt.oda_1.0.0.GA-R200903141626-H5.jar<br />
in your runtime plugins, which should be located wherever you installed the webapp/WEB-INF/Platform/Plugins directory within Tomcat.<br />
<br />
I have not tried this yet. Post your progress please :><br />
<br />
Jason
timofei
Thanks, birt finally has a spot to place a hibernate config file and mapping directory. Right now I am stuck, and it may be my limited knowledge of hibernate, but how do I get data populated in the birt's "data sets".
Again thanks for all your help.
timofei
Here is a current error I am getting:
OdaDataSource Data Source:
- Error evaluating Javascript expression. Script engine error: illegal character
Script source: property binding, line: 0, text:
C:Documents and SettingsAdministratorDesktopbirt-rcp-report-designer-2_3_1org.eclipse.birt.samples.scripted.hibernate
birt.core.JavascriptError ( 1 time(s) )
detail : org.eclipse.birt.core.exception.CoreException: Error evaluating Javascript expression. Script engine error: illegal character Script source: property binding, line: 0, text:C:Documents and SettingsAdministratorDesktopbirt-rcp-report-designer-2_3_1org.eclipse.birt.samples.scripted.hibernate at org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoException(JavascriptEvalUtil.java:280)
OdaDataSet Data Set:
- Data source is not defined: Data Source
data.engine.UndefinedDataSource ( 1 time(s) )
detail : org.eclipse.birt.data.engine.core.DataException: Data source is not defined: Data Source at org.eclipse.birt.data.engine.impl.DataEngineImpl.defineDataSet(DataEngineImpl.java:250) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.prepare(AbstractDataEngine.java:169) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:101)
JasonW
I am somewhat confused. Which oda did you use and were you able to preview the data? Please post the report that had the issue reported last.
JasonW
If you are using the example from the Actuate website: This error
org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details:
The driver org.eclipse.birt.report.data.oda.hibernate's initial entry point cannot be found or cannot be instantiated.
I should have bubbled up better, but it is most likely due to the fact that whatever you have in the hibernate config file is having trouble locating either your db driver or your hibernate classes.
You can put your db driver in the jdbc plugin's drivers directory or add it with your hibernate classes in the hibfiles directory of the hibernate plugin.
Jason
JasonW
BTW if you go back to the original scripted data source you can read about it here:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/704-how-to-integrate-eclipse-birt-with-hibernate/#'>How
to Integrate Eclipse Birt with Hibernate - Designs & Code - BIRT Exchange</a><br />
<br />
I wrote an article on this several years ago that is linked on the above blog.<br />
<br />
Attached is the word version of it.<br />
<br />
It is a bit dated :> but it should still work.
JasonW
Sorry file was to big. I put it here:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/839-scripted-data-set-with-hibernate/#description'>Scripted
Data Set with Hibernate - Articles - BIRT Exchange</a>
timofei
I will do, an will post the results.
timofei
I tried both suggestions and can't seem to get birt to see the hibernate jars. I did get a pojo example working. The error seems like birt isn't seeing the classes or jars. How do I or can I change the directory that birt is looking for these .classes or .jars?
JasonW
If you are using the Web Viewer look at the web.xml and look for the scriptlib setting in it.
Jason
timofei
<!-- Directory to store all birt report script libraries (JARs). Default to ${birt home}/scriptlib -->
<context-param>
<param-name>BIRT_VIEWER_SCRIPTLIB_DIR</param-name>
<param-value></param-value>
</context-param>
When it is blank shouldn't it be set as the "default" {tomcat}/birt/scriptlib directory?
JasonW
It should be whatever the context for the app/scriptlib
Ie ExampleWebviewer/scriptlib
Jason
timofei
I don't really know where to go from here, I can get CustomerList.java to run as a java application successfully and see data. But my report refuse to run it, here is part of the error I am getting.
The following items have errors:
ReportDesign (id = 1):
- There are errors evaluating script "importPackage(Packages.org.eclipse.birt.samples.scripted.hibernate)
cul = CustomerList();
customers = cul.listCustomers("from Customer");
iterator = customers.iterator();":
{1}.
Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "importPackage(Packages.org.eclipse.birt.samples.scripted.hibernate)cul = CustomerList();customers = cul.listCustomers("from Customer");iterator = customers.iterator();":{1}. at org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor.handleJS(DtEScriptExecutor.java:77) at org.eclipse.birt.report.engine.script.internal.DataSetScriptExecutor.handleJS(DataSetScriptExecutor.java:196) at org.eclipse.birt.report.engine.script.internal.ScriptDataSetScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:77) at org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open(ScriptDataSetRuntime.java:79) at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.java:244) at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java:220) at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:904) at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233) at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:161) at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:92)
JasonW
Can you post your report and the customers file and hibernate config files? I will try to work up an example.
Jason
timofei
Here are the source files, thanks for taking a look.
JasonW
Sorry for the late reply. See the attached source. I added a readme doc for the procedure to follow. I used BIRT 2.3.2 for the example.