I have an application that works great when launched in IntelliJ or through the Gradle bootloader.
however, if I boot bootRepackage and then try to run the resulting jar, I get the following:
2014-12-02 21:46:14.086 ERROR 9839 --- [nio-2014-exec-2] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-2014-exec-2] Exception processing template "/login": Error resolving template "/login", template might not exist or might not be accessible by any of the configured Template Resolvers 2014-12-02 21:46:14.087 ERROR 9839 --- [nio-2014-exec-2] oaccC[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/login", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/login", template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:245) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335)
I see that the bank has / templates / **. the content looks fine to me.
One of the possible (?) Factors may be that I am using an HTML page related to the layout in this way:
layout:decorator="layouts/main"
I can confirm that the file is in the bank.
/ login is defined as follows:
@Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/login").setViewName("/login"); registry.addViewController("/").setViewName("/login"); }
and Spring Spring is configured as:
@Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity security) { security.ignoring().antMatchers("/assets/**"); } @Override protected void configure(HttpSecurity http) throws Exception { http .csrf().disable(); http .authorizeRequests() .antMatchers("/").permitAll() .anyRequest().authenticated(); http .formLogin() .loginPage("/login") .defaultSuccessUrl("/home") .failureUrl("/login?error") .permitAll() .and() .logout() .invalidateHttpSession(true) .logoutSuccessUrl("/login?logout") .permitAll(); } }
I think that everything that may be relevant to this problem ...
I saw https://github.com/spring-projects/spring-boot/issues/112 and the correct location of Thymeleaf views for Spring (among others). Despite these resources, I could not get the permission of the template.
Any suggestions gratefully received.
Going so far with Spring Boot, but still tripping over the last hurdle (near-final deployment) is annoying.