Esri / geoportal-server

Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
https://gptogc.esri.com/geoportal
Apache License 2.0
244 stars 149 forks source link

Recurring messages about database connection in gpt log file #201

Closed rajk1 closed 8 years ago

rajk1 commented 8 years ago

Hi,

I keep seeing a lot of recurring messages in the gpt log file like the following. I know the database connection works since I can upload metadata records. Any ideas how to fix/troubleshoot the underlying cause of those messages as they 'grow' the log file very quickly.

I'm on Windows 2008 R2 server; GeoPortal 1.2.6; Apache Tomcat 6.0.32; SQL Server 2008

Thanks. Raj

Feb 24, 2016 1:14:47 PM com.esri.gpt.control.webharvest.engine.TaskQueue next WARNING: [SYNCHRONIZER] Error fetching next task org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at com.esri.gpt.framework.sql.DatabaseReference.openJndiConnection(Unknown Source) at com.esri.gpt.framework.sql.DatabaseReference.openConnection(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnection.(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnections.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.ConnectionBroker.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.BaseDao.returnConnection(Unknown Source) at com.esri.gpt.catalog.harvest.jobs.HjGetNextRequest.execute(Unknown Source) at com.esri.gpt.control.webharvest.engine.TaskQueue.next(Unknown Source) at com.esri.gpt.control.webharvest.engine.Worker.next(Unknown Source) at com.esri.gpt.control.webharvest.engine.Worker.execute(Unknown Source) at com.esri.gpt.control.webharvest.engine.WorkerBase.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(Unknown Source) at java.sql.DriverManager.getDriver(Unknown Source) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437) ... 14 more Feb 24, 2016 1:14:47 PM com.esri.gpt.control.webharvest.engine.WatchDog run SEVERE: [SYNCHRONIZER] Error loading tasks for Watch-dog. org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at com.esri.gpt.framework.sql.DatabaseReference.openJndiConnection(Unknown Source) at com.esri.gpt.framework.sql.DatabaseReference.openConnection(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnection.(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnections.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.ConnectionBroker.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.BaseDao.returnConnection(Unknown Source) at com.esri.gpt.catalog.harvest.jobs.HjLoadAllRequest.execute(Unknown Source) at com.esri.gpt.control.webharvest.engine.WatchDog.selectAll(Unknown Source) at com.esri.gpt.control.webharvest.engine.WatchDog.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(Unknown Source) at java.sql.DriverManager.getDriver(Unknown Source) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437) ... 12 more

mhogeweg commented 8 years ago

hi, this typically happens when there is a problem with the JNDI configuration. please check gpt.xml for

    <databaseReference name="gpt" jndiName="jdbc/gpt"/>

(also make sure gpt.xml is valid XML!) and then also check ...Tomcat\conf\Catalina\localhost\geoportal.xml (assuming your website is named 'geoportal' and make sure the database connection is correct.

finally, make sure the database jdbc jar file is present (in Tomcat or in the Geoportal web app).

rajk1 commented 8 years ago

I've checked the gpt.xml file and everything looks good. Database connection in geoportal.xml file also looks good. The GeoPortal app itself works as I can log in and import metadata records. But I still keep seeing those messages.

Here is the confusing part. Just after complaining about not being able to create JDBC driver it indicates that "Connection opened for gpt, jndiName ...". Please see gpt logs below near the bottom. So this clearly indicates that some parts that need to connect to the database are working but other parts like the webharvester is not. Any ideas?

Feb 26, 2016 11:11:58 AM com.esri.gpt.control.webharvest.engine.TaskQueue next WARNING: [SYNCHRONIZER] Error fetching next task org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at com.esri.gpt.framework.sql.DatabaseReference.openJndiConnection(Unknown Source) at com.esri.gpt.framework.sql.DatabaseReference.openConnection(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnection.(Unknown Source) at com.esri.gpt.framework.sql.ManagedConnections.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.ConnectionBroker.returnConnection(Unknown Source) at com.esri.gpt.framework.sql.BaseDao.returnConnection(Unknown Source) at com.esri.gpt.catalog.harvest.jobs.HjGetNextRequest.execute(Unknown Source) at com.esri.gpt.control.webharvest.engine.TaskQueue.next(Unknown Source) at com.esri.gpt.control.webharvest.engine.Worker.next(Unknown Source) at com.esri.gpt.control.webharvest.engine.Worker.execute(Unknown Source) at com.esri.gpt.control.webharvest.engine.WorkerBase.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(Unknown Source) at java.sql.DriverManager.getDriver(Unknown Source) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437) ... 14 more Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference openConnection FINE: Connection opened for gpt, jndiName: jdbc/gpt, productName: Microsoft SQL Server, driver: Microsoft JDBC Driver 4.0 for SQL Server 4.0.2206.100 Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference openConnection FINE: Connection opened for gpt, jndiName: jdbc/gpt, productName: Microsoft SQL Server, driver: Microsoft JDBC Driver 4.0 for SQL Server 4.0.2206.100 Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference closeConnection FINE: Closing connection for gpt, jndiName: jdbc/gpt Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference closeConnection FINE: Closing connection for gpt, jndiName: jdbc/gpt Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference openConnection FINE: Connection opened for gpt, jndiName: jdbc/gpt, productName: Microsoft SQL Server, driver: Microsoft JDBC Driver 4.0 for SQL Server 4.0.2206.100 Feb 26, 2016 11:11:58 AM com.esri.gpt.framework.sql.DatabaseReference closeConnection FINE: Closing connection for gpt, jndiName: jdbc/gpt

rajk1 commented 8 years ago

The following is from the start of the gpt log file after the Tomcat service was stopped and log files deleted and tomcat service restarted. It indicates that database connectivity is working fine. So it's a mystery to me why further down the log file there are messages about issues with the database connection.

Feb 26, 2016 1:10:46 PM com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.0.3 (FCS b03) for context '/geoportal' Feb 26, 2016 1:10:48 PM org.apache.struts.action.ActionServlet initChain INFO: Loading chain catalog from jar:file:/C:/GeoPortal/Apache%20Software%20Foundation/Tomcat%206.0/webapps/geoportal/WEB-INF/lib/struts-tiles-1.3.10.jar!/org/apache/struts/tiles/chain-config.xml Feb 26, 2016 1:10:48 PM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory INFO: Tiles definition factory loaded for module ''. Feb 26, 2016 1:10:48 PM com.esri.gpt.framework.context.InitializationServlet init INFO: Initializing ApplicationContext... Feb 26, 2016 1:10:48 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader load FINE: Loading configuration file: gpt/config/gpt.xml Feb 26, 2016 1:10:49 PM com.esri.gpt.framework.sql.DatabaseReference openConnection FINE: Connection opened for gpt, jndiName: jdbc/gpt, productName: Microsoft SQL Server, driver: Microsoft JDBC Driver 4.0 for SQL Server 4.0.2206.100 Feb 26, 2016 1:10:49 PM com.esri.gpt.framework.sql.DatabaseReference closeConnection FINE: Closing connection for gpt, jndiName: jdbc/gpt Feb 26, 2016 1:10:49 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadDcatMappings FINE: Loading dcat mapping file: gpt/metadata/dcat-mappings.xml Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadHarvesterConfiguration INFO: [SYNCHRONIZER] Missing "webharvester.poolSize" parameter. Default 4 will be used instead. Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadHarvesterConfiguration INFO: [SYNCHRONIZER] Missing "webharvester.autoSelectFrequency" parameter. Default 3,600,000 will be used instead. Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadHarvesterConfiguration INFO: [SYNCHRONIZER] Missing "webharvester.watchDogFrequency" parameter. Default 60,000 will be used instead. Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadHarvesterConfiguration INFO: [SYNCHRONIZER] Missing "webharvester.baseContextPath" parameter. Harvest notification messages will be sent without information about harvest report. Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader loadHarvesterConfiguration INFO: [SYNCHRONIZER] Missing "webharvester.resource.autoApprove" parameter. Default false will be used instead. Feb 26, 2016 1:10:51 PM com.esri.gpt.framework.context.ApplicationConfigurationLoader load

umacgillivray commented 8 years ago

@rajk1 Hi, Maybe you have more than one geoportal webapp deployed, both pointing to the same log file?

rajk1 commented 8 years ago

Thanks @umacgillivray, mystery solved. That was it. There was an older version of GeoPortal on the same server which was renamed but not removed.