Morgan Kenyon
Morgan Kenyon

Reputation: 3172

Spring Tiles Integration Error

I am trying to integrate Tiles 3.0.0 with Spring 3.1, I have all the tile jar files under my lib folder. When I run the web project I get an

java.lang.ClassNotFoundException: org.apache.tiles.startup.BasicTilesInitializer

error. I need some help understanding why I am getting this error. Here is my configuration to setup in my servlet.xml page.

<bean class="org.springframework.web.servlet.view.tiles2.TilesViewResolver" />

<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/views/**/views.xml</value>
        </list>
    </property>
</bean>

Here is a question that's a lot like mine, link, but I've already got my tiles-core-3.0.0 in my build path. So I just need some help understanding how to get over this error.

Morgan

Upvotes: 1

Views: 2719

Answers (2)

PAA
PAA

Reputation: 12063

I've make a program working with Spring Framework version 3.2.13.RELEASE and Tiles-3 (version 3.0.5). You need to use following configuration

<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
        <property name="definitions">
            <list>
                <value>/WEB-INF/tiles/tiles-definitions.xml</value>
            </list>
        </property>
</bean>

with dependency

<dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-extras</artifactId>
    <version>3.0.5</version>
</dependency>
<!-- Spring Web MVC -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>3.2.13.RELEASE</version>
</dependency>

I think this is what you're trying to achieve. It works fine in my case !

Upvotes: 0

Mariusz
Mariusz

Reputation: 2737

At the time of writing this, Spring still does not support Tiles 3. I'm using Spring 3.1.2 and had to downgrade Tiles back to version 2.2.2 in order for my application to run.

Upvotes: 4

Related Questions