This documentation is for Live Forms 7.3 Not for you? Earlier documentation is available too.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

 

Once you have started the Database Connector up and running and configured with your database, access the connector by typing the status URL below directly in your browser to quickly verify proper installation.

Tomcat Bundle:

http://localhost:8082/database/status - Change localhost and port 8082 to the <server> and <port> for your  tomcat  installation where you are deploying the connector.

Standalone:

http://localhost:8081/database/status - the default port for Standalone mode is 8081. Change localhost and port 8081 to the <server> and <port> where you installed the Standalone connector.


The configuration model shows two additional properties: lastModified and digest. These properties are set when the configuration.xml is read and will change when modifications are made to the configuration.xml file.
  • SHA-1 digest of of all the file content is generated
  • Date/time of the last modification to configuration.xml.

On this page:

QuerySet/Query Validation

When the Database Connector loads the configuration.xml, validation for all the statements, querysets and queries in the configuration.xml file is performed. Validation results are shown when you browse the status URL and appropriate error messages are displayed in the browser.

This provides an easy way to find all syntactic or schema related issues such as:

  • If a Retrieve operation or template is not properly defined in the configuration.xml
  • If a query is empty or disabled
  • Invalid Query statement
  • Invalid credentials

  • Incomplete xml element

  • Database URL parameter is not present

You may also see warnings for valid queries. For example, it is recommended that the useServerPrepStmts=true to a MySQL connection url to improve statement validation. If this parameter is missing, you may see a warning message to add it.    
If the configuration.xml file is not found, the status URL will report it immediately. See the Common Problems section for some examples.

When the Database Connector is running, it is constantly looking for configuration.xml file changes. If you have to make a change to a query in your configuration.xml to fix a reported issue, you Do not have to restart after you make the correction.The connector will pick up the changes.

The image shows the the queryset/query validation and other entries that you will see in the database log file when the connector loads.

REST parameters for the test URL

It is very helpful to first test your queries by entering the query URL directly into your web browser and verify that the data resultset returned to your browser as a web page is as you expect.

Once you have the Database Connector working with your database you can test your query by copying a test URL into your browser.

The URL to the database connector has the following REST parameters:

http://<host>:<port>/database/<queryset-name>/<query-name>

Where:

  • <host> - the URL for the web server on which you deployed database.war.
  • <port> - port where the container is listening for http requests. This defaults to 8082 if the database connector was deployed in the  tomcat bundle or port 8081 if you are running the Database Connector in Standalone mode.
  • <queryset name> - queryset name defined in the database connector configuration file.
  • <query name> – query name  defined in the database connector configuration file.

Logfiles

The Database Connector uses SLF4J with logback, which is the same logging infrastructure used in  .

Log MDC entries for configuration path, the querySet name, the query name, correlation.id, tenant id, subject.id. These will be captured when processing client requests.

11:37:25.394 |-WARN  [http-nio-8082-exec-8] [c.f.c.d.s.MetaDataService] [mycompany ] [26d27ffe-1213-4c82-890b-cdc1a2e00e87 ] [  ] - Could not find retrieve operation for query STUDENT/addStudent. Skipping ...
11:37:27.186 |-ERROR [http-nio-8082-exec-8] [    c.f.c.d.QueryResource] [mycompany ] [26d27ffe-1213-4c82-890b-cdc1a2e00e87 ] [  ] - Error processing request for querySet STUDENT

It is very often useful to know the database and database driver name and version that is being used.  This information can be found in the logfile. An example is shown below:

2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DriverName: Microsoft JDBC Driver 6.3 for SQL Server
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DriverVersion: 6.3.1.0
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DriverMajorVersion: 6
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DriverMinorVersion: 3
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DatabaseProductName: Microsoft SQL Server
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DatabaseProductVersion: 14.00.900
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DatabaseMajorVersion: 14
2017-09-15 15:50:01.554  INFO   28614 --- [ost-startStop-1] c.f.c.d.service.ConfigurationService     : DatabaseMinorVersion: 0

Exceptions are properly logged with their stacktraces. This makes it easier to diagnose errors, which sometimes are frevvo/DBConnector specific and sometimes database specific.

