jianglisuda 发表于 2013-11-22 10:42:17

求帮忙看看单元测试报错,问了下同事好像是环境问题,怎么解决啊,就我的机子有问题

java.lang.NoClassDefFoundError: javax/sql/rowset/RowSetProvider
        at org.springframework.jdbc.core.SqlRowSetResultSetExtractor$StandardCachedRowSetFactory.<init>(SqlRowSetResultSetExtractor.java:116)
        at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.<clinit>(SqlRowSetResultSetExtractor.java:52)
        at org.springframework.jdbc.core.JdbcTemplate.queryForRowSet(JdbcTemplate.java:811)
        at com.founder.rhip.repository.section.SectionDaoImpl.querySectionList(SectionDaoImpl.java:310)
        at com.founder.rhip.repository.section.SectionDaoImpl.querySectionList(SectionDaoImpl.java:270)
        at com.founder.rhip.service.BaseService.querySectionList(BaseService.java:83)
        at com.founder.rhip.service.his.AssessmentTemplateServiceImpl.AssessmentTemplateList(AssessmentTemplateServiceImpl.java:38)
        at com.founder.rhip.service.his.AssessmentTemplateServiceImplTest1.TestAssessmentTemplateList(AssessmentTemplateServiceImplTest1.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:613)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
        at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
        at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: javax.sql.rowset.RowSetProvider
        at java.net.URLClassLoader$1.run(URLClassLoader.java:299)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:288)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:287)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:422)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:355)
        ... 38 more

赵佳乐SMILE 发表于 2013-11-22 13:03:30

重点就是前三行
java.lang.NoClassDefFoundError: javax/sql/rowset/RowSetProvider
      at org.springframework.jdbc.core.SqlRowSetResultSetExtractor$StandardCachedRowSetFactory.<init>(SqlRowSetResultSetExtractor.java:116)
NoClassDefFoundError是什么?
百度一下
“没有找到这样的类”错误
表面上看是类的名称错误,其实更有可能是classpath环境变量没有配置好。

建议复查类的名称包括大小写,如果有包的情况下,注意类文件放的位置。
环境变量classpath配置中有没有小数点“.”,有没有java默认类库的位置,有没有你自己的类文件顶层目录等。

打开
SqlRowSetResultSetExtractor.java看看第116行有什么问题

赵佳乐SMILE 发表于 2013-11-22 13:04:11

环境问题就找你们开发 要部署文档
页: [1]
查看完整版本: 求帮忙看看单元测试报错,问了下同事好像是环境问题,怎么解决啊,就我的机子有问题