NPE Spring Webflow с Apache Tiles 3

У меня есть весенний проект с MVC и Webflow. Я получаю NPE при попытке отобразить определение плиток, указанное как представление состояния просмотра в веб-потоке.

Мой WebflowConfig:

@Configuration
public class WebFlowConfig extends AbstractFlowConfiguration {

@Autowired 
private List<ViewResolver> viewResolvers;

@Bean
public FlowExecutor flowExecutor() {
    return getFlowExecutorBuilder(flowRegistry())
            .addFlowExecutionListener(new SecurityFlowExecutionListener(), "*")
            .build();
}

@Bean
public FlowDefinitionRegistry flowRegistry() {
    return getFlowDefinitionRegistryBuilder(flowBuilderServices())
            .setBasePath("/WEB-INF/flows")
            .addFlowLocationPattern("/*.xml").build();
}

@Bean
public FlowBuilderServices flowBuilderServices() {
    return getFlowBuilderServicesBuilder()
            .setViewFactoryCreator(mvcViewFactoryCreator())
            .setDevelopmentMode(true)
            .build();
}

@Bean
public MvcViewFactoryCreator mvcViewFactoryCreator() {
    MvcViewFactoryCreator factoryCreator = new MvcViewFactoryCreator();
    factoryCreator.setViewResolvers(viewResolvers);
    factoryCreator.setUseSpringBeanBinding(true);
    return factoryCreator;
}

@Bean
public LocalValidatorFactoryBean validator() {
    return new LocalValidatorFactoryBean();
}

Мой WebMvcConfig:

@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "py.com.bbva.guepardo")
@Import(WebFlowConfig.class)
public class AppConfig  extends WebMvcConfigurerAdapter { 

@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(viewResolver());
}

@Bean
public ViewResolver viewResolver(){
    TilesViewResolver viewResolver = new TilesViewResolver();
    viewResolver.setOrder(2);
    viewResolver.setViewClass(TilesView.class);
    return viewResolver;
}
@Bean
@Autowired
public FlowHandlerMapping flowHandlerMapping(WebFlowConfig webFlowConfig) { 
    FlowHandlerMapping handlerMapping = new FlowHandlerMapping(); 
    handlerMapping.setOrder(-1); 
    handlerMapping.setFlowRegistry(webFlowConfig.flowRegistry()); 
    return handlerMapping; 
} 

@Bean 
@Autowired
public FlowHandlerAdapter flowHandlerAdapter(WebFlowConfig webFlowConfig) { 
    FlowHandlerAdapter handlerAdapter = new FlowHandlerAdapter(); 
    handlerAdapter.setFlowExecutor(webFlowConfig.flowExecutor()); 
    handlerAdapter.setSaveOutputToFlashScopeOnRedirect(true); 
    return handlerAdapter; 
} 

@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
    configurer.enable();
}

@Bean
public TilesConfigurer tilesConfigurer() {
    TilesConfigurer tilesConfigurer = new TilesConfigurer();
    tilesConfigurer.setDefinitions(new String[] { "/WEB-INF/layouts/*.xml", "/WEB-INF/views/**/views.xml" });
    tilesConfigurer.setCheckRefresh(true);
    return tilesConfigurer;
}

У веб-потока, который я пытаюсь запустить, есть простое состояние просмотра, указывающее на определение плиток:

<view-state id="home" view="default_login" >
</view-state>

Это же определение работает с отдыхающим веб-сервисом @RequestMapping в классе @Controller, поэтому рендеринг представления mvc работает, но он не работает из определения веб-потока. Есть идеи?

Журнал ошибок консоли:

Caused by: org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'home' of flow 'home'
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.wrap(FlowExecutionImpl.java:573)
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:263)
    at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
    at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:253)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    ... 69 more    
Caused by: java.lang.IllegalStateException: Exception occurred rendering view null
    at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:200)
    at org.springframework.webflow.engine.ViewState.render(ViewState.java:293)
    at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:242)
    at org.springframework.webflow.engine.ViewState.resume(ViewState.java:220)
    at org.springframework.webflow.engine.Flow.resume(Flow.java:537)
    at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
    ... 74 more
Caused by: java.lang.NullPointerException
    at org.springframework.webflow.mvc.servlet.ServletMvcView.doRender(ServletMvcView.java:55)
    at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:196)
    ... 79 more

0 ответов

Другие вопросы по тегам