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.

Weblogic jndi data source setup ? #58

#1

Hi there

Just doing some prototype work integrating apex with Jasper reports and just want to check jri jndi setup for weblogic server.

I have configured and deployed the jri.war to a weblogic server as below

WebLogic Server Version: 12.2.1.4.0
Java-Runtime-Version: 1.8.0_271
Data source connecting to an Oracle database 19c

On the weblogic server I created and tested a jndi/jdbc datasource and it reports as connecting ok

pic001.jpg pic002.jpg

The war file deployed ok and I can access jri admin/test screen via weblogic but getting error message below when trying to test the jndi data source

12:39:58 [INFO] jasper.webapp.Test.doGet - *** servlet /test START
12:39:58 [INFO] oc.servlet.ServletUtilities.logRequestParameters - Request parameters:
12:39:58 [INFO] oc.servlet.ServletUtilities.logRequestParameters - _dataSource: vmoJasperDS
12:39:58 [ERROR] oc.db.ConnectionUtility.getConnection - JNDI datasource vmoJasperDS could not be found. Lookup was done with java:comp/env/jdbc/vmoJasperDS
12:39:58 [ERROR] oc.utils.Utils.throwRuntimeException - JNDI datasource vmoJasperDS could not be found. Lookup was done with java:comp/env/jdbc/vmoJasperDS
12:39:58 [ERROR] oc.utils.Utils.throwRuntimeException - Other Error: JNDI datasource vmoJasperDS could not be found. Lookup was done with java:comp/env/jdbc/vmoJasperDS

The conf settings for the jndi data source are as follows -

[application]
configFileVersion=2.9.0

set the jndiPrefix, this is different for different

containers, e.g.

for Glassfish: jndiPrefix=jdbc/

for Tomcat : jndiPrefix=java:comp/env/jdbc/

jndiPrefix=java:comp/env/jdbc/

#====================================================================

Native JNDI datasource, to be configured in the application server

name: jndi_test

#====================================================================
[datasource:vmoJasperDS]
type=jndi
name=vmoJasperDS

I left the jndiPrefix as default but even if I comment this out still get same error referencing java:comp etc

Is there settings specific for weblogic that need setting in the jri.war conf file ?

Note if I setup the oracle data source used in the weblogic jdbc jndi connection as a jdbc thin connection in the conf file the test via jri runs as expected.

Just looking some advice on best way to config jri to make used of weblogic data source.

Regards

Gerard

  • replies 5
  • views 1.1K
  • likes 0
#2

Which is your version of JasperReportsIntegration, 2.10.1?
Which operating system is Weblogic running on ... Windows?

Thank you.

gmclarnon70 · Author
#3

Apologies , I thought I had included that. Versions below

JRI Version : jri-2.10.1-jasper-6.20.0
Operating System: Oracle Linux Server release 7.8
Architecture: x86_64

Regards

Gerard

#4

I could make it work on my system.
I had to change this setting in the application.properties file though:

jndiPrefix=

Give it a try, Dietmar.

gmclarnon70 · Author
#5

Thanks Dietmar

Update application.properties file and restarted Weblogic Domain and its now successfully using the Weblogic datasource.

11:27:25 [INFO] jasper.webapp.Test.doGet - *** servlet /test START
11:27:25 [INFO] oc.servlet.ServletUtilities.logRequestParameters - Request parameters:
11:27:25 [INFO] oc.servlet.ServletUtilities.logRequestParameters - _dataSource: vmoJasperDS
11:27:25 [INFO] jasper.webapp.Test.doGet - *** servlet /test END

Thanks Again for all your help.

Regards

Gerard

#6

Wonderful!!!

Thank you for raising it and improving the project. I will update the documentation to clarify the usage on Weblogic. I typically use my built-in connection pool through the application.properties file only.

Thanks again
~Dietmar.