tomcat 启动时出现 ContextLoaderListener 异常

ContextLoaderListener exception in tomcat startup

我在新系统上安装后出现这个异常

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with 'entityManagerFactory' defined in class path resource [/server/configuration/DatabaseConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

使用配置:

<properties>
    <spring.version>4.2.2.RELEASE</spring.version>
    <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
    <spring-data-jpa.version>1.9.2.RELEASE</spring-data-jpa.version>
    <hibernate.version>5.0.2.Final</hibernate.version>
    <mysql.version>6.0.6</mysql.version>
    <commons-dbcp2.version>2.1.1</commons-dbcp2.version>
    <jackson-databind.version>2.5.3</jackson-databind.version>
    <java.version>1.8</java.version>
    <firebase.version>6.6.0</firebase.version>
    <model-mapper>2.3.2</model-mapper>
</properties>

有什么问题?

有人可以帮忙吗?以前还好,现在不行了

此致,基里尔

您可能使用 Java > 8。在 Java 9 中删除了 JAXB,现在您需要此依赖项:

<dependency>
  <groupId>org.glassfish.jaxb</groupId>
  <artifactId>jaxb-runtime</artifactId>
  <version>2.3.3-b02</version>
</dependency>