2 Replies Latest reply on Jun 9, 2011 4:39 AM by klosskruemel

    BIRT reports, oda driver throws NullPointerException

    klosskruemel

      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 the 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: http://docs.jboss.org/tools/3.0.0.GA/en/jboss_birt_plugin_ref_guide/html/birtSeamWebProject.html#d0e826

      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?

       

      Regards

      kloss