简体   繁体   中英

why I see this when compiling my project in bootstrap? "Found 0 JPA repository interfaces."

I have created a Bootstrap project in which I have 3 repositories. When I compile the project I do not receive any errors but unfortunately I can not see my controllers in Swagger:!! I have found out that line 4 says:

Finished Spring Data repository scanning in 4 ms. Found 0 JPA repository interfaces.

I think this the reason that I can not see the controllers. Any idea to solve this? Thank you in advance.

2021-12-14 00:26:13.768  INFO 5472 --- [           main] WBSthesis.rotab.RotabApplication     

    : No active profile set, falling back to default profiles: default
2021-12-14 00:26:14.648  INFO 5472 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-12-14 00:26:14.661  INFO 5472 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : ***Finished Spring Data repository scanning in 4 ms. Found 0 JPA repository interfaces.***
2021-12-14 00:26:15.592  INFO 5472 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-12-14 00:26:15.609  INFO 5472 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-12-14 00:26:15.609  INFO 5472 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-12-14 00:26:15.718  INFO 5472 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-12-14 00:26:15.718  INFO 5472 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1885 ms
2021-12-14 00:26:15.975  INFO 5472 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-12-14 00:26:16.051  INFO 5472 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-12-14 00:26:16.226  INFO 5472 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-12-14 00:26:16.356  INFO 5472 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2021-12-14 00:26:16.562  INFO 5472 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2021-12-14 00:26:16.580  INFO 5472 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect
2021-12-14 00:26:16.856  INFO 5472 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-12-14 00:26:16.866  INFO 5472 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-12-14 00:26:17.090  WARN 5472 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-12-14 00:26:17.225  INFO 5472 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2021-12-14 00:26:17.490  INFO 5472 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-12-14 00:26:17.491  INFO 5472 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-12-14 00:26:17.511  INFO 5472 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-12-14 00:26:17.544  INFO 5472 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
2021-12-14 00:26:17.698  INFO 5472 --- [           main] WBSthesis.rotab.RotabApplication         : Started RotabApplication in 4.468 seconds (JVM running for 4.958)

More info of your project would be helpful, but maybe your interfaces are not inside the right package. I was facing this once...

Here is an example.

在此处输入图像描述

Notice that all sub-packages are on the same level as the @SpringBootApplication.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM