java - NoClassDefFound错误: org/apache/tiles/TilesApplicationContext Error with Spring Servlet

标签 java apache maven spring-mvc tiles

我正在尝试使用带有 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>

你能告诉我我在这里缺少什么吗? 您的建议将不胜感激。 :)

最佳答案

也尝试添加这些依赖项。

<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>

<dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-api</artifactId>
    <version>3.0.0</version>
</dependency>

 <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-servlet</artifactId>
    <version>3.0.0</version>
</dependency>

 <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-template</artifactId>
    <version>3.0.0</version>
</dependency>

如果没有解决请尝试<scope>runtime</scope>为您tiles pom.xml 中的依赖项

关于java - NoClassDefFound错误: org/apache/tiles/TilesApplicationContext Error with Spring Servlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37084756/

相关文章:

java - <c :if test ='${empty Validated}' ><jsp:forward page ="/do/Index"/></c:if> not forwarding properly in Spring Boot

java - 从有界 nextInt(int bound) 结果中查找 Java.util.Random 种子

python - 允许 Outlook 2007 编辑自定义共享 iCalendar

java热交换一个库

android - 获取 Jitpack 作为 jar 但需要 aar

java - 如何使用 Scala 中的 Guava 类 (HashMultiset)?

java - 无法解析的日期异常

php - 用于获取 UTC 时区的 Web 和数据库服务器设置 "right"

php - 如何使用 Apache 禁用 Content-Length 响应 header ?

java - 创建单个可执行 jar 文件 Maven