PDA

View Full Version : JNDI for classic report engine



kaushiks
05-11-2012, 10:03 AM
I'm developing a Java web application running on tomcat. I'v integrated a report using Pentaho Report SDK 3.8, the report displays fine with JDBC configuration, but how do we configure it using JNDI? It works fine with JNDI data source in PRD. But in report engine I get the following exception:-


ParentException: java.lang.UnsupportedOperationException: Not supported by BasicDataSource
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1062)
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.JndiConnectionProvider.createConnection(JndiConnectionProvider.java:142)
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.getConnection(SimpleSQLReportDataFactory.java:184)
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.queryData(SimpleSQLReportDataFactory.java:239)
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SQLReportDataFactory.queryData(SQLReportDataFactory.java:95)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:135)
at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:421)
at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryStatic(CachingDataFactory.java:183)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:130)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:85)
at org.pentaho.reporting.engine.classic.core.states.datarow.ReportDataRow.createDataRow(ReportDataRow.java:97)
at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performSubReportQuery(DefaultFlowController.java:260)
at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.initializeForSubreport(ProcessState.java:444)
at org.pentaho.reporting.engine.classic.core.states.process.InlineSubreportProcessor.process(InlineSubreportProcessor.java:130)
at org.pentaho.reporting.engine.classic.core.states.process.EndGroupHandler.commit(EndGroupHandler.java:52)
at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.commit(ProcessState.java:831)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processPrepareLevels(AbstractReportProcessor.java:427)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.performStructuralPreprocessing(AbstractReportProcessor.java:594)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.prepareReportProcessing(AbstractReportProcessor.java:496)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processReport(AbstractReportProcessor.java:1522)
at com.ReportServlet.execute(RepSe.java:97)
at com.ReportServlet.doGet(RepSe.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)

I added the following resource to context.xml file of tomcat


<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="5" maxWait="10000"
name="jndiname" password="pass" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/db" username="root"/>

Taqua
05-11-2012, 10:09 AM
You have set a username and password in the PRPT itself. This does not go well with most JNDI implementations. Clear the username/password in the security-dialog inside your SQL-datasource in PRD, and you will be fine.

kaushiks
05-12-2012, 12:41 AM
The username/password in the security-dialog inside SQL-datasource in PRD were blank but still the PRPT file had username/password set as 'root'. Is it a bug? I deleted them and it worked. Thanks.