[SPRINGBOOT] [eclipse] déploiement tomcat ne marche pas alors que lancement java application marche
Bonjour
j'ai un soucis de déploiement sur une application SpringBoot.
lorsque je lance mon application sur eclipse via javaApplication cela marche très bien mais lorsque que j'essaie de le lancer via un tomcat externe, l'application ne fonctionne pas.
je n'ai pas d'idée pour me débloquer
c'est comme si l'application ne scanne pas les entity car j'ai un soucis
Citation:
Caused by: java.lang.IllegalArgumentException: Not a managed type: class entity .
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| @SpringBootApplication
public class MyApplication extends SpringBootServletInitializer {
private transient static Log log = LogFactory.getLog(MyApplication.class);
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(MyApplication.class);
}
public static void main(String[] args){
SpringApplication.run(MyApplication .class, args);
}
} |
après j'ai essayé cela plusieurs fois en ajoutant/supprimant certaines annotations comme EnableJpaRepositories avec ENtityScan et vice versa pour qu'il détecte les entity mais rien n'y fait quelqu'un aurait une idée.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| @EnableJpaRepositories(basePackages = {
"com.repository" })
@EntityScan("com.entity")
@SpringBootApplication
public class MyApplication extends SpringBootServletInitializer {
private transient static Log log = LogFactory.getLog(MyApplication.class);
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(MyApplication.class);
}
public static void main(String[] args){
SpringApplication.run(MyApplication .class, args);
}
} |
mon pom.xml avec les dependencies j'utilise springBoot
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <spring-boot.version>2.3.12.RELEASE</spring-boot.version>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<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-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency> |