SpringSecurity error on Wildfly
<p>While log in with spring-security on wildfly i get this error-page:    </p>

<pre><code>{"timestamp":1464679377206,"status":999,"error":"None","message":"No message available"}
</code></pre>

<p>after refresh it redirects me on my custom error page. Then if I clear error-link (like that <a href="http://myapp/error" rel="nofollow noreferrer">http://myapp/error</a> ->  <a href="http://myapp" rel="nofollow noreferrer">http://myapp</a>) application works correctly. When I launch this app with spring-boot (not wildfly) there is no such problem. </p>

<p>Application class</p>

<pre><code>@SpringBootApplication
public class Application extends SpringBootServletInitializer {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(applicationClass);
    }

    private static Class&lt;Application&gt; applicationClass = Application.class;

}
</code></pre>

<p>Thymeleaf login form</p>

<pre><code>        &lt;div sec:authorize="isAnonymous()" id="anonymous-navbar" class="navbar-collapse collapse"&gt;
        &lt;form th:action="@{/login}" method="post" class="navbar-form navbar-right"&gt;
            &lt;div class="form-group"&gt;
                &lt;input type="text" name="username" placeholder="User" class="form-control" /&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;input type="password" name="password" placeholder="Password" class="form-control" /&gt;
            &lt;/div&gt;
            &lt;button type="submit" class="btn btn-success" value="login"&gt;Log in&lt;/button&gt;
        &lt;/form&gt;
</code></pre>

<p>Security configuration</p>

<pre><code>@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    UserService userService;

    @Autowired
    @Qualifier("userServiceImpl")
    UserDetailsService userDetailsService;

    @Autowired
    public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService);
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .authorizeRequests()
                .antMatchers("/", "/home", "/signup", "/add_person").permitAll()
                .anyRequest().authenticated()
                .and()
                .formLogin()
                .loginPage("/login")
                .permitAll()
                .and()
                .logout()
                .permitAll();
    }

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring()
                .antMatchers("/images/**");
    }
}
</code></pre>

<p>After debugging spring class DefaultErrorAttributes, which sends the message I got this error
<code>FirewalledRequest[ HttpServletRequestImpl [ GET /PersonalFinance/error ]]</code></p>

<p>I've watched wildfly logs and haven't found anything useful.</p>

<p><a href="https://i.stack.imgur.com/knIRx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/knIRx.png" alt="debug"></a></p>

<p>There are some same questions:</p>

<ul>
<li><a href="https://stackoverflow.com/questions/31954292/spring-security-with-basic-auth-redirecting-to-error-for-invalid-credentials">Spring Security with basic auth redirecting to /error for invalid credentials</a></li>
<li><a href="https://stackoverflow.com/questions/23272157/spring-security-remember-me-authentication-error">Spring Security - Remember Me Authentication Error</a></li>
</ul>

<p>But these answers haven't solved the problem</p>