我的springboot应用程序失败了,因为它一直试图打开一个我不想使用的位置、用户id和密码的数据库。目前我找不到它从哪里得到jdbc的url、用户名和密码。我原以为它会用到
spring.datasource.url
但我没有定义,但它有点像
jdbc://127.0.0.1/mydb
其中mydb是一个实际的db,它有一个db2inst用户id。
堆栈跟踪
Caused by: com.ibm.db2.jcc.am.SqlInvalidAuthorizationSpecException: [jcc][t4][2013][11249][4.19.66] Connection authorization failure occurred. Reason: User ID or Password invalid. ERRORCODE=-4214, SQLSTATE=28000
at com.ibm.db2.jcc.am.kd.a (kd.java:745)
at com.ibm.db2.jcc.am.kd.a (kd.java:66)
at com.ibm.db2.jcc.am.kd.a (kd.java:128)
at com.ibm.db2.jcc.t4.b.f (b.java:2501)
at com.ibm.db2.jcc.t4.b.b (b.java:1836)
at com.ibm.db2.jcc.t4.z.r (z.java:957)
at com.ibm.db2.jcc.t4.z.k (z.java:494)
at com.ibm.db2.jcc.t4.z.c (z.java:144)
at com.ibm.db2.jcc.t4.b.k (b.java:1412)
at com.ibm.db2.jcc.t4.b.b (b.java:1325)
at com.ibm.db2.jcc.t4.b.a (b.java:6534)
at com.ibm.db2.jcc.t4.b.b (b.java:865)
at com.ibm.db2.jcc.t4.b.a (b.java:781)
at com.ibm.db2.jcc.t4.b.a (b.java:424)
at com.ibm.db2.jcc.t4.b.a (b.java:397)
at com.ibm.db2.jcc.t4.b.<init> (b.java:335)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection (DB2SimpleDataSource.java:234)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection (DB2SimpleDataSource.java:200)
at com.ibm.db2.jcc.DB2Driver.connect (DB2Driver.java:471)
at com.ibm.db2.jcc.DB2Driver.connect (DB2Driver.java:112)
at com.zaxxer.hikari.util.DriverDataSource.getConnection (DriverDataSource.java:136)
at com.zaxxer.hikari.pool.PoolBase.newConnection (PoolBase.java:369)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry (PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry (HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast (HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.<init> (HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection (HikariDataSource.java:112)
at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection (JdbcUtils.java:56)
at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase (DatabaseFactory.java:72)
at org.flywaydb.core.Flyway.execute (Flyway.java:1670)
at org.flywaydb.core.Flyway.migrate (Flyway.java:1356)
at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet (FlywayMigrationInitializer.java:65)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1774)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean (AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh (ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:742)
at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:389)
at org.springframework.boot.SpringApplication.run (SpringApplication.java:311)
at org.springframework.boot.SpringApplication.run (SpringApplication.java:1213)
at org.springframework.boot.SpringApplication.run (SpringApplication.java:1202)
at com.mycompany.cost.rules.CostRulesServiceApplication.main (CostRulesServiceApplication.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:542)
at java.lang.Thread.run (Thread.java:748)
应用程序属性
cost.rules.schema=COST_RULES
file.generator.schema=FILE_GENERATOR
logging.level.org.flywaydb.core.internal.database=DEBUG
server.port=${SERVER_PORT:8080}
spring.application.name=bluecost-rules-service
spring.batch.job.enabled=false
spring.datasource.driver-class-name=${COST_DATASOURCE_DRIVER}
spring.datasource.password=${COST_DATASOURCE_PASSWORD}
spring.datasource.url=${COST_DATASOURCE_URL}
spring.datasource.username=${COST_DATASOURCE_USERNAME}
spring.flyway.baseline-on-migrate=false
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration
spring.flyway.out-of-order=true
spring.flyway.schemas=${cost.rules.schema}
spring.jpa.database-platform=DB2
spring.jpa.properties.hibernate.default_schema=${cost.rules.schema}
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DB2Dialect
spring.profiles.active=sprint-vault-services-available
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=35MB
spring.servlet.multipart.max-request-size=35MB
sprint.vault.services.db.bms=TestBMS
sprint.vault.services.db.db2onc=db2oncLocal
sprint.vault.services.db.file-generator=LocalFileGenerator
sprint.vault.services.error-delay=1000
sprint.vault.services.job123=TestJob123
sprint.vault.services.job4=TestJob4
sprint.vault.services.jwtSecret=
sprint.vault.services.max-error-threshold=3
sprint.vault.services.token=
sprint.vault.services.url=
暂无答案!
目前还没有任何答案,快来回答吧!