HI,
I try to connect with JNDI to PostgreSQL database, but didn't succeed.
My environment:
-Windows 10/Oracle Linux
-JDK 17.04
-TOMCAT 10.1.16
-JRI 2.11.0
My configuration steps are. Could you help me what I done wrong or where is a configuration error:
- edited file with: %JRI_HOME%\JasperReportsIntegration\conf\application.properties
...
[datasource:pg_xy_db
type=jndi
name=pg_xy_db
...
-
added pg jdbc driver: %TOMCAT_HOME%\lib\postgresql-42.7.3.jar
-
edited file with: %TOMCAT_HOME%\webapps\jri\META-INF\context.xml
...
<Resource name="jdbc/pg_xy_db" auth="Container" type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
maxActive="20"
initialSize="0"
minIdle="0"
maxIdle="8"
maxWait="10000"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="60000"
maxAge="600000"
testWhileIdle="true"
validationQuery="select user"
rollbackOnReturn="true"
url="jdbc:postgresql://localhost:5432/xy_db?currentSchema=xy_sch"
username="xy_usr"
password="xy_pwd"
...
-
start tomcat
-
run test db connection from URL http://localhost:8080/jri and get error page with following content:
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Error while selecting user objects: ERROR: relation "dual" does not exist
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
java.lang.RuntimeException: Error while selecting user objects: ERROR: relation "dual" does not exist
Position: 352
de.oc.utils.Utils.throwRuntimeException(Utils.java:19)
de.oc.integration.jasper.webapp.Test.doGet(Test.java:131)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/10.1.26
Thx