JBoss Community

BIRT reports, oda driver throws NullPointerException

created by klosskruemel in JBoss Tools - View the full discussion

Hello JBoss Community,

 

I integrated BIRT into a portal application using the Report Engine API 2.6.2. The portal application uses Hibernate, Seam 2.2, GateIn, the JBoss Portletbridge among others.

All works fine with the customers.rptdesign you can find in the BIRT tutorials. But using the Hibernate Datasource for our own reports I had a lot of trouble along way. The Eclipse preview is fine, but not the report I create within the application.

 

This is the error I get:

 

06.06.2011 14:44:29 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask doRun

SCHWERWIEGEND: An error happened while running the report. Cause:

java.lang.NullPointerException

at org.jboss.tools.birt.oda.impl.ConsoleConfigurationOdaFactory.getSessionFactory(ConsoleConfigurationOdaFactory.java:54)

at org.jboss.tools.birt.oda.impl.ConsoleConfigurationOdaFactory.<init>(ConsoleConfigurationOdaFactory.java:34)

at org.jboss.tools.birt.oda.impl.HibernateConnection.open(HibernateConnection.java:47)

at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:250)

at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:165)

at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:224)

at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:212)

at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:208)

at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:406)

at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:316)

at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:455)

 

The last line in this code of the oda driver causes the NullPointerException:

public SessionFactory getSessionFactory(Properties properties) throws OdaException {
               
String configurationName = properties.getProperty(CONFIGURATION);
       
ConsoleConfiguration[] configurations = KnownConfigurations.getInstance().getConfigurations();
       
for (int i = 0; i < configurations.length; i++) {
                       
if (configurations[i].getName().equals(configurationName)) {
                                consoleConfiguration
=configurations[i];
                               
break;
                       
}
               
}
       
if (!isOpen()) {
               
try {
                                sessionFactory
= consoleConfiguration.getSessionFactory();

 

The consoleConfiguration seems to be null. But why?

 

I have to add that I worked through this tutorial:

But i could not "run the Seam Generate Entities action" like said there. I got the message "Hibernate console configuration is empty" instead. So I just created a new Hibernate console configuration using this seam-hibernate.cfg.xml and this hibernate.properties file.

 

What can I do to bring my reports to work?

 

Regards

kloss

Reply to this message by going to Community

Start a new discussion in JBoss Tools at Community