宇然 赵
unread,Feb 18, 2012, 9:54:50 PM2/18/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Maven中文
本人刚接触maven 不久,遇到了一下问题想请教一下各位大牛。
1. surfire 默认使用juint 3.8? ,我在pom 中配置了junit版本为4.8,我在pom 中配置了surfire 使用
4.8版本的junit
我项目中使用了 spring -test的包 ,但是根据 第一原则,maven应该自动下载4.8的包。现在我mvn test 却出现如下问
题
-------------------------------------------------------------------------------
Test set: edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.678
sec <<< FAILURE!
testGetUser(edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest) Time
elapsed: 10.328 sec <<< ERROR!
java.lang.NoSuchMethodError:
org.springframework.core.MethodParameter.getParameterAnnotations()
[Ljava/lang/Object;
at
org.springframework.beans.factory.config.DependencyDescriptor.getAnnotations(DependencyDescriptor.java:
203)
at
org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.isAutowireCandidate(QualifierAnnotationAutowireCandidateResolver.java:
106)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:
377)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:
364)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:
670)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:
610)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:
1076)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:
982)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:
329)
at
org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:
208)
at
org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:
183)
at
org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:
103)
at junit.framework.TestCase.runBare(TestCase.java:132)
at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:
79)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
83)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:
53)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:
123)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:
104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:
164)
at org.apache.maven.surefire.booter.ProviderFactory
$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:
175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:
107)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
68)
请教一下各位这是怎么回事?