Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Reports on JBoss 5.2 JNDI "env not bound" error
jainee
We have integrated our BIRT reports within our web application. The jndi name is configured, and the integration works fine on Tomcat and Websphere.
While deploying it on Jboss 5.2 we get the error "env not bound". We have given the jndi name as "jdbc/examplejndi".
The rptdesign reports have jndiparameter as "java:comp/env/jdbc/examplejndi" which throws error "env not bound".
The same application works on Jboss 6 and 7 and also on tomcat and websphere.
If I change the jndi configuration in the rptdesign to "java:jdbc/examplejndi", it works on jboss but fails on tomcat and websphere.
The "java:comp/env/jdbc/examplejndi" works on sevlets/jsps/code-base (even on Jboss 5.2), though it fails when we given this setting on rptdesign.
We have copied the birt plugins into WEB-INF/lib, and web.xml defines default parameters for BIRT.
Exception traces gives NullPointerException, which I think ebcause of the default connection if jndi fails.
We have to support tomcat/websphere and jboss, and looking for a common solution. So the possibility of changing the jndi configuration for every deployment is not possible.
I have tried various things available on the web, though I couldnt find any successful solution. It seems the BIRT logs we are using BaseClassLoader, which doesnt specify the context of the application. In tomcat deployment we see BIRT logs showing WebAppClassLoader and displying the context of the application.
Any help will be highly appreciated.
Find more posts tagged with
Comments
jainee
I am using BIRT 3.7.2. Any help will be highly appreciated.
I have tried various things, but it doesnt seem to work on Jboss 5.2.
mwilliams
Do you know which servers have which app server or anything like that?
jainee
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="117121" data-time="1369325247" data-date="23 May 2013 - 09:07 AM"><p>
Do you know which servers have which app server or anything like that?<br /></p></blockquote>
I am not sure if I understand the question. The Jboss 5.2 uses TomcatDeployer.<br />
<br />
I get this error if I use the sample war file from BIRT runtime and try to deploy it on the Jboss 5.2<br />
<br />
<blockquote class='ipsBlockquote' ><p>
May 24, 2013 11:35:47 AM org.eclipse.birt.report.engine.util.ResourceLocatorWrapper findResource<br />
WARNING: Error.ResourceNotAccessible<br />
May 24, 2013 11:35:47 AM org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptions<br />
SEVERE: An error happened while running the report. Cause:<br />
java.lang.NullPointerException<br />
at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)<br />
at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)<br />
at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)<br />
at java.sql.DriverManager.getDriver(DriverManager.java:253)<br />
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doConnect(JDBCDriverManager.java:272)<br />
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getConnection(JDBCDriverManager.java:232)<br />
at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUrl(Connection.java:252)<br />
at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connection.java:162)<br />
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:250)<br />
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:165)<br />
at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:224)<br />
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:212)<br />
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:217)<br />
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:435)<br />
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:322)<br />
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:455)<br />
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)<br />
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)<br />
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:153)<br />
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:634)<br />
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152)<br />
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)<br />
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:267)<br />
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1941)<br />
<br /></p></blockquote>
mwilliams
Sorry for the poor explanation. I meant you're saying it doesn't work the same in your different app servers, so I was asking if you might be able to tell which app server you're on based on the servername. For example, say you have server1/birt/frameset?__report=myReport.rptdesign and server2/birt/frameset?__report=myReport.rptdesign. On server1 you have JBoss and on server2 you have Tomcat. If you know this, you could check and change the JNDI url to what it needs to be dynamically.
Another (probably better) option I thought of after this would be to look at the fileName:
reportContext.getDesignHandle().fileName;
And see if the fileName includes JBoss, Tomcat, or WAS in the path and change the URL dynamically.