0

I have a Spring boot app, with a database. For testing I used the H2 database and everything works fine. Now I'm trying to deploy my app on Heroku. In my activity feed I get the message the the build is succesfull and that the app was deployed. When I go to the URL I get an Application Error.

I'm guessing that there is a problem with my connection to the postgresql database. In Spring I'm using the JPARepository.

this is my application.properties file, this from my H2 database, so not very usefull now:

spring.h2.console.enabled=true
spring.h2.console.path=/console

on heroku I have the following config vars:

Heroku Config Vars

See image: the database url was filled in, password is a copy of the database settings on heroku, spring database url jdbc:postgresql:host database credentials:5432/database name and username is also a copy of the database user name

this is my pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0     http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>info.climbinggyms</groupId>
<artifactId>main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>main</name>
<description>website with an overview of the existing climbing gyms</description>

<properties>
    <java.version>8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>



    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
    </dependency>



    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>

            <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.3</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>4.3.1.RELEASE</version>
    </dependency>


    <dependency>
        <groupId>nz.net.ultraq.thymeleaf</groupId>
        <artifactId>thymeleaf-layout-dialect</artifactId>
        <version>2.3.0</version>
    </dependency>

    <!--
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    -->


</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

This is my log:

2019-03-12T20:13:26.055651+00:00 app[web.1]: 
2019-03-12T20:13:26.055693+00:00 app[web.1]:   .   ____          _            __ _ _
2019-03-12T20:13:26.055748+00:00 app[web.1]:  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2019-03-12T20:13:26.055804+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2019-03-12T20:13:26.055873+00:00 app[web.1]:  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2019-03-12T20:13:26.055908+00:00 app[web.1]:   '  |____| .__|_| |_|_| |_\__, | / / / /
2019-03-12T20:13:26.055962+00:00 app[web.1]:  =========|_|==============|___/=/_/_/_/
2019-03-12T20:13:26.057441+00:00 app[web.1]:  :: Spring Boot ::        (v2.1.3.RELEASE)
2019-03-12T20:13:26.057564+00:00 app[web.1]: 
2019-03-12T20:13:26.448731+00:00 app[web.1]: 2019-03-12 20:13:26.428  INFO 4 --- [           main] info.climbinggyms.main.MainApplication   : Starting MainApplication v0.0.1-SNAPSHOT on 3853ed86-86c8-4fb2-8e13-6f34d48b748e with PID 4 (/app/target/main-0.0.1-SNAPSHOT.jar started by u45998 in /app)
2019-03-12T20:13:26.458624+00:00 app[web.1]: 2019-03-12 20:13:26.458  INFO 4 --- [           main] info.climbinggyms.main.MainApplication   : No active profile set, falling back to default profiles: default
2019-03-12T20:13:29.684952+00:00 app[web.1]: 2019-03-12 20:13:29.683  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-03-12T20:13:30.153545+00:00 app[web.1]: 2019-03-12 20:13:30.149  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 450ms. Found 4 repository interfaces.
2019-03-12T20:13:31.821390+00:00 app[web.1]: 2019-03-12 20:13:31.820  INFO 4 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$319e3998] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-12T20:13:33.320904+00:00 app[web.1]: 2019-03-12 20:13:33.320  INFO 4 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 21282 (http)
2019-03-12T20:13:33.430459+00:00 app[web.1]: 2019-03-12 20:13:33.430  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-03-12T20:13:33.430662+00:00 app[web.1]: 2019-03-12 20:13:33.430  INFO 4 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-03-12T20:13:33.446525+00:00 app[web.1]: 2019-03-12 20:13:33.446  INFO 4 --- [           main] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/app/.jdk/jre/lib/amd64/server::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2019-03-12T20:13:33.589450+00:00 app[web.1]: 2019-03-12 20:13:33.589  INFO 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-03-12T20:13:33.589765+00:00 app[web.1]: 2019-03-12 20:13:33.589  INFO 4 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 6086 ms
2019-03-12T20:13:34.018325+00:00 app[web.1]: 2019-03-12 20:13:34.017 ERROR 4 --- [           main] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.
2019-03-12T20:13:34.018337+00:00 app[web.1]: 
2019-03-12T20:13:34.018339+00:00 app[web.1]: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
2019-03-12T20:13:34.018340+00:00 app[web.1]:    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:280) ~[postgresql-42.2.5.jar!/:42.2.5]
2019-03-12T20:13:34.018348+00:00 app[web.1]:    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.5.jar!/:42.2.5]
2019-03-12T20:13:34.018350+00:00 app[web.1]:    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) ~[postgresql-42.2.5.jar!/:42.2.5]
2019-03-12T20:13:34.018352+00:00 app[web.1]:    at org.postgresql.Driver.makeConnection(Driver.java:454) ~[postgresql-42.2.5.jar!/:42.2.5]
2019-03-12T20:13:34.018353+00:00 app[web.1]:    at org.postgresql.Driver.connect(Driver.java:256) ~[postgresql-42.2.5.jar!/:42.2.5]
2019-03-12T20:13:34.018354+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319) ~[tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018355+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212) ~[tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018357+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:739) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018358+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:671) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018359+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:483) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018361+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018362+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018363+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018365+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) [tomcat-jdbc-9.0.16.jar!/:na]
2019-03-12T20:13:34.018371+00:00 app[web.1]:    at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) [spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
2019-03-12T20:13:34.018372+00:00 app[web.1]:    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) [spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
2019-03-12T20:13:34.018374+00:00 app[web.1]:    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) [spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
2019-03-12T20:13:34.018375+00:00 app[web.1]:    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319) [spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
2019-03-12T20:13:34.018376+00:00 app[web.1]:    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356) [spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
2019-03-12T20:13:34.018378+00:00 app[web.1]:    at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:73) [spring-boot-autoconfigure-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
2019-03-12T20:13:34.018379+00:00 app[web.1]:    at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:142) [spring-boot-autoconfigure-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
2019-03-12T20:13:34.018381+00:00 app[web.1]:    at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:113) [spring-boot-autoconfigure-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
2019-03-12T20:13:34.018383+00:00 app[web.1]:    at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$5074fc07.CGLIB$jpaVendorAdapter$8(<generated>) [spring-boot-autoconfigure-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]

and so on

1
  • Hi Bleau, It seems that you are trying to connect to localhost:5432 and you get a connection exception: org.postgresql.util.PSQLException. Can you share your connection configuration? Commented Mar 12, 2019 at 22:47

3 Answers 3

1

@Cristian I'm not sure, it still looks like there is a problem with the connection to the db, this is a longer extract of my log:

2019-03-13T17:33:07.688970+00:00 app[web.1]: 2019-03-13 17:33:07.688 ERROR 4 --- [           main] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.

2019-03-13T17:33:07.688986+00:00 app[web.1]: 

2019-03-13T17:33:07.688988+00:00 app[web.1]: org.postgresql.util.PSQLException: The connection attempt failed.

2019-03-13T17:33:07.688990+00:00 app[web.1]:    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292) ~[postgresql-42.2.5.jar!/:42.2.5]

2019-03-13T17:33:07.688991+00:00 app[web.1]:    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.5.jar!/:42.2.5]

2019-03-13T17:33:07.688993+00:00 app[web.1]:    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) ~[postgresql-42.2.5.jar!/:42.2.5]

2019-03-13T17:33:07.688995+00:00 app[web.1]:    at org.postgresql.Driver.makeConnection(Driver.java:454) ~[postgresql-42.2.5.jar!/:42.2.5]

2019-03-13T17:33:07.688996+00:00 app[web.1]:    at org.postgresql.Driver.connect(Driver.java:256) ~[postgresql-42.2.5.jar!/:42.2.5]

2019-03-13T17:33:07.688997+00:00 app[web.1]:    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319) ~[tomcat-jdbc-9.0.16.jar!/:na]

this is my pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>info.climbinggyms</groupId>
    <artifactId>main</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>main</name>
    <description>website with an overview of the existing climbing gyms</description>

    <properties>
        <java.version>8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>



        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>



        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

                <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.3</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>4.3.1.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>nz.net.ultraq.thymeleaf</groupId>
            <artifactId>thymeleaf-layout-dialect</artifactId>
            <version>2.3.0</version>
        </dependency>

        <!--
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        -->


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

this is my properties file:

spring.datasource.driverClassName=${SPRING_DATASOURCE_DRIVER-CLASS-NAME}
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}

spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create



spring.datasource.tomcat.initial-size=15
spring.datasource.tomcat.max-wait=20000
spring.datasource.tomcat.max-active=50
spring.datasource.tomcat.max-idle=15
spring.datasource.tomcat.min-idle=8
spring.datasource.tomcat.default-auto-commit=true

# Hibernate specific properties
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.id.new_generator_mappings=false

I'm using the JPA interface:

package info.climbinggyms.main;

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.UUID;

public interface PictureRepository extends JpaRepository<Picture, UUID> {
}

and these are my heroku config vars:

DATABASE_URL: postgres://sbrjqzkrjkkzmc:c23d70564aa42650ea2cd1f45321a1112096f86564a2b86766ba36adf8dffa35@ec2-54-247-85-251.eu-west-1.compute.amazonaws.com:5432/dedt2i3dl1k7sm
SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver
SPRING_DATASOURCE_PASSWORD: c23d70564aa42650ea2cd1f45321a1112096f86564a2b86766ba36adf8dffa35
SPRING_DATASOURCE_TYPE: org.apache.tomcat.jdbc.pool.DataSource
SPRING_DATASOURCE_URL: jdbc:postgresql://sbrjqzkrjkkzmc:c23d70564aa42650ea2cd1f45321a1112096f86564a2b86766ba36adf8dffa35@ec2-54-247-85-251.eu-west-1.compute.amazonaws.com:5432/dedt2i3dl1k7sm
SPRING_DATASOURCE_USERNAME: sbrjqzkrjkkzmc
SPRING_JPA_DATABASE-PLATFORM: org.hibernate.dialect.PostgreSQLDialect
SPRING_JPA_HIBERNATE_DDL-AUTO: update
Sign up to request clarification or add additional context in comments.

1 Comment

Please read the update on my answer, you may need to update the SPRING_DATASOURCE_URL on heroku.
0

As per the log file you share, you are trying to connect to localhost:5432 and you receive an Exception org.postgresql.util.PSQLException. According to your image, heroku database should have a domain name like: ec2-54-247-85-251.eu-wexxxxx.

You should use the environment variables defined by heroku, you can accchieve this by modifying the properties of your app:

application.properties

spring.datasource.driverClassName=${SPRING_DATASOURCE_DRIVER-CLASS-NAME}
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}

Please refer to heroku documentation and reference for spring-boot.

UPDATE

It seems that postgresql driver does not support the format you have on your datasource url, you need to follow next formats:

jdbc:postgresql:<host>:<port>/<database>

Given you define spring.datasource.username and spring.datasource.password.

Or

jdbc:postgresql:<host>:<port>/<database>?user=<username>&password=<password>

Note: You may get a InvocationTargetExeption due to LOB creation as createClob(), that is hibernate attempting to setup a function postgresql does not implement, you can ignore exception.

Important: Reset your credentials so none can have access to your instance.

5 Comments

I added this to my apllication.properties and I still have the same problem. All the documentation above is for JDBC, I'm using JPA, does that matter? Here are my settings: SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver SPRING_DATASOURCE_PASSWORD: pw copied from heroku db settings SPRING_DATASOURCE_TYPE: org.apache.tomcat.jdbc.pool.DataSource SPRING_DATASOURCE_URL: jdbc:postgresql://sbrjqzkrjkkzmc:c23d70564aa42650ea2cd1f45321a1112096f86564a2b86766ba36adf8dffa35@ec2-54-247-85-251.eu-west-1.compute.amazonaws.com:5432/dedt2i3dl1k7sm SPRING_DATASOURCE_USERNAME: sbrjqzkrjkkzmc
SPRING_JPA_DATABASE-PLATFORM: org.hibernate.dialect.PostgreSQLDialect SPRING_JPA_HIBERNATE_DDL-AUTO: update And this is my logging message WebApplicationContext: initialization completed in 2934 ms 2019-03-13T10:13:36.293244+00:00 app[web.1]: 2019-03-13 10:13:36.292 ERROR 4 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool. 2019-03-13T10:13:36.293258+00:00 app[web.1]: 2019-03-13T10:13:36.293260+00:00 app[web.1]: org.postgresql.util.PSQLException: The connection attempt failed.
Now you are having troubles with connection pool, you can take a look at this tutorial baeldung.com/spring-boot-tomcat-connection-pool
It finally works, I deleted all the config vars in Heroku, all the properties in Spring and only added the username, password and url in the new format and it works. This part works, I have some other issues now with my app but I'll try to fix these myself. Thank you so much for all your help. And I won't forget to change my password
Welcome, if you dont mind you can mark answer rigth, thanks
0

remove java-version property in pom.xml

1 Comment

While this might be a valuable hint to solve the problem, a good answer also demonstrates the solution. Please EDIT to provide example code to show what you mean. Alternatively, consider writing this as a comment instead

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.