Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Grails and Birt - Connection Not Active(The birt reporting engine is unable to achieve an active connection)
Grails and Birt - Connection Not Active [message #735516] Wed, 12 October 2011 01:08 Go to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
Hello,

I'm new to using birt, especially in grails. Everything went fine on the installation in eclipse and I am able to render previews of my reports just fine, but when I go to render the report from within my application I receive the following stacktrace:

engine.odaconsumer Failed to prepare the following query for the data set type (org.eclipse.birt.report.data.oda.jdbc.dbprofile.sqbDataSet).
[SELECT *
FROM `database`.`client` AS C, `database`.`organization` AS O
]
org.eclipse.datatools.connectivity.oda.consumer.helper.OdaHelperException: The established connection to the data source is not active.
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaObject.newOdaException(OdaObject.java:548)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.newQuery(OdaConnection.java:562)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareOdaQuery(Connection.java:285)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareStatement(Connection.java:197)
at org.eclipse.birt.data.engine.executor.DataSource.prepareStatement(DataSource.java:302)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:281)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:455)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:343)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:455)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:145)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:616)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:265)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1897)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)...

Any and all help would be appreciated. I have found no information related to solving this topic in any forums and have spent quite some time trying to solve the issue.

Thanks in advance,

Chad
Re: Grails and Birt - Connection Not Active [message #735547 is a reply to message #735516] Wed, 12 October 2011 03:25 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
I modified the BirtReportService with the following snippet -

def connection = dataSource.getConnection()
def sql = new Sql(connection);
def rSet = sql.firstRow("select * from Contact")
println rSet.toString()
if(useGrailsDatasource) task.getAppContext().put("OdaJDBCDriverPassInConnection", connection);
task.run()

And this is what I get back:

BirtReportService taskParams: [Grin
{id=1, version=0, address1=Not Listed, address2=null, city=Lesley, date_created=2011-10-12 02:12:39.0, email=null, first_name=Bob, last_name=Bole, phone_area_code=931, phone_prefix=425, phone_suffix=8162, state_id=43, zip=90210}
engine.odaconsumer Failed to prepare the following query for the data set type (org.eclipse.birt.report.data.oda.jdbc.dbprofile.sqbDataSet).
[SELECT *
FROM `database`.`client` AS C, `database`.`organization` AS O
]
org.eclipse.datatools.connectivity.oda.consumer.helper.OdaHelperException: The established connection to the data source is not active.

So, as you can see from the contact result set printed, the connection is active. What is causing the underlying code in birt to think this connection is not valid?
Re: Grails and Birt - Connection Not Active [message #735673 is a reply to message #735547] Wed, 12 October 2011 10:15 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
Any help on this?
Re: Grails and Birt - Connection Not Active [message #735681 is a reply to message #735547] Wed, 12 October 2011 10:15 Go to previous messageGo to next message
Chad is currently offline Chad
Messages: 7
Registered: July 2009
Junior Member
Any help on this?
Re: Grails and Birt - Connection Not Active [message #735685 is a reply to message #735673] Wed, 12 October 2011 10:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Chad,

Can you try it using a standard JDBC connection (Without using a profile)?

Jason

On 10/12/2011 10:15 AM, Chad wrote:
> Any help on this?
Re: Grails and Birt - Connection Not Active [message #735686 is a reply to message #735685] Wed, 12 October 2011 10:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Also what version of BIRT are you using?

Jason

On 10/12/2011 10:23 AM, Jason Weathersby wrote:
> Chad,
>
> Can you try it using a standard JDBC connection (Without using a profile)?
>
> Jason
>
> On 10/12/2011 10:15 AM, Chad wrote:
>> Any help on this?
>
Re: Grails and Birt - Connection Not Active [message #735694 is a reply to message #735686] Wed, 12 October 2011 10:52 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
I tried using Grail's dataSourceUnproxied which gives me access to a basic JDBC connection, but this met with the same error. Also, I'm using version 2.6.2. The update center for using the eclipse update-site links still listed the 3.7 version as not available.

Thanks for the response,

Chad
Re: Grails and Birt - Connection Not Active [message #735710 is a reply to message #735547] Wed, 12 October 2011 10:15 Go to previous messageGo to next message
Chad is currently offline Chad
Messages: 7
Registered: July 2009
Junior Member
Any help on this?
Re: Grails and Birt - Connection Not Active [message #735714 is a reply to message #735673] Wed, 12 October 2011 10:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Chad,

Can you try it using a standard JDBC connection (Without using a profile)?

Jason

On 10/12/2011 10:15 AM, Chad wrote:
> Any help on this?
Re: Grails and Birt - Connection Not Active [message #735715 is a reply to message #735685] Wed, 12 October 2011 10:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Also what version of BIRT are you using?

Jason

On 10/12/2011 10:23 AM, Jason Weathersby wrote:
> Chad,
>
> Can you try it using a standard JDBC connection (Without using a profile)?
>
> Jason
>
> On 10/12/2011 10:15 AM, Chad wrote:
>> Any help on this?
>
Re: Grails and Birt - Connection Not Active [message #735721 is a reply to message #735694] Wed, 12 October 2011 11:17 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
I tried using Grail's dataSourceUnproxied which gives me access to a basic JDBC connection, but this met with the same error. Also, I'm using Birt version 2.6.2. The update center for using the eclipse update-site links still listed the 3.7 version as not available.

Thanks for the response,

Chad
Re: Grails and Birt - Connection Not Active [message #735737 is a reply to message #735694] Wed, 12 October 2011 11:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Are you still passing in your own connection?
task.getAppContext().put("OdaJDBCDriverPassInConnection", connection);

I am not certain what integration you are using. Is the code available?

Jason

On 10/12/2011 10:52 AM, Chad wrote:
> I tried using Grail's dataSourceUnproxied which gives me access to a
> basic JDBC connection, but this met with the same error. Also, I'm using
> version 2.6.2. The update center for using the eclipse update-site links
> still listed the 3.7 version as not available.
>
> Thanks for the response,
>
> Chad
Re: Grails and Birt - Connection Not Active [message #735746 is a reply to message #735737] Wed, 12 October 2011 11:58 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
No, I have reverted back to using the original code which passes in a connection-pooled mysql connection. Is this something that is perhaps connection pool configuration related? I know that when the preview runs in eclipse it creates a new connection to the exact same database and I am able to see the data I am expecting. The only difference in datasources is that one is a direct connection and the other is a pooled source. Ideas?

Chad
Re: Grails and Birt - Connection Not Active [message #735774 is a reply to message #735746] Wed, 12 October 2011 12:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

It must be. Any chance you can open a bugzilla for this?

Jason

On 10/12/2011 11:58 AM, Chad wrote:
> No, I have reverted back to using the original code which passes in a
> connection-pooled mysql connection. Is this something that is perhaps
> connection pool configuration related? I know that when the preview runs
> in eclipse it creates a new connection to the exact same database and I
> am able to see the data I am expecting. The only difference in
> datasources is that one is a direct connection and the other is a pooled
> source. Ideas?
>
> Chad
Re: Grails and Birt - Connection Not Active [message #735787 is a reply to message #735774] Wed, 12 October 2011 13:34 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
Done - Bug 360702
Re: Grails and Birt - Connection Not Active [message #735795 is a reply to message #735787] Wed, 12 October 2011 13:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Thanks Chad.

On 10/12/2011 1:34 PM, Chad wrote:
> Done - Bug 360702
Re: Grails and Birt - Connection Not Active [message #735817 is a reply to message #735795] Wed, 12 October 2011 14:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BTW the stacktrace implies the connection has been closed.

Jason

On 10/12/2011 1:49 PM, Jason Weathersby wrote:
> Thanks Chad.
>
> On 10/12/2011 1:34 PM, Chad wrote:
>> Done - Bug 360702
>
Re: Grails and Birt - Connection Not Active [message #735859 is a reply to message #735817] Wed, 12 October 2011 18:24 Go to previous messageGo to next message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
The connection isn't closed. I'm talking to the dev team via the bug. They are telling me that Birt does not support connection pooled JDBC connections. This seems very odd to me.
Re: Grails and Birt - Connection Not Active [message #735874 is a reply to message #735859] Wed, 12 October 2011 20:21 Go to previous message
Chad  is currently offline Chad
Messages: 9
Registered: October 2011
Junior Member
Resolved. This occurs when you use the more advanced Query Builder instead of using a Basic JDBC Connection source if you are using a pooled data source. Please refer to this bug for information - https://bugs.eclipse.org/bugs/show_bug.cgi?id=360702
Previous Topic:Can I get all possible values of dynamic parameter from RE?
Next Topic:Line chart- can't show all dates (one value X axis only displays one value on Y axis)
Goto Forum:
  


Current Time: Tue Jul 22 05:21:26 EDT 2014

Powered by FUDForum. Page generated in 0.05077 seconds