Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » SEVERE: Unable to open connection.(Problem with database connection)
SEVERE: Unable to open connection. [message #521084] Tue, 16 March 2010 12:47 Go to next message
Strahd_za is currently offline Strahd_za
Messages: 3
Registered: March 2010
Junior Member
I'm rather new to BIRT and was getting along just fine, but now I'm stuck with a database connection problem.

(Using Birt 2.5.1)

I created my report on my desktop with a JDBC Connection to my MYSQL database on another machine, by hardcoding the IP of the MYSQL server. This worked fine until of course when I try to deploy the report to production and the IP is different.

So, I set up a SSH tunnel to forward localhost:3306 to mysqlserver:3306.
Mysqlserver is the same machine the reprots will be deployed to, assuming then that the deployed report would happily connect to localhost on the production server.

The report (and I've recreated the simplest of reports to test with) works on my desktop, but when I deploy the report to the remote machine I keep getting:

16 Mar 2010 2:14:15 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Unable to open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: There is an error in get connection, Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server..
        at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doConnect(JDBCDriverManager.java:262)
        at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getConnection(JDBCDriverManager.java:212)
        at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUrl(Connection.java:234)
        at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connection.java:160)
        at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:238)
        at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:180)
        at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:193)
        at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:181)


The connection in the rptdesign file is as follows

    <data-sources>
        <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="7">
            <text-property name="displayName"></text-property>
            <list-property name="privateDriverProperties">
                <ex-property>
                    <name>contentBidiFormatStr</name>
                    <value>ILYNN</value>
                </ex-property>
                <ex-property>
                    <name>metadataBidiFormatStr</name>
                    <value>ILYNN</value>
                </ex-property>
            </list-property>
            <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
            <property name="odaURL">jdbc:mysql://localhost/DB_PROBE</property>
            <property name="odaUser">probe</property>
            <encrypted-property name="odaPassword" encryptionID="base64">Y2xpZW50X3Bhc3M=</encrypted-property>
        </oda-data-source>
    </data-sources>


And I can happily connect to mysql from localhost with username probe and supplied password.
But for some reason BIRT does not want to connect via jdbc driver ??