All JDBC statements are logged in the DEBUG logging level. This includes the actual SQL statement used, the actual arguments, the number or rows returned and whether it was successful.

There are different logfiles for the Standalone and tomcat bundle installations.

Standalone mode

  1. Three logfiles are created in the \database\database-connector-2.5.3\logs directory:
    1. DbConnector.err.log - there is no content in this log at this time
    2. DbConnector.out.log - database connector standard out file. You can see the version of the database connector that is running in this file.
    3. DbConnector.wrapper.log - Date/Times of connector starts/stops when the Database Connector is running as a service.
  2. database-connector.YYYY-MM-DD.log - This is the main logfile for the Database Connector. You can see the results of the queryset/queries validation and output error messages in this file.

Turning on DEBUG level logging in Standalone Mode:

Log levels are controlled by the logging.level.com.frevvo.connectors.database property. Add this property to the <db-home>\database-connector-2.5.3\config\dbconnector.properties file. Restart the connector.

Create the Database Connector log in JSON format

The spring.profiles.include=logging-json property creates the logfile in JSON format. Add this property to the <db-home>\database-connector-2.5.3\config\dbconnector.properties file. Restart the connector.

Tomcat bundle

When debugging database queries refer to output error messages in <frevvo-home>\tomcat\logs\database-connector.YYYY-MM-DD.log

Turning on DEBUG level logging

Log levels are controlled by the logging.level.com.frevvo.connectors.database property.

To change the log level to DEBUG when using the tomcat bundle, follow these steps:

  1. Stop if it is running.
  2. Navigate to the <frevvo-home>\tomcat\conf directory
  3. Create/Edit the frevvo-config.properties file
  4. Add the logging.level.com.frevvo.connectors.database property with a value of DEBUG as shown

     logging.level.com.frevvo.connectors.database=DEBUG
  5. Save the file
  6. Restart
Create the Database Connector log in JSON format

Creating logfiles in JSON format

If you want to create the connector logs in JSON format, add the spring.profiles.include=logging-json property to the frevvo-config.properties file. This property creates json logfiles for all of the frevvo spring boot based connectors - Database, Box, Filesystem, Google and SharePoint. Support for the frevvo.log file will be added in a future release. Creating the logfiles in the same format will make searching across all logs easier.

frevvo-config.properties - This property will create logs in JSON format for all connector logs
spring.profiles.include=logging-json 

Common Problems

Doc Post Failure

If the submission doesn't reach the Database Connector, all tenant administrators or flow admins (if configured)  will receive a Doc Post Failure notification email reporting information about the error. Verify that the URL to the location of your database connector is correct in business rules or Doc URI's

Live Forms tomcat running on non-default port

If you have configured your tomcat in <frevvo-home>/tomcat/conf/server.xml to run on a port other than the default 8082, then you must set the port in the Url to the database connector to that different port number.

This will not work: http://localhost:8082/database/myStore/allOrders. Change 8082 to your tomcat port.

Your browser is not on the same machine as the database connector

If your web browser is not running on the machine where your database connector is installed then you cannot use "localhost" in the Url. You must replace this with the name or ipaddr of the machine running the database connector.

This will not work: http://localhost:8082/database/myStore/allOrders. Change "localhost" to the actual hostname or ipaddr. 

The configuration.xml file is not found

If the Database Connector cannot find the configuration.xml file, an error message will be reported in the browser:

Check the reported path. Verify that the configuration.xml is present in the same directory as the database.war file or in the C:\database\database-connector-2.5.2\config directory for a Standalone installation. If you are running the connector in the tomcat bundle, verify that the value of the  "frevvo.connectors.database.configuration parameter in the <frevvo-home>\tomcat\conf\dbconnector.properties file reflects the correct location of the configuration.xml.

<Parameter name="frevvo.connectors.database.configuration" value="c:\<frevvo-home>\frevvo\dbconfig\configuration.xml" override="false"/>

The format of your test query URL is invalid

If you type an invalid URL into the browser when testing a query, you will see this message:

Revise the URL to follow the correct format.

 

 

 

 

 

  • No labels