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
java.lang.NullPointerException
at de.oc.integration.jasper.webapp.Test.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
The /usr/share/tomcat/webapps/JasperReportsIntegration/WEB-INF/conf/application.properties file has the following lines -
[datasource:jndi_test]
type=jndi
name=hr
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"
driverClassName="oracle.jdbc.OracleDriver"
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"
url="jdbc:oracle:thin:@127.0.0.1:1521:XE"
username="hr"
password="password"
/>