Help please.
Thanx
Re: SEVERE: Unable to open connection. [message #521146 is a reply to message #521084] Tue, 16 March 2010 15:01 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I assume you have the same version of the jdbc driver in the production
systems
WEB-INF\platform\plugins\org.eclipse.birt.report.data.oda.jd bc_2.5.1.v20090821\drivers
directory?

Why do you have to setup the ssh tunnel? Why not just change the url
from
jdbc:mysql://localhost/DB_PROBE
to
jdbc:mysql://mysqlserverip:3306/DB_PROBE

Jason


Strahd_za wrote:
> I'm rather new to BIRT and was getting along just fine, but now I'm
> stuck with a database connection problem.
>
> (Using Birt 2.5.1)
> I created my report on my desktop with a JDBC Connection to my MYSQL
> database on another machine, by hardcoding the IP of the MYSQL server.
> This worked fine until of course when I try to deploy the report to
> production and the IP is different.
>
> So, I set up a SSH tunnel to forward localhost:3306 to mysqlserver:3306.
> Mysqlserver is the same machine the reprots will be deployed to,
> assuming then that the deployed report would happily connect to
> localhost on the production server.
>
> The report (and I've recreated the simplest of reports to test with)
> works on my desktop, but when I deploy the report to the remote machine
> I keep getting:
>
> 16 Mar 2010 2:14:15 PM
> org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
> SEVERE: Unable to open connection.
> org.eclipse.birt.report.data.oda.jdbc.JDBCException: There is an error
> in get connection, Communications link failure
>
> The last packet sent successfully to the server was 0 milliseconds ago.
> The driver has not received any packets from the server..
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doCo nnect(JDBCDriverManager.java:262)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getC onnection(JDBCDriverManager.java:212)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUr l(Connection.java:234)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connec tion.java:160)
> at
> org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo nnection.open(OdaConnection.java:238)
>
> at
> org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o penConnection(ConnectionManager.java:180)
>
> at
> org.eclipse.birt.data.engine.executor.DataSource.newConnecti on(DataSource.java:193)
>
> at
> org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
>
> The connection in the rptdesign file is as follows
>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="7">
> <text-property name="displayName"></text-property>
> <list-property name="privateDriverProperties">
> <ex-property>
> <name>contentBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> <ex-property>
> <name>metadataBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> </list-property>
> <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
> <property
> name="odaURL">jdbc:mysql://localhost/DB_PROBE</property>
> <property name="odaUser">probe</property>
> <encrypted-property name="odaPassword"
> encryptionID="base64">Y2xpZW50X3Bhc3M=</encrypted-property >
> </oda-data-source>
> </data-sources>
>
> And I can happily connect to mysql from localhost with username probe
> and supplied password. But for some reason BIRT does not want to connect
> via jdbc driver ??
> Help please.
> Thanx
>
Re: SEVERE: Unable to open connection. [message #521289 is a reply to message #521146] Wed, 17 March 2010 07:14 Go to previous messageGo to next message
Strahd_za is currently offline Strahd_za
Messages: 3
Registered: March 2010
Junior Member
Yup, same version of the jdbc driver everywhere.

The reason I set up the ssh tunnel was, cause the report will be deployed to several different machines with different hostnames.. .but localhost will hold true for all instances.

Re: SEVERE: Unable to open connection. [message #521333 is a reply to message #521084] Wed, 17 March 2010 10:19 Go to previous messageGo to next message
Strahd_za is currently offline Strahd_za
Messages: 3
Registered: March 2010
Junior Member
Argh.
Ok, my bad.

Turns out MYSQL service was not running on the loopback interface, which is why the localhost tunneling worked , but not an actual localhost connection.

Re: SEVERE: Unable to open connection. [message #824705 is a reply to message #521146] Tue, 20 March 2012 00:39 Go to previous messageGo to next message
Meghan Missing name is currently offline Meghan Missing name
Messages: 16
Registered: November 2010
Junior Member
Jason,

I'm wondering if you might have some insight. I have been working in the BIRT tool for some time and have established a connection to MySQL using the jdbc driver (v5.1). It has worked consistently up until about a week ago when all of a sudden it stopped working. I get the following error message:

'There is an error in get connection. Communication link failure. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server'

Nothing, to my knowledge has changed. Do you know where I can look next to troubleshoot? At this point all of my report editing/creation has come to a stand still so I'm really stuck. Any help is appreciated.

Cheers.
Meghan

[Updated on: Tue, 20 March 2012 00:40]

Report message to a moderator

Re: SEVERE: Unable to open connection. [message #825257 is a reply to message #824705] Tue, 20 March 2012 17:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Meghan,

I get a similar error to this when MySQL is down. Can you connect to it
with the MySQL tools on the same machine?

Jason

On 3/19/2012 8:39 PM, Meghan Mising name wrote:
> Jason,
>
> I'm wondering if you might have some insight. I have been working in the
> BIRT tool for some time and have established a connection to MySQL using
> the jdbc driver (v5.1). It has worked consistently up until about a week
> ago when all of a sudden it stopped working. I get the following error
> message:
>
> 'There is an error in get connection. Communication link failure. The
> last packet sent successfully to the server was 0 milliseconds ago. The
> driver has not received any packets from the server'
> Nothing, to my knowledge has changed. Do you know where I can look next
> to troubleshoot? At this point all of my report editing/creation has
> come to a stand still so I'm really stuck. Any help is appreciated.
>
> Cheers.
> Meghan
Re: SEVERE: Unable to open connection. [message #825504 is a reply to message #825257] Tue, 20 March 2012 23:11 Go to previous message
Meghan Missing name is currently offline Meghan Missing name
Messages: 16
Registered: November 2010
Junior Member
Found my issue! Thank you, your reply helped.
Previous Topic:Writing to table from external application
Next Topic:Error when defining drillthrough in a chart
Goto Forum:
  


Current Time: Thu Oct 23 16:43:20 GMT 2014

Powered by FUDForum. Page generated in 0.04314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software