Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run Tests with release 1.2.2 #2572

Closed
BigMichi1 opened this issue Feb 28, 2015 · 10 comments
Closed

unable to run Tests with release 1.2.2 #2572

BigMichi1 opened this issue Feb 28, 2015 · 10 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@BigMichi1
Copy link
Contributor

after i updated to version 1.2.2 my tests are no longer running all fail with this exception

java.lang.IllegalAccessError: tried to access class org.springframework.test.context.support.TestPropertySourceUtils from class org.springframework.boot.test.SpringApplicationContextLoader$PropertySourceLocationsInitializer
    at org.springframework.boot.test.SpringApplicationContextLoader$PropertySourceLocationsInitializer.initialize(SpringApplicationContextLoader.java:290)
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
    at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:100)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
@wilkinsona
Copy link
Member

1.2.2 requires Spring Framework 4.1.5

@wilkinsona wilkinsona added the status: invalid An issue that we don't feel is valid label Feb 28, 2015
@davicdsalves
Copy link

Does that mean that I need to manually insert the property of spring version? Shouldn't spring-boot-dependencies bring it?

@snicoll
Copy link
Member

snicoll commented Mar 10, 2015

of course it will. Your project is probably forcing another spring framework version in some way.

Please have a look to the documentation

@davicdsalves
Copy link

I'll take a look, but I think I'm not forcing it.

@snicoll
Copy link
Member

snicoll commented Mar 10, 2015

alright, show your project config then. Please create a new issue; this one is closed.

@davicdsalves
Copy link

I fixed it thanks for your time.

@claytantor
Copy link

Hey @davicdsalves it really helps when you explain how you fixed it.

@alvarogarcia7
Copy link

@davicdsalves @claytantor agree

I've solved it upgrading to 4.1.5.RELEASE.

It is important to do mvn clean, otherwise your old dependencies are still there.

@jukecraft
Copy link

@claytantor I fixed it by removing our own dependency definition (and version number!) for mockito from the pom and running mvn clean. I guess we have to accept Spring choosing the Mockito version for us. Found the solution here: http://stackoverflow.com/a/41041477

@AlthafAzeez
Copy link

I fixed this by removing the mockito library dependency from my project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

8 participants