Open TemplarJQ opened 3 years ago
异常形式 java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
解决方法 java9+版本以后,JAXB默认没有加载。 JAXB代表用于XML绑定的Java体系结构。它用于将XML转换为java对象,并将java对象转换为XML。JAXB定义了一个用于在XML文档中读写Java对象的API。 JAXB功能链接
在pom中加入:
<dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1.1</version> </dependency>
异常和解决方法
异常形式
java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
解决方法 java9+版本以后,JAXB默认没有加载。 JAXB代表用于XML绑定的Java体系结构。它用于将XML转换为java对象,并将java对象转换为XML。JAXB定义了一个用于在XML文档中读写Java对象的API。 JAXB功能链接
在pom中加入: