Home
Analytics
BIRT viewer in tomcat - Unable to open connection
rbguy
Hello,
I'm new to deploying BIRT reports to the tomcat BIRT viewer and was hoping for some guidance. If I deploy a report that doesn't contain a db connection, it works fine. Another report with a db connection works good in my eclipse environment, however, when I deploy it to the tomcat birt-viewer (3.7.1) I get the following message:
org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Unable to open connection.
org.eclipse.datatools.connectivity.oda.OdaException ;
java.lang.IllegalStateException: Unable to determine the default workspace location. Check your OSGi-less platform configuration of the plugin or datatools workspace path.
Thanks for any help with this.
Find more posts tagged with
Comments
JasonW
Take a look at this entry:
http://wiki.eclipse.org/Birt_3.7_Migration_Guide#Connection_Profiles
Jason
rbguy
Jason,
Thanks for your reply. I've looked over the link you suggested and have set the appropriate environment variables for the tomcat application server. I also confirmed the JDBC drivers were placed in the <BIRT folder>/WEB-INF/lib directory. Unfortunately, I am getting the same error message. I have a feeling I am looking over something simple. Please let me know if you have any other ideas.
Thanks again, Roger
JasonW
Can you try writting the report to use a direct jdbc connection (ie do not use connection profiles) and see if that works?
Did the connectionProfile directory get created under the dtp workspace env setting?
Jason
JasonW
By connectionProfile dir, I mean whatever you named the directory in the env variable.
Jason
rbguy
Thanks again for the reply. And yes, the connection profile directory did get created in the right location upon the tomcat startup. As for doing a direct jdbc connection, if I am not mistaken, that is what I originally tried.
In my eclipse environment I created a data source and originally just filled in the JDBC Driver and Connection Details screen. (no connection profile defined at first) I was able to connect and get the report working. I then copied the .rptdesign file to the tomcat server as well as the ojdbc14.jar file to the WEB-INF/lib directory. Is that all I need to do for a direct jdbc connection or is there something else on the tomcat side that needs to be done?
Thanks and sorry if I am missing something that should be obvious.
Roger
rbguy
One more thing I may need to mention is that I developed the report using eclipse plug-in on a Windows 7 system. The tomcat instance I am deploying to is on a Redhat linux server.
JasonW
If you copied the jar and report the the Redhat server and used a direct connection this should work. You put the driver in the correct location. When running the report what error did you get. The original error is related to connection profiles.
Jason
rbguy
Jason,
Thanks for the reply. Just an FYI, I installed the eclipse BIRT report designer on the Linux box hoping that would make a difference, however, I get the same error messages.
As to your question about the error I am getting. If I use a direct connection I get the following message:
SEVERE: Unable to open connection.
org.eclipse.datatools.connectivity.oda.OdaException ;
java.lang.IllegalStateException: Unable to determine the default workspace location. Check your OSGi-less platform configuration of the plugin or datatools workspace path.
If I use a connection profile I get the following error message:
SEVERE: Unable to open connection.
org.eclipse.datatools.connectivity.oda.OdaException: Unable to find the connection profile referenced by the data source connection properties. ;
org.eclipse.datatools.connectivity.oda.OdaException: Unable to find or access the named profile (New Oracle) in profile store path (/usr/local/tomcat6/temp/workspace_dtp/conn_profile).
Thanks,
Roger
rbguy
Jason,
It looks like I got it working now, though, I don't fully understand why the change I made fixed it.
I actually found it from another forum thread that mentioned this to fix a different kind of connection problem.
The fix was to remove the following property from the .rptdesign file:
<ex-property>
<name>org.eclipse.datatools.connectivity.driverDefinitionID</name>
<value>DriverDefn.org.eclipse.datatools.enablement.oracle.10.driverTemplate.Oracle Thin Driver</value>
</ex-property>
I wasn't expecting it to do anything, but once removed, I got no more errors.
If you have any thoughts or comments on this I would be interested in hearing them, otherwise, thank you for all your help with this.
Roger
JasonW
Roger,
Did you by chance use a connection profile first and then delete it?
Jason
rbguy
Jason,
I originally started without a connection profile. I then added one and played with it for a while trying to get it to work. After not having any success I then deleted it and eventually got the one without the connection profile to work. So yes, the one that is working had a connection profile and was later deleted.
Roger
prangit
rbguy, thanks for the info. I (newbie, also) had the same symptom (working in Eclipse Report Designer preview but not in BIRT Viewer in Tomcat) and your change to remove the <ex-property> entry worked for me. I never used profiles. I'm trying to figure out why this change works, as in, what brought in my entry:
<ex-property>
<name>org.eclipse.datatools.connectivity.driverDefinitionID</name>
<value>DriverDefn.org.eclipse.datatools.enablement.mysql.5_1.driverTemplate.MySQL JDBC Driver</value>
</ex-property>
I'm using this basic config:
Java jdk1.6.0_25 and jre6
Eclipse Indigo Service Release 1
BIRT3.7.1.v20110905-BDF9E8OGTzuHfoz-Au7-CWvXDn6N
Tomcat 7.0.23
Firefox 8.0.1
srinivas.s
Hi Jason,
We are getting the below error while deploying the BIRT2.5 Report into tomcat, but it is working fine in JBoss.
Please advice,
rg.eclipse.birt.report.data.oda.sampledb.SampleDBJDBCConnectionFactory
Apr 30, 2012 12:31:18 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager$DriverClassLoader addNewURL
INFO: JDBCDriverManager: found JAR file drivers/ojdbc14-10.2.0.4.jar. URL=bundleentry://41.fwk17241377/drivers/ojdbc14-1
0.2.0.4.jar
Apr 30, 2012 12:31:20 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager$DriverClassLoader addNewURL
INFO: JDBCDriverManager: found JAR file drivers/ojdbc14-10.2.0.4.jar. URL=bundleentry://41.fwk17241377/drivers/ojdbc14-1
0.2.0.4.jar
Apr 30, 2012 12:31:20 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Cannot open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: There is an error in get connection, Io exception: The Network Adap
ter could not establish the connection.
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doConnect(JDBCDriverManager.java:229)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getConnection(JDBCDriverManager.java:179)
at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUrl(Connection.java:211)
at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connection.java:151)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:238)
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:157)
at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:192)
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:180)
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:209)
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:390)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:309)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:437)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:18
9)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:177)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:143)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:476)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:117)
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:1825)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.GridItemExecutor.execute(GridItemExecutor.java:65)
at org.eclipse.birt.report.engine.executor.ReportExecutorUtil.executeAll(ReportExecutorUtil.java:87)
at org.eclipse.birt.report.engine.executor.ReportExecutorUtil.executeAll(ReportExecutorUtil.java:92)
at org.eclipse.birt.report.engine.executor.ReportExecutor.createPageExecutor(ReportExecutor.java:250)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportEmitterExecutor.createPageExecutor(ReportEmitt
erExecutor.java:72)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.createPageExecutor(Suppr
essDuplciateReportExecutor.java:60)
Regards,
Srinivas
JasonW
Srinivas,
What data source is the report using? Do you have the right jdbc driver in the jdbc plugin's drivers directory?
Jason
Saggy123
hi,
i have following issue
SEVERE: Unable to open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: oracle.jdbc.OracleDriver.
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.findDriver(JDBCDriverManager.java:836)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.loadAndRegisterDriver(JDBCDriverManager.java:941)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.loadAndRegisterDriver(JDBCDriverManager.java:918)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doConnect(JDBCDriverManager.java:266)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getConnection(JDBCDriverManager.java:232)
at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUrl(Connection.java:243)
at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connection.java:162)
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:217)
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:407)
but i was not used connection profile instead
i created one data source and that added data source in library