NoClassDefFoundError:org / apache / tiles / TilesApplicationContext Spring Servlet出错

时间:2016-05-07 05:14:38

标签: 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.xml配置文件中使用了tiles 3.0并添加了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>

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

1 个答案:

答案 0 :(得分:0)

尝试添加这些依赖项。

<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个依赖项{1}}