Google app engine 部署Google App Engine应用程序时tomcat出错

Google app engine 部署Google App Engine应用程序时tomcat出错,google-app-engine,tomcat,servlets,google-cloud-platform,google-cloud-sql,Google App Engine,Tomcat,Servlets,Google Cloud Platform,Google Cloud Sql,我正在使用SQL Cloud DB在GAE上部署我的API,现在已经有好几个小时了,我正在测试所有的可能性,但是我仍然遇到一些我无法修复的错误。排除tomcat依赖项时,会出现以下错误: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletMapping at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestC

我正在使用SQL Cloud DB在GAE上部署我的API,现在已经有好几个小时了,我正在测试所有的可能性,但是我仍然遇到一些我无法修复的错误。排除tomcat依赖项时,会出现以下错误:

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletMapping
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:206) ~[spring-test-5.3.4.jar:5.3.4]
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132) ~[spring-test-5.3.4.jar:5.3.4]
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244) ~[spring-test-5.3.4.jar:5.3.4]
    at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) [spring-test-5.3.4.jar:5.3.4]
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:350) [junit-jupiter-engine-5.7.1.jar:5.7
当我从pom.xml中删除此排除时:

<exclusions>
    <exclusion>
        <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
</exclusions>
和云中控制台错误报告:

    java.lang.RuntimeException: 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
at
org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart (ServletContainerInitializersStarter.java:68)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:330)
at
org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1406)
at
com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp (AppEngineWebAppContext.java:175)
at
org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1368)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:778)

谢谢。

错误似乎来自App Engine和云SQL之间的连接失败。502错误有很多原因,如错误的依赖项、错误的配置等。请在问题中包括如何将两者连接起来,以便我们为您提供帮助。通过使用最新教程从头开始解决了该问题。第一个使用servlet并通过.war部署,而这里我们使用.jar。谢谢你试着帮助我。
    java.lang.RuntimeException: 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
at
org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart (ServletContainerInitializersStarter.java:68)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:330)
at
org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1406)
at
com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp (AppEngineWebAppContext.java:175)
at
org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1368)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:778)