I have a backend api spring boot project, when I try to start it from the vscode bash terminal (eclipse bash terminal too) I receive the following error:
10-15 07:38:37,212 org.springframework.context.support.AbstractApplicationContext:refresh WARN - Exception encountered during context initialization - cancelling refresh attempt: 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 java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
10-15 07:38:37,212 org.apache.juli.logging.DirectJDKLog:log INFO - Stopping service [Tomcat]
10-15 07:38:37,227 org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener:logMessage INFO -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
However, when I am using the eclipse plugin: "Boot Dashboard", it works fine and starts, no errors....
The commands I am using in the terminal are:
mvn clean install spring-boot:repackage
java -jar target/project-name-0.0.1-SNAPSHOT.jar
This used to work, and then one day just started throwing the error .
I have tried the maven updates, project cleans, deleting the /m2 folder, making sure all ports are clear/open, "turning it off and on again" .... Doesn't work from terminal but works from the plugin, can't figure out why.