收藏
回答

SpringBoot服务部署失败,是为什么?前面都成功,最后报连接失败

AppID
wxcf397ebaf1378b93 prod-3g1hjw0j55181537 tid=584559 rid=multi_tenant_1rplwa3qaeb8eG dc2h-music ptid=426167 bid=41183967 dc2h-music-006

-----------构建dc2h-music-006-----------

2024-03-28 17:21:18 create_build_image : succ,

2024-03-28 17:22:57 check_build_image : succ, ,

-----------服务dc2h-music部署dc2h-music-006-----------

2024-03-28 17:22:58 create_eks_virtual_service : succ,

2024-03-28 17:22:58 check_eks_virtual_service : process, DescribeVersion_user_error_Liveness probe failed: dial tcp 10.15.13.98:80: connect: connection refused, [service]:[Readiness probe failed: dial tcp 10.15.13.98:80: connect: connection refused,Liveness probe failed: dial tcp 10.15.13.98:80: connect: connection refused,]

  • 03/28 17:51:49
  • dc2h-music-006
  • java.sql.SQLSyntaxErrorException: Unknown database '${DATABASE_NAME}'
  • 03/28 17:51:49
  • dc2h-music-006
  • 2024-03-28 09:51:48.421 WARN 1 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at com.dc2h.dc2hmusic.Dc2hMusicApplication.main(Dc2hMusicApplication.java:10) ~[classes!/:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1494) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1460) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:127) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.(InFlightMetadataCollectorImpl.java:175) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • 2024-03-28 09:51:48.425 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  • 03/28 17:51:49
  • dc2h-music-006
  • 2024-03-28 09:51:48.424 ERROR 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[dc2h-music-0.0.1.jar:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_275]
  • 03/28 17:51:49
  • dc2h-music-006
  • at com.dc2h.dc2hmusic.Dc2hMusicApplication.main(Dc2hMusicApplication.java:10) ~[classes!/:0.0.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar!/:2.6.1]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) [spring-beans-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) [spring-orm-5.3.13.jar!/:5.3.13]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1494) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1460) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:127) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.(InFlightMetadataCollectorImpl.java:175) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:178) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68) [hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:181) ~[hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) ~[hibernate-core-5.6.1.Final.jar!/:5.6.1.Final]
  • 03/28 17:51:49
  • dc2h-music-006
  • at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar!/:na]


回答关注问题邀请回答
收藏

1 个回答

  • Alfred Huang
    Alfred Huang
    03-28

    服务启动后探测80端口失败,看是端口配置不对,还是内部进程未启动在80端口的监听

    03-28
    有用
    回复 6
    • Uhim
      Uhim
      03-28
      请问一下怎么看端口配置,还有是否启动在80端口的监听
      03-28
      回复
    • Alfred Huang
      Alfred Huang
      03-29回复Uhim
      云托管服务配置时有个端口配置,就是平台检测服务的启动端口的。至于服务是否在80端口上启动监听,要看服务代码的写法,例如这里,可以看到springboot的启动端口是如何配置的 https://cloud.tencent.com/developer/article/1749191
      03-29
      回复
    • Uhim
      Uhim
      03-29回复Alfred Huang
      我配置的端口,和代码写的都是80,但是还是连接失败有一个东西一直变,就是那个mysql的内网地址连接报错的时候,与我的配置的地址不一致
      03-29
      回复
    • Alfred Huang
      Alfred Huang
      03-29回复Uhim
      那需要检查springboot项目中的mysql地址是配置在哪里的,修改为云托管数据库的内网地址和端口。同时也要注意认证信息配置。
      03-29
      回复
    • Uhim
      Uhim
      04-02回复Alfred Huang
      云托管数据库的内网地址是xxxxxxxxx:3306,然后我配置的是xxxxxxxx,端口80,这是有问题的吗,跟这个3306有关嘛,这个地址是哪几个地方要一致
      04-02
      回复
    查看更多(1)
登录 后发表内容
问题标签