Thanks for the reply. I have changed resource name from âjdbc/postgresâ to âjdbc/ProcessEngineâ still I was getting camunda tables does not exist error.
Then I dropped all database cleared all servers and I have created new database named âcamundaâ and and ran all the script file provided in distribution tomcat.
While starting tomcat its just getting closed after logging below error in catalinaâŚlog file,
PF detailed error log : catalina.2017-07-01.log (45.0 KB)
I donât understand error is clearly showing that itâs not finding camunda database but still I am unable to resolve it.
I am new to postgresql, so I have also validated JDBC connection by custom JAVA code, it works fine.
Can anyone please look into this issue? If you need more info please let me know.
Hence you may want to create this schema first, then run the create table scripts in the context of this schema. Alternatively, create the schema, then let the engine create the tables if you are using a packaged distribution
Thank you, this resolve my issue. Now I am able to connect my database.
I donât know if I need to define any specific postgresql server configuration to connect its database.
PFB snapshot,
As earlier I was connecting to camunda database of PostgreSQL 9.0 and I was getting âorg.postgresql.util.PSQLException: FATAL: database âcamundaâ does not existâ . Then I have created camunda schema in PostgreSQL 9.6 and run the tomcat. Its get connected and also all tables has been generated automatically.
Also in camunda documentation it has been mentioned that there should be execute scripts explicitly given in distribution tomcat server to create camunda tables/indices etc. But here its get generated automatically. I donât know how.
Configuring a PostgreSQL Datasource in Apache Tomcat
Step 1. Shut down Tomcat
Run bin/shutdown.sh or bin/shutdown.bat to bring Tomcat down while you are making these changes.
Make a backup of your <CONFLUENCE_HOME>/confluence.cfg.xml file and your <CONFLUENCE_INSTALLATION>/conf/server.xml file, so that you can easily revert if you have a problem.
Step 2. Install the PostgreSQL Server database driver
Download the PostgreSQL Server JDBC driver JAR file.
Alternatively, you can get the driver from your Confluence installation: /confluence/WEB-INF/lib/postgresql-x.x-x.jdbcx.jar , where âxâ represents a version number. ``
Copy the JAR file into the lib folder of your Tomcat installation: <TOMCAT-INSTALLATION>/lib .
Step 3. Configure Tomcat
Edit the conf/server.xml file in your Tomcat installation.
Find the following lines:
<Context path="" docBase="../confluence" debug="0" reloadable="true">
<!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
Insert the DataSource Resource element inside the Context element, directly after the opening <Context.../> line, before Manager :
<!-- If you're using Confluence 5.7 or below; change maxTotal to maxActive -->
<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
username="postgres"
password="postgres"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/yourDatabaseName"
maxTotal="25"
maxIdle="10"
validationQuery="select 1" />
Replace the username and password parameters with the correct values for your database
In the url parameter, replace the word â yourDatabaseName â with the name of the database your Confluence data will be stored in.
Notes:
If switching from a direct JDBC connection to data source, you can find the above details in your <CONFLUENCE_HOME>/confluence.cfg.xml file.
Here are the configuration properties for Tomcatâs standard data source resource factory ( org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory ):
driverClassName â Fully qualified Java class name of the JDBC driver to be used.
max total â The maximum number of database connections in the pool at the same time.
maxIdle â The maximum number of connections that can sit idle in this pool at the same time.
maxWaitMillis â The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception.
password â Database password to be passed to our JDBC driver.
url â Connection URL to be passed to our JDBC driver. (For backward compatibility, the property driverName is also recognized.)
user â Database username to be passed to our JDBC driver.
validationQuery â SQL query that can be used by the pool to validate connections before they are returned to the application. If specified, this query MUST be an SQL SELECT statement that returns at least one row.
Why is the validationQuery element needed? When a database server reboots, or there is a network failure, all the connections in the connection pool are broken and this normally requires a Application Server reboot. However, the Commons DBCP (Database Connection Pool) which is used by the Tomcat application server can validate connections before issuing them by running a simple SQL query, and if a broken connection is detected, a new one is created to replace it. To do this, you will need to set the âvalidation queryâ option on the database connection pool.
Step 4. Configure the Confluence web application
Edit this file in your Confluence installation: <CONFLUENCE_INSTALLATION>/ confluence/WEB-INF/web.xml.
Insert the following element just before </web-app> near the end of the file: