IllegalAccessError when using JNDI Url on Birt 2.5.1 [message #635549] |
Wed, 27 October 2010 06:19  |
Eclipse User |
|
|
|
Hi,
Our application is relying on Birt 2.5.1 runtime for the report generation. We are in the process of moving from JDBC to JNDI
as the connection method for the Birt datasource. The JNDI url is set on run time using the reportContext.
We have come across the DB drivers cannot be loaded into the same classpath as Birt runtime, since we are getting IllegalAccessError when BIRT is internally preparing the sql Statement. The problem does not happen if the DB driver is loader in a higher classpath, i.e.
at the Application Server level.
This behaviour seems neither DB ( with Oracle, SQL Server and DB2 we are always getting IllegalAccessException) nor Application
Server related (we get the same results on Tomcat 6.0 and WAS 7.0) Our application is using App. Server pooling and we have never come across this problem, so it does not either seem to be an application issue.
So basically I would like to understand why it is happenning and if there is a better way of fixing the issue than loading
the drivers at the application server classpath.
I attach an stack trace of the problem when testing on tomcat 6 and SQL Server.
If you need further information, plese let me know. Best regards,
Hector
--------------------------------- Stack trace ---------------------------------
Caused by: java.lang.IllegalAccessError: tried to access method com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.<init > (Lcom/microsoft/sqlserver/jdbc/SQLServerConnection;Ljava/lan g/String;II)V from class com.microsoft.sqlserver.jdbc.SQLServerConnection
at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStat ement(SQLServerConnection.java:1864)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStat ement(SQLServerConnection.java:1566)
at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.prepareStat ement(DelegatingConnection.java:248)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConne ctionWrapper.prepareStatement(PoolingDataSource.java:302)
at org.eclipse.birt.report.data.oda.jdbc.Statement.prepare(Stat ement.java:142)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQu ery.doPrepare(OdaQuery.java:229)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQu ery.prepare(OdaQuery.java:186)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareO daQuery(Connection.java:281)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareS tatement(Connection.java:181)
at org.eclipse.birt.data.engine.executor.DataSource.prepareStat ement(DataSource.java:269)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepar e(DataSourceQuery.java:270)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQu eryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:350)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu tion(QueryExecutor.java:337)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr eparedQuery.java:448)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr oduceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex ecute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute (PreparedOdaDSQuery.java:144)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSession Impl.execute(DataRequestSessionImpl.java:511)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:145)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine .doExecuteQuery(DataGenerationEngine.java:71)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:254)
at org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1818)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.ex ecute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportItemExecutor.execute(WrappedReportItemExecutor.java:4 6)
at org.eclipse.birt.report.engine.internal.executor.emitter.Rep ortItemEmitterExecutor.execute(ReportItemEmitterExecutor.jav a:46)
at org.eclipse.birt.report.engine.internal.executor.dup.Suppres sDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor .java:43)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:137)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBu ilder.build(ReportDocumentBuilder.java:258)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTas k.java:243)
... 24 more
|
|
|
Re: IllegalAccessError when using JNDI Url on Birt 2.5.1 [message #635693 is a reply to message #635549] |
Wed, 27 October 2010 13:55   |
Eclipse User |
|
|
|
Hector,
Where is the driver when you have the issue? In the drivers directory
of the JDBC plugin?
Jason
On 10/27/2010 6:19 AM, Hector Moneo wrote:
> Hi,
> Our application is relying on Birt 2.5.1 runtime for the report
> generation. We are in the process of moving from JDBC to JNDI
> as the connection method for the Birt datasource. The JNDI url is set on
> run time using the reportContext. We have come across the DB drivers
> cannot be loaded into the same classpath as Birt runtime, since we are
> getting IllegalAccessError when BIRT is internally preparing the sql
> Statement. The problem does not happen if the DB driver is loader in a
> higher classpath, i.e.
> at the Application Server level.
>
> This behaviour seems neither DB ( with Oracle, SQL Server and DB2 we are
> always getting IllegalAccessException) nor Application
> Server related (we get the same results on Tomcat 6.0 and WAS 7.0) Our
> application is using App. Server pooling and we have never come across
> this problem, so it does not either seem to be an application issue.
> So basically I would like to understand why it is happenning and if
> there is a better way of fixing the issue than loading the drivers at
> the application server classpath.
>
> I attach an stack trace of the problem when testing on tomcat 6 and SQL
> Server.
>
> If you need further information, plese let me know. Best regards,
> Hector
>
> --------------------------------- Stack trace
> ---------------------------------
> Caused by: java.lang.IllegalAccessError: tried to access method
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.<init >
> (Lcom/microsoft/sqlserver/jdbc/SQLServerConnection;Ljava/lan
> g/String;II)V from class com.microsoft.sqlserver.jdbc.SQLServerConnection
> at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStat
> ement(SQLServerConnection.java:1864)
> at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStat
> ement(SQLServerConnection.java:1566)
> at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.prepareStat
> ement(DelegatingConnection.java:248)
> at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConne
> ctionWrapper.prepareStatement(PoolingDataSource.java:302)
> at org.eclipse.birt.report.data.oda.jdbc.Statement.prepare(Stat
> ement.java:142)
> at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQu
> ery.doPrepare(OdaQuery.java:229)
> at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQu
> ery.prepare(OdaQuery.java:186)
> at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareO
> daQuery(Connection.java:281)
> at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareS
> tatement(Connection.java:181)
> at org.eclipse.birt.data.engine.executor.DataSource.prepareStat
> ement(DataSource.java:269)
> at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepar
> e(DataSourceQuery.java:270)
> at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQu
> eryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:350)
> at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu
> tion(QueryExecutor.java:337)
> at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr
> eparedQuery.java:448)
> at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr
> oduceQueryResults(PreparedDataSourceQuery.java:190)
> at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex
> ecute(PreparedDataSourceQuery.java:178)
> at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute
> (PreparedOdaDSQuery.java:144)
> at org.eclipse.birt.report.data.adapter.impl.DataRequestSession
> Impl.execute(DataRequestSessionImpl.java:511)
> at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec
> uteQuery(DteDataEngine.java:145)
> at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine
> .doExecuteQuery(DataGenerationEngine.java:71)
> at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e
> xecute(AbstractDataEngine.java:254)
> at org.eclipse.birt.report.engine.executor.ExecutionContext.exe
> cuteQuery(ExecutionContext.java:1818)
> at org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex
> ecuteQuery(QueryItemExecutor.java:80)
> at org.eclipse.birt.report.engine.executor.TableItemExecutor.ex
> ecute(TableItemExecutor.java:62)
> at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe
> dReportItemExecutor.execute(WrappedReportItemExecutor.java:4 6)
> at org.eclipse.birt.report.engine.internal.executor.emitter.Rep
> ortItemEmitterExecutor.execute(ReportItemEmitterExecutor.jav a:46)
> at org.eclipse.birt.report.engine.internal.executor.dup.Suppres
> sDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor .java:43)
> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking
> LM.layoutNodes(HTMLBlockStackingLM.java:65)
> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la
> youtChildren(HTMLStackingLM.java:26)
> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la
> yout(HTMLAbstractLM.java:137)
> at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin
> gLM.resumeLayout(HTMLInlineStackingLM.java:111)
> at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin
> gLM.layoutNodes(HTMLInlineStackingLM.java:160)
> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la
> youtChildren(HTMLStackingLM.java:26)
> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la
> yout(HTMLAbstractLM.java:137)
> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking
> LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la
> youtChildren(HTMLStackingLM.java:26)
> at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou
> tChildren(HTMLTableLM.java:132)
> at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la
> yout(HTMLAbstractLM.java:137)
> at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking
> LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout
> (HTMLPageLM.java:90)
> at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE
> ngine.layout(HTMLReportLayoutEngine.java:99)
> at org.eclipse.birt.report.engine.presentation.ReportDocumentBu
> ilder.build(ReportDocumentBuilder.java:258)
> at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTas k.java:243)
> ... 24 more
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
Re: IllegalAccessError when using JNDI Url on Birt 2.5.1 [message #636995 is a reply to message #636899] |
Wed, 03 November 2010 12:52  |
Eclipse User |
|
|
|
Hector,
I can not reproduce the error. Any chance you can open a bug for this?
Jason
On 11/3/2010 5:29 AM, Hector Moneo wrote:
> Hi Jason,
> I tried
> config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSL OADER_KEY,
> YourClassThatLoadsTheEngine.class.getClassLoader());
>
> but got the same IllegalAccessError
> Regards,
> Hector
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.26189 seconds