<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    BIRT reports, oda driver throws NullPointerException
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/klosskruemel">klosskruemel</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/message/609171#609171">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello JBoss Community,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is the error I get:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>06.06.2011 14:44:29 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask doRun</p><p> SCHWERWIEGEND: An error happened while running the report. Cause:</p><p> java.lang.NullPointerException</p><p> at org.jboss.tools.birt.oda.impl.ConsoleConfigurationOdaFactory.getSessionFactory(ConsoleConfigurationOdaFactory.java:54)</p><p> at org.jboss.tools.birt.oda.impl.ConsoleConfigurationOdaFactory.&lt;init&gt;(ConsoleConfigurationOdaFactory.java:34)</p><p> at org.jboss.tools.birt.oda.impl.HibernateConnection.open(HibernateConnection.java:47)</p><p> at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:250)</p><p> at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:165)</p><p> at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:224)</p><p> at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:212)</p><p> at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:208)</p><p> at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:406)</p><p> at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:316)</p><p> at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:455)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The last line in this code of the oda driver causes the NullPointerException: </p><pre class="prettyprint"><span class="kwd">public</span><span class="pln"> </span><span class="typ">SessionFactory</span><span class="pln"> getSessionFactory</span><span class="pun">(</span><span class="typ">Properties</span><span class="pln"> properties</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">throws</span><span class="pln"> </span><span class="typ">OdaException</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="typ">String</span><span class="pln"> configurationName </span><span class="pun">=</span><span class="pln"> properties</span><span class="pun">.</span><span class="pln">getProperty</span><span class="pun">(</span><span class="pln">CONFIGURATION</span><span class="pun">);</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="typ">ConsoleConfiguration</span><span class="pun">[]</span><span class="pln"> configurations </span><span class="pun">=</span><span class="pln"> </span><span class="typ">KnownConfigurations</span><span class="pun">.</span><span class="pln">getInstance</span><span class="pun">().</span><span class="pln">getConfigurations</span><span class="pun">();</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">int</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> configurations</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">configurations</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">getName</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="pln">configurationName</span><span class="pun">))</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; consoleConfiguration</span><span class="pun">=</span><span class="pln">configurations</span><span class="pun">[</span><span class="pln">i</span><span class="pun">];</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="kwd">break</span><span class="pun">;</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="pun">}</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="pun">}</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(!</span><span class="pln">isOpen</span><span class="pun">())</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span class="kwd">try</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sessionFactory </span><span class="pun">=</span><span class="pln"> consoleConfiguration</span><span class="pun">.</span><span class="pln">getSessionFactory</span><span class="pun">();</span></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The consoleConfiguration seems to be null. But why?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have to add that I worked through this tutorial:</p><p>But i could not <a class="jive-link-anchor-small">"run the Seam Generate Entities action</a>" like said there. I got the message "Hibernate console configuration is empty" instead. So I just created a new Hibernate console configuration using this <a class="jive-link-external-small" href="http://pastebin.com/BHvrCvGu" target="_blank">seam-hibernate.cfg.xml</a> and this <a class="jive-link-external-small" href="http://pastebin.com/cXeBxH5X" target="_blank">hibernate.properties</a> file.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What can I do to bring my reports to work?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Regards</p><p>kloss</p><table border="0" cellpadding="0" cellspacing="0" height="27" style="width: 195px;"><tbody><tr><td class="smallfont" colspan="3" style="border:0px solid black;padding-top: 8px;margin-right: 24px;" width="100%"></td></tr></tbody></table></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/609171#609171">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Tools at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>