【发布时间】:2016-05-07 05:14:37
【问题描述】:
我正在尝试使用带有 apache 磁贴的 spring mvc 的 helloworld 应用程序。在我部署我的应用程序时,tomcat 未能通过显示以下错误来部署我的应用程序:
SEVERE: StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/apache/tiles/TilesApplicationContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:606)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:518)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:504)
我使用了 tiles 3.0,并在我的 tiles.xml 配置文件中添加了 tiles-config3.0。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
pom.xml
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>3.0.0</version>
</dependency>
你能告诉我我在这里缺少什么吗? 您的建议将不胜感激。 :)
【问题讨论】:
-
您的瓦片 jar 似乎没有与您的应用一起部署。
-
我已经粘贴到WEB-INF/lib文件夹了。
-
可能有点太晚了,但是 TilesApplicationContext 属于 Tiles 2,而不是 Tiles 3。你可能在某个地方有错误的依赖。也许您的观点之一是使用
org.springframework.web.servlet.view.tiles2.TilesView而不是org.springframework.web.servlet.view.tiles3.TilesView -
Spring-webflow 2.4.x 中不正确的版本或其他版本的 Tiles 可能会干扰。需要检查并排除较旧的 TIles。 Spring-webflow 2.5.1 有 Tiles3。
标签: java apache maven spring-mvc tiles