标题: BeanUtils工具包 [打印本页] 作者: 杨曾荣 时间: 2012-2-22 16:02 标题: BeanUtils工具包 使用BeanUtils的时候需要加载两个工具包:commons-beanutils-1.8.3.jar和commons-logging-1.1.1.jar,加载完成之后程序还出现一大推的错误,这个问题什么解决?
Exception in thread "main" java.lang.ExceptionInInitializerError
at cn.itcast.java.reflect.IntroSpectorTest.main(IntroSpectorTest.java:25)
Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException))
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at com.sun.org.apache.commons.beanutils.BeanUtils.<clinit>(BeanUtils.java:111)
... 1 more
Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException)
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 5 more
Caused by: java.lang.NullPointerException
at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:374)
... 6 more作者: 【专】【属】 时间: 2012-2-22 16:11
我在网上找一下,说是引入的BeanUtils时导入的包不对,要导入import org.apache.commons.beanutils.BeanUtils; 作者: 杨曾荣 时间: 2012-2-22 16:33
搞定了,谢谢!包导错了