Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Upgrade to Spring Boot 0.5.0.M6 #126

Merged
merged 6 commits into from Nov 13, 2013
Merged

Upgrade to Spring Boot 0.5.0.M6 #126

merged 6 commits into from Nov 13, 2013

Conversation

cbeams
Copy link
Contributor

@cbeams cbeams commented Nov 12, 2013

No description provided.

@ghost ghost assigned cbeams Nov 11, 2013
cbeams added a commit that referenced this pull request Nov 12, 2013
 - Causes as-yet not understood FileNotFoundExceptions on "class path
   resource [org/springframework/data/web/config/EnableSpringDataWebSupport.class]"

 - Required minor update to SecurityRequestPostProcessors to reflect
   breaking API changes in Spring Security's CSRF support.
@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

@philwebb, @dsyer the commit above was a quick attempt to upgrade sagan to Boot M6. Running integration tests ./gradlew integTest quickly starts throwing the following everywhere the container is created.

Any ideas? I really just had a moment to try this, so haven’t dug in at all. You can try this for yourself by checking out the upgrade-boot-m6 branch. Thanks.

java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:108)
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:75)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:326)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:210)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:230)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    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:309)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:173)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: ; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/data/web/config/EnableSpringDataWebSupport.class] cannot be opened because it does not exist
    at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:383)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:162)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:296)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:240)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    at org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:129)
    at org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:60)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)
    at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
    at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
    ... 28 more
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/data/web/config/EnableSpringDataWebSupport.class] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)
    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:82)
    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:77)
    at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:554)
    at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getRelated(ConfigurationClassParser.java:754)
    at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getAnnotations(ConfigurationClassParser.java:724)
    at org.springframework.context.annotation.ConfigurationClassParser.collectImports(ConfigurationClassParser.java:361)
    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:341)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:249)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:205)
    at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:295)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:222)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:205)
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:428)
    at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:380)
    ... 41 more

@dsyer
Copy link
Contributor

dsyer commented Nov 12, 2013

Maybe you accidentally pinned the version of Spring Data to an old version (instead of using the version provided by Spring Boot, either through a starter or a direct dependency)?

cbeams added a commit that referenced this pull request Nov 12, 2013
 - Causes as-yet not understood FileNotFoundExceptions on "class path
   resource [org/springframework/data/web/config/EnableSpringDataWebSupport.class]"

 - Required minor update to SecurityRequestPostProcessors to reflect
   breaking API changes in Spring Security's CSRF support.
cbeams added a commit that referenced this pull request Nov 12, 2013
cbeams added a commit that referenced this pull request Nov 12, 2013
 - Causes as-yet not understood FileNotFoundExceptions on "class path
   resource [org/springframework/data/web/config/EnableSpringDataWebSupport.class]"

 - Required minor update to SecurityRequestPostProcessors to reflect
   breaking API changes in Spring Security's CSRF support.
cbeams added a commit that referenced this pull request Nov 12, 2013
@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

@dsyer that was the solution to that particular problem, per 84da379.

@gregturn, there are still some test failures after fixing the issue mentioned above. I have to take off for a bit—if you’re interested it investigating them, just checkout this branch and run gradle check. Thanks.

@ghost ghost assigned cbeams Nov 12, 2013
@gregturn
Copy link
Contributor

@cbeams The problem causing the tests to break is the change to CSRF. Trying to isolate.

@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

Thanks, @gregturn. @rwinch, could you give cc6f0bb a quick look? Perhaps I just did something obviously wrong there.

@rwinch
Copy link
Contributor

rwinch commented Nov 12, 2013

@cbeams @gregturn The token also needs to be saved (i.e. stored in session). For example:

repository.saveToken(csrfToken, request, response)

This change was to ensure that we could delay creating an HTTP Session until we actually needed one. More details can be found at https://jira.springsource.org/browse/SEC-2276

@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

Understood.. Do we still need

            request.setParameter(token.getParameterName(), token.getToken());

then?

@rwinch
Copy link
Contributor

rwinch commented Nov 12, 2013

Yes both steps are necessary. The saveToken is simply to ensure that the expected token is setup correctly. The setParameter is so that the provided token matches the expected token.

@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

got it, thx!

@cbeams
Copy link
Contributor Author

cbeams commented Nov 12, 2013

Hey all, just a heads up that with the latest commit it looks like we’ve upgraded to M6 successfully. I’ll rebase this and merge shortly. Thanks!

Made in preparation for upgrade to Spring Boot 0.5.0.M6, which itself
depends on Spring Security 3.2.0.RC2, this upgrade required a minor
update to SecurityRequestPostProcessors to reflect a breaking API change
in Spring Security's CSRF support.
In preparation for upgrade to Spring Boot 0.5.0.M6, which depends on the
now-released HttpClient 4.3 GA.
Synchronize Thymeleaf dependencies with their respective versions in
Spring Boot 0.5.0.M6 in preparation for upgrade to the latter.
Now enabled by default in Spring boot 0.5.0.M6, this commit explicitly
disables Hibernate schema generation in order to allow Flyway to
continue handling schema creation and updates without conflict.
@cbeams cbeams merged commit dddc583 into master Nov 13, 2013
@cbeams cbeams deleted the upgrade-boot-m6 branch March 20, 2014 11:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants