首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Spring 2.2.1-无法启动嵌入tomcat(日志中没有错误)

Spring 2.2.1-无法启动嵌入tomcat(日志中没有错误)
EN

Stack Overflow用户
提问于 2019-12-13 05:12:41
回答 1查看 209关注 0票数 0

我正在开发一个具有版本2.2.1RELEASE.Application结构的.Application应用程序,我已经将配置移到了配置文件夹中,因为外部configuration.Project结构应该如下所示

当我运行我的应用程序时,它会显示以下日志

代码语言:javascript
运行
复制
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

2019-12-12 20:34:41.631  INFO 375592 --- [           main] c.g.h.x.app.services.api.erviceMain  : Starting ServiceMain v1.0 on host-4 with PID 375592 (D:\Service\target\Service-10.jar started by Administrator in D:\Service\target)
2019-12-12 20:34:41.636  INFO 375592 --- [           main] c.g.h.x.app.services.api.ServiceMain  : The following profiles are active: Service
2019-12-12 20:34:45.086  INFO 375592 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-12-12 20:34:45.477  INFO 375592 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 154ms. Found 0 repository interfaces.
408  SybaseUnit  INFO   [main] openjpa.Enhance - You have enabled runtime enhancement, but have not specified the set of persistent classes.  OpenJPA must look for metadata for every loaded class, whi
ch might increase class load times significantly.
296  SybaseUnit  WARN   [main] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'SybaseUnit', root URL [file:/D:/Service/targetService-1.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not
 be available.
312  SybaseUnit  WARN   [main] openjpa.Runtime - Could not create the optional validation provider. Reason returned: "A default ValidatorFactory could not be created."
2019-12-12 20:34:50.108  INFO 375592 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'SybaseUnit'
0  MssqlUnit  INFO   [main] openjpa.Enhance - You have enabled runtime enhancement, but have not specified the set of persistent classes.  OpenJPA must look for metadata for every loaded class, which
might increase class load times significantly.
0  MssqlUnit  WARN   [main] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'MssqlUnit', root URL [file:/D:/Service/target/Service-1.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be
available.
0  MssqlUnit  WARN   [main] openjpa.Runtime - Could not create the optional validation provider. Reason returned: "A default ValidatorFactory could not be created."
2019-12-12 20:34:50.140  INFO 375592 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'MssqlUnit'
log4j:WARN No appenders could be found for logger (com..manager.data).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2019-12-12 20:34:53.284  INFO 375592 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'TaskExecutor'
2019-12-12 20:34:53.328  INFO 375592 --- [           main] ca.uhn.fhir.util.VersionUtil             : HAPI FHIR version is: 1.4
2019-12-12 20:34:53.335  INFO 375592 --- [           main] ca.uhn.fhir.context.FhirContext          : Creating new FHIR context for FHIR version [DSTU3]
2019-12-12 20:34:54.946  INFO 375592 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService
2019-12-12 20:34:55.343  INFO 375592 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'asyncExecutor'
2019-12-12 20:34:57.647  INFO 375592 --- [           main] c.g.h.x.app.services.api.ServiceMain  : Started ServiceMain in 19.208 seconds (JVM running for 21.409)

添加了以下依赖项的Pom.xml文件

代码语言:javascript
运行
复制
 <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
          <exclusions>
                <exclusion>
                      <groupId>org.jboss.logging</groupId>
                      <artifactId>jboss-logging</artifactId>
                </exclusion>
                <exclusion>
                      <groupId>org.hibernate.validator</groupId>
                      <artifactId>hibernate-validator</artifactId>
                </exclusion>
                <!-- <exclusion>
                      <groupId>org.springframework.boot</groupId>
                      <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion> -->
          </exclusions>
    </dependency>
    <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-test</artifactId>
          <scope>test</scope>
          <exclusions>
                <exclusion>
                      <groupId>org.mockito</groupId>
                      <artifactId>mockito-junit-jupiter</artifactId>
                </exclusion>
          </exclusions>
    </dependency>
    <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-autoconfigure</artifactId>
    </dependency>

我已经尝试了以下可能的解决方案。

projects.

  • delete

  • 更新和清理我的

  • .m2存储库,并参考下面的堆栈链接。

1.Spring boot application not starting embedded tomcat

2.Spring boot deployed on tomcat won't start

还没找到解决办法。

注:-注意到我的日志中有两行

代码语言:javascript
运行
复制
2019-12-12 20:34:45.086  INFO 375592 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-12-12 20:34:45.477  INFO 375592 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 154ms. Found 0 repository interfaces.
EN

回答 1

Stack Overflow用户

发布于 2022-05-13 21:24:55

这可能是由于接口与@SpringBootApplication注释的主类不在同一级别造成的。

这里是一个例子.

注意到所有子包都与@SpringBootApplication.的级别相同。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59316463

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档