jeudi 16 avril 2015

Spring Boot, Elastic Beanstalk error, no issue from the IDE

I'm currently using continuous integration in order to automatically set up and configure the servers. Unfortunately I'm running into issues when the Elastic Beanstalk Tomcat 8 initializes. I get the following error only when running from AWS, it runs fine in my ide:



Caused by: java.lang.NullPointerException: null
at org.springframework.security.config.annotation.web.builders.HttpSecurity.addFilterBefore(HttpSecurity.java:1112) ~[spring-security-config-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at uk.co.thinkinnovate.security.WebSecurityConfig.configure(WebSecurityConfig.java:41) ~[WebSecurityConfig.class:na]
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:199) ~[spring-security


And the block of code with the issue:



@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf()
.disable()
.addFilterBefore(tokenProcessingFilter(),
BasicAuthenticationFilter.class)
.addFilterBefore(new SimpleCORSFilter(),
AuthenticationTokenProcessingFilter.class)
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().exceptionHandling();
}

@Bean
public AuthenticationTokenProcessingFilter tokenProcessingFilter() {
System.out.println("Getting token processing filter.");
System.out.println(this.tokenBasedRememberMeService);
return this.tokenBasedRememberMeService;
}


Why is the TomCat version not autowiring the tokenBasedRememberMeService but my Spring Boot application is?


Thanks guys.





Aucun commentaire:

Enregistrer un commentaire