spring踩坑-java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogger

在spring 开发中,一开始 我遇到的 是 hibernate 类冲突,查了一下说,删掉就行了。

删掉后,果然就好了,第二次,我想将错误复现时,发现找不到了,并且出现新错误:

Caused by: java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogger
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2541)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:858)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1301)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)
	at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:29)
	at org.hibernate.validator.internal.util.Version.<clinit>(Version.java:27)
	at org.hibernate.validator.internal.engine.ConfigurationImpl.<clinit>(ConfigurationImpl.java:65)
	at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
	at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276)
	at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:250)
	at org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean.afterPropertiesSet(OptionalValidatorFactoryBean.java:40)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
	... 28 more

发现是缺少了  jboss-logging的jar包,添加了就行。

于是我添加了 jboss-logging.jar  下载链接
因为org/jboss/logging/BasicLogger is inside jboss-logging.jar