Sfoglia il codice sorgente

made error on start up go away

David Thornley 6 anni fa
parent
commit
d82cb4506e

+ 5
- 5
server-springboot/pom.xml Vedi File

@@ -92,11 +92,11 @@
92 92
             <artifactId>jquery</artifactId>
93 93
             <version>3.1.0</version>
94 94
         </dependency>
95
-        <dependency>
96
-            <groupId>org.apache.tomcat</groupId>
97
-            <artifactId>tomcat-jdbc</artifactId>
98
-            <version>8.5.31</version>
99
-        </dependency>
95
+        <!--<dependency>-->
96
+            <!--<groupId>org.apache.tomcat</groupId>-->
97
+            <!--<artifactId>tomcat-jdbc</artifactId>-->
98
+            <!--<version>8.5.31</version>-->
99
+        <!--</dependency>-->
100 100
     </dependencies>
101 101
 
102 102
     <build>

+ 0
- 53
server-springboot/src/main/java/com/ziplinegreen/vault/Config/DataSourceConfig.java Vedi File

@@ -1,53 +0,0 @@
1
-package com.ziplinegreen.vault.Config;
2
-
3
-import org.apache.tomcat.jdbc.pool.DataSource;
4
-import org.slf4j.Logger;
5
-import org.slf4j.LoggerFactory;
6
-import org.springframework.context.annotation.Bean;
7
-import org.springframework.context.annotation.Configuration;
8
-import org.springframework.context.annotation.Profile;
9
-
10
-
11
-import java.net.URI;
12
-import java.net.URISyntaxException;
13
-
14
-@Configuration
15
-    public class DataSourceConfig {
16
-
17
-        Logger log = LoggerFactory.getLogger(getClass());
18
-
19
-        @Bean
20
-        @Profile("postgres")
21
-        public DataSource postgresDataSource() {
22
-            String databaseUrl = System.getenv("DATABASE_URL");
23
-            log.info("Initializing PostgreSQL database: {}", databaseUrl);
24
-
25
-            URI dbUri;
26
-            try {
27
-                dbUri = new URI(databaseUrl);
28
-            }
29
-            catch (URISyntaxException e) {
30
-                log.error(String.format("Invalid DATABASE_URL: %s", databaseUrl), e);
31
-                return null;
32
-            }
33
-
34
-            String username = dbUri.getUserInfo().split(":")[0];
35
-            String password = dbUri.getUserInfo().split(":")[1];
36
-            String dbUrl = "jdbc:postgresql://" + dbUri.getHost() + ':'
37
-                    + dbUri.getPort() + dbUri.getPath();
38
-
39
-            org.apache.tomcat.jdbc.pool.DataSource dataSource
40
-                    = new org.apache.tomcat.jdbc.pool.DataSource();
41
-            dataSource.setDriverClassName("org.postgresql.Driver");
42
-            dataSource.setUrl(dbUrl);
43
-            dataSource.setUsername(username);
44
-            dataSource.setPassword(password);
45
-            dataSource.setTestOnBorrow(true);
46
-            dataSource.setTestWhileIdle(true);
47
-            dataSource.setTestOnReturn(true);
48
-            dataSource.setValidationQuery("SELECT 1");
49
-            return dataSource;
50
-        }
51
-
52
-    }
53
-

+ 9
- 5
server-springboot/src/main/resources/application.properties Vedi File

@@ -8,12 +8,16 @@
8 8
 #spring.datasource.password=
9 9
 #spring.datasource.driver-class-name=org.h2.Driver
10 10
 
11
-spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
11
+spring.datasource.url= jdbc:postgresql://localhost:5432/thevault 
12
+spring.datasource.username=postgres
13
+spring.datasource.password=ZipCode4dot1   
14
+spring.jpa.hibernate.ddl-auto=update
15
+        
16
+# Disable feature detection by this undocumented parameter. Check the org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure method for more details.
17
+spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
12 18
 
13
-#spring.datasource.url= jdbc:postgres://qyobkbrdaovfvu:73068a6d3c228aab13771ff1e5398faacfbcc6733d097d4171e14f2dc92017ba@ec2-54-243-28-109.compute-1.amazonaws.com:5432/d39llklbuu4bjg
14
-#spring.datasource.username=qyobkbrdaovfvu
15
-#spring.datasource.password=73068a6d3c228aab13771ff1e5398faacfbcc6733d097d4171e14f2dc92017ba
16
-#spring.jpa.hibernate.ddl-auto=update
19
+# Because detection is disabled you have to set correct dialect by hand.
20
+spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
17 21
 
18 22
 #spring.datasource.url=jdbc:mysql://localhost:3306/zipLine?useSSL=false
19 23
 #spring.datasource.username=root

+ 7
- 2
server-springboot/target/classes/application.properties Vedi File

@@ -8,13 +8,18 @@
8 8
 #spring.datasource.password=
9 9
 #spring.datasource.driver-class-name=org.h2.Driver
10 10
 
11
-
12
-
13 11
 spring.datasource.url= jdbc:postgresql://localhost:5432/thevault 
14 12
 spring.datasource.username=postgres
15 13
 spring.datasource.password=ZipCode4dot1   
16 14
 spring.jpa.hibernate.ddl-auto=update
17 15
 
16
+#hibernate.jdbc.lob.non_contextual_creation=true
17
+# Disable feature detection by this undocumented parameter. Check the org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure method for more details.
18
+spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
19
+
20
+# Because detection is disabled you have to set correct dialect by hand.
21
+spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
22
+
18 23
 #spring.datasource.url=jdbc:mysql://localhost:3306/zipLine?useSSL=false
19 24
 #spring.datasource.username=root
20 25
 #spring.datasource.password=Calcifer1650