Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The system is out of resources.
- Consult the following stack trace for details.
- java.lang.StackOverflowError
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3250)
- at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1825)
- at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3250)
- at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1825)
- at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3250)
- at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
- at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
- at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1825)
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.security.authentication.AuthenticationManager;
- import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
- import org.springframework.security.config.annotation.web.builders.HttpSecurity;
- import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
- import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
- import org.springframework.security.core.userdetails.UserDetailsService;
- import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
- //TODO: Interceptors are currently configured in xml. Configuration should be done in java.
- @Configuration
- @EnableWebSecurity
- public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
- @Autowired
- private UserDetailsService userDetailsService;
- @Bean
- public BCryptPasswordEncoder bCryptPasswordEncoder() {
- return new BCryptPasswordEncoder();
- }
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests()
- .antMatchers("/resources/**", "/login*", "/signup/**").permitAll()
- .antMatchers("/AccessControl/users").hasAuthority("AccessControl_users")
- .antMatchers("/AccessControl/removeUser").hasAuthority("AccessControl_removeUser")
- .antMatchers("/AccessControl/toggleStatus").hasAuthority("AccessControl_toggleStatus")
- //Eliminating the middle one for simplicity
- .antMatchers("/AccessControl/manageUser").hasAuthority("AccessControl_manageUser")
- .antMatchers("/AccessControl/manageUserPost").hasAuthority("AccessControl_manageUserPost")
- .antMatchers("/Account/addAccount").hasAuthority("Account_addAccount")
- .antMatchers("/Account/AccountListing").hasAuthority("Account_AccountListing")
- .antMatchers("/account/edit").hasAuthority("account_edit")
- .antMatchers("/Account/printPaymentPettyCash").hasAuthority("Account_printPaymentPettyCash")
- .antMatchers("account/getTaxDetailList").hasAuthority("account_getTaxDetailList")
- .antMatchers("Account/ajax/getChequeNumberList").hasAuthority("Account_ajax_getChequeNumberList")
- .antMatchers("/home").hasAuthority("home")
- .anyRequest().authenticated()
- .and()
- .formLogin()
- .loginPage("/login")
- .permitAll()
- .and()
- .csrf().disable()
- .logout()
- .permitAll();
- }
- @Bean
- public AuthenticationManager customAuthenticationManager() throws Exception {
- return authenticationManager();
- }
- @Autowired
- public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
- auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement