GirlServiceTest運行報錯
Assert.assertEquals(new?Integer(13),?age);//這句話的Integer中間有個橫線,好像是不能用的意思
報錯是報下面的錯
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-05-28 10:44:04.649 ERROR 1572 --- [? ? ? ? ? ?main] o.s.boot.SpringApplication? ? ? ? ? ? ? ?: Application run failed
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
2018-06-24
如果是java 8及以下jdk版本,在maven中添加dom4j的依賴即可,如下:
如果是java se 9(即jdk 9)及以上版本,需要在maven中同時添加以下幾個依賴:
我使用的是jdk 10,當時測試也遇到此問題,自己根據提示添加了dom4j的依賴,但是還是同樣拋出該異常,后找尋答案發(fā)現是因為在java易主后,java se 9以后的版本不在支持jaxb-api導致,需要單獨添加jaxb的支持。
2018-05-28
你可以看一下你的實體類中的這個age是什么類型的,是不是寫錯了。