gpt4 book ai didi

java.lang.NullPointerException 在 org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java :124)

转载 作者:行者123 更新时间:2023-11-30 07:44:15 24 4
gpt4 key购买 nike

我确实有 spring 4.1.7 的所有 jar 和tiles 3.0.5 版本的 jar ,请查找以下错误。

SCHWERWIEGEND: Servlet.service() for servlet [mccstore] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'standard_welcome': Invocation of init method failed; nested exceptio
n is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java:124)
at org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java:107)
at org.springframework.web.servlet.view.tiles3.TilesView.afterPropertiesSet(TilesView.java:97)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)

最佳答案

确保您已定义以下 bean:

@Bean
public TilesConfigurer tilesConfigurer() {
TilesConfigurer tiles = new TilesConfigurer();
tiles.setDefinitions("/WEB-INF/definitions.xml");
return tiles;
}

@Bean
public UrlBasedViewResolver viewResolver() {
UrlBasedViewResolver tilesViewResolver = new UrlBasedViewResolver();
tilesViewResolver.setViewClass(TilesView.class);
return tilesViewResolver;
}

并具有以下依赖项:

    <dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>

希望有帮助。

关于java.lang.NullPointerException 在 org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java :124),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34152781/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com