老师请教个问题,在6-4中按照你的代码敲的,启动debug后输入以下命令报错,不知道应该从什么地方下手,麻烦指导一下,谢谢。
另外,提个建议,感觉课程敲了太多代码才会有验证,这样报错不太好找,最好敲一小部分验证一下。
输入命令curl http://localhost:8080/permission_war_exploded/test/validate.json,报错如下:
09-Dec-2019 11:34:29.630 警告 [http-nio-8080-exec-2]
org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException
09-Dec-2019 11:34:29.631 严重 [http-nio-8080-exec-2] org.springframework.web.servlet.DispatcherServlet.initServletBean Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:628)atorg.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:628)atorg.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException
at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:129)
at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:96)
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:31)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.ValidationException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0': Invocation of init m
ethod failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException