Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring Boot项目赢得';t从VSCode终端启动,但将在eclipse中启动;启动仪表板“;插件_Java_Eclipse_Spring Boot_Visual Studio Code - Fatal编程技术网

Java Spring Boot项目赢得';t从VSCode终端启动,但将在eclipse中启动;启动仪表板“;插件

Java Spring Boot项目赢得';t从VSCode终端启动,但将在eclipse中启动;启动仪表板“;插件,java,eclipse,spring-boot,visual-studio-code,Java,Eclipse,Spring Boot,Visual Studio Code,我有一个后端api spring引导项目,当我尝试从vscode bash终端(也是eclipse bash终端)启动它时,我收到以下错误: 10-15 07:38:37,212 org.springframework.context.support.AbstractApplicationContext:refresh WARN - Exception encountered during context initialization - cancelling refresh attempt:

我有一个后端api spring引导项目,当我尝试从vscode bash终端(也是eclipse bash终端)启动它时,我收到以下错误:

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.
然而,当我使用eclipse插件:“引导仪表板”时,它工作正常,并且启动时没有错误

我在终端中使用的命令有:

mvn clean install spring-boot:repackage
java -jar target/project-name-0.0.1-SNAPSHOT.jar

这曾经是有效的,然后有一天,刚开始抛出错误,对于Spring引导应用程序,最好使用Spring工具套件或Intellij。我的首选是Intellij,因为我目前正在使用Intellij。如果您正在使用Angular或React或任何其他前端库,那么请使用Visual code studio开始运行该库,然后使用Intellij启动spring boot应用程序,这听起来不错,因为Intellij就是以这种方式设计的,因此您可以轻松地清除错误。

在Eclipse中,打开调试视图,右键单击表示VM可执行文件的树节点,打开其属性以查看使用的整个命令行。

您运行的java版本是什么,我使用的是jdk 11如果您阅读我发布的链接,从java 9和forward JAXB中删除,因为它被认为是java EE的一部分。如果你想包含它,你需要使用标记“addmodules java.xml.bind”@thomasandol”进行编译,如果我能够按照你评论中的链接,并将其添加到pom中来解决我的问题:javax.xml.bind jaxb api 2.3.0如果你想添加答案,我可以将其标记为正确的…是的,确实如此。。。如果你想发布一个答案(而不是评论),我可以将其标记为正确答案……我有IntelliJ的免费社区版本,我想这会起作用?是的,这会起作用,即使我使用的是免费版本