0

在春季启动升级后我正在努力旋转我的应用程序 - 2.5.4,gradle wrapper 6.9.1

我看到有 @SpringBootApplication ,并且不排除之前一些帖子中提到的 tomcat 等。

关键依赖项包括 - jasypt、mysql、秘密管理器、云存储......但看起来问题与依赖项无关,因为我创建了全新的应用程序,并添加了该项目的所有依赖项,但没有代码文件并运行

构建.gradle

buildscript {      // Configuration for building
  repositories {
    gradlePluginPortal()
    jcenter()      // Bintray's repository - a fast Maven Central mirror & more
    mavenCentral()
  }
  dependencies {
    classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.4.1'
    classpath 'org.akhikhl.gretty:gretty:+'
  }
}


plugins {
    id 'org.springframework.boot' version '2.5.4'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'   
    id 'org.flywaydb.flyway' version '7.11.0'
    id 'war'
    id 'org.akhikhl.gretty' version '2.0.0' //comment for unit tests
    
}

apply plugin: 'com.google.cloud.tools.appengine'
ext {
    set('springCloudGcpVersion', "2.0.4")
    set('springCloudVersion', "2020.0.3")
}

dependencyManagement {
    imports {
        mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:${springCloudGcpVersion}"
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

gretty {
    servletContainer = 'jetty9'  
}

  appengine {
    deploy {   // deploy configuration
      stopPreviousVersion = true  // default - stop the current version
      promote = true              // default - & make this the current version
      version = "GCLOUD_CONFIG"
      projectId = "GCLOUD_CONFIG"
    }
  }


//@EnableAspectJAutoProxy
@SpringBootApplication
@EnableEncryptableProperties
@EnableTransactionManagement
public class PApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(PApplication.class, args);
    }
    
     @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
         return application.sources(PyacademyApplication.class);
      }
...
}

日志

23-09-2021 19:34:32.478 [35m[main][0;39m [34mINFO [0;39m o.s.d.r.c.RepositoryConfigurationDelegate.registerRepositoriesIn - Finished Spring Data repository scanning in 273 ms. Found 13 JPA repository interfaces.
23-09-2021 19:34:32.880 [35m[main][0;39m [34mINFO [0;39m o.s.cloud.context.scope.GenericScope.setSerializationId - BeanFactory id=6aa7bb22-b76e-342a-9704-6da7105594eb
23-09-2021 19:34:33.404 [35m[main][0;39m [34mINFO [0;39m o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization - Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@91da29b' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
23-09-2021 19:34:33.424 [35m[main][0;39m [34mINFO [0;39m o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization - Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
23-09-2021 19:34:33.503 [35m[main][0;39m [31mWARN [0;39m o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
23-09-2021 19:34:33.534 [35m[main][0;39m [34mINFO [0;39m o.s.b.a.l.ConditionEvaluationReportLoggingListener.logMessage - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
23-09-2021 19:34:33.594 [35m[main][0;39m [1;31mERROR[0;39m o.s.boot.SpringApplication.reportFailure - Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
    at com.inrix.sc.PApplication.main(PApplication.java:21)
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:210)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)
    ... 8 common frames omitted

如何确定根本原因?

PS 该应用程序使用 gradlew appengineRun 运行正常(但我想在 eclipse 中运行)。在升级之前工作,但现在无法找到根本原因 - 早期的提交也不起作用。

4

0 回答 0