Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

JasperReportsIntegration connection test not working with JNDI #5

ajitabhpandey · · author

I am using JasperReportsIntegration 2.4.0 with Tomcat 7 and Oracle- XE11gR2.

I am not able to run a basic connectivity test using the JNDI. The logs indicate -

org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Test] in context with path [/JasperReportsIntegration] threw exception
        at de.oc.integration.jasper.webapp.Test.doGet(Unknown Source)
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at org.apache.catalina.core.StandardWrapperValve.invoke(
        at org.apache.catalina.core.StandardContextValve.invoke(
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
        at org.apache.catalina.core.StandardHostValve.invoke(
        at org.apache.catalina.valves.ErrorReportValve.invoke(
        at org.apache.catalina.valves.AccessLogValve.invoke(
        at org.apache.catalina.core.StandardEngineValve.invoke(
        at org.apache.catalina.connector.CoyoteAdapter.service(
        at org.apache.coyote.ajp.AjpProcessor.process(
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
        at org.apache.tomcat.util.threads.TaskThread$

The /usr/share/tomcat/webapps/JasperReportsIntegration/WEB-INF/conf/ file has the following lines -


And, the file /usr/share/tomcat/webapps/JasperReportsIntegration/META-INF/context.xml has the following content -

<Resource name="jdbc/jndi_test" auth="Container" type="javax.sql.DataSource"
              maxActive="20" maxIdle="10" maxWait="-1"
              initialSize="10" minIdle="3" validationQuery="select user from dual"
              testWhileIdle="true" testOnBorrow="true" timeBetweenEvictionRunsMillis="300000"
              numTestsPerEvictionRun="100" minEvictableIdleTimeMillis="10000"

  • replies 11
  • views 2.2K
  • likes 0
Dietmar Aust daust · · moderators


since you are using an Oracle Connection, I would suggest you use the jdbc approach and not the jndi approach, at lot easier to configure:

# JDBC datasource configuration
# type=jndi|jdbc

Does that help?


Dietmar Aust daust · · moderators

Hi @ajitabhpandey,

did the jdbc connection configuration work?
If so, please mark it as "answer" to indicate that the ticket is closed.


daust added the waiting for reply from reporter label
ajitabhpandey · · author

Yes, that is what I have been using. The disadvantage here is I can not specify the number of connections min/max open for the database. As I mentioned in one of the other questions I posted, I think we are running out of database connections and I would like to use a pool of open connections which can be used by JasperReportsIntegration and hence looking at JNDI.

Dietmar Aust daust · · moderators

Hi @ajitabhpandey ,

I think you have been using version 2.5.x, there was a problem with the Oracle JDBC drivers. Thus, the connections didn't get cleaned up properly. For release 2.6 I have changed the jdbc connection to using the Oracle Universal Connection Pool (UCP). The connections get cleaned up properly now.

Currently, I have hardcoded 5 connections and 50 max. These are parallel running connections:

I can make it configurable later on, but for now it should work well in most cases.

Dietmar Aust daust · · moderators

Please give it a try and test with (pre-release) version 2.6.0.


Not sure if same issue, but we add all of our JNDI entries to /tomcat/conf/context.xml
Adding to JasperReportsIntegration/META-INF/context.xml does not seem to pick up the JNDI for us.
When added to /tomcat/conf/context.xml it works fine for me.

Dietmar Aust daust · · moderators

Hi @DavidGhedini,

please check the settings for the <Host parameter.

You should at least have deployXML=true. If it is false (the default), it will not pick up the JNDI settings from META-INF/context.xml.

My test settings are:

<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"

I was playing with copyXML, too. If true, it will copy the context.xml file to $CATALINA_HOME/conf/Catalina/localhost/jri.xml (or whatever the name of the war-file is).

In 2.6.0 and 2.6.1 I omitted the initial context.xml file from the META-INF directory in the war file. In 2.6.2 it will be there.

Does that help?


Hi @daust -
For the current JRI Publisher release we'll stick with inserting PGSQL, MSSQL, and MySQL into /tomcat/conf/context.xml
I've updated our Release numbers to match your own (if that's OK).
When it changes in 2.6.2, we'll update the module accordingly. We have an editor for the /conf/context.xml file in the current release, so we will add an editor for /app.xml in next release as well.
Thanks again,

Dietmar Aust daust · · moderators

Hi @DavidGhedini ,

sounds good.

Please make sure to test with the configuration copyXML="false">, because in release 2.6.2 the (empty) file jri.xml will be created. Make sure, it doesn't cause any issues, although I believe it won't.



Hi @daust
I've tested with 2.6.2 and it works fine.