Announcement Announcement Module
Collapse
No announcement yet.
Spring and apache tiles error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and apache tiles error

    Hi!

    I running a web application traying to integrate spring 3.0.5 and apache tiles 2.2.2 but an error rise at tomcat startap.
    I am using the following libraries in my app:
    jstl1.1, spring 3.0.5, common beans utils 1.8.3, commons-digester-2.1, slf4j-1.6.1, apache tiles 2.2.2, commons-logging-1.1.1 and apache-log4j-1.2.16 and this are my bean config:

    <bean id="tilesConfigurer"
    class="org.springframework.web.servlet.view.tiles2 .TilesConfigurer"
    p:definitions="/WEB-INF/tiles-defs/templates.xml" />

    <bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBas edViewResolver"
    p:viewClass="org.springframework.web.servlet.view. tiles2.TilesView" />


    an finally the error:

    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'tilesConfigurer' defined in ServletContext resource [/WEB-INF/spring/webmvc-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/tiles/startup/BasicTilesInitializer
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:965)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:911)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3972)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4467)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:546)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:498)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1277)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:321)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
    Caused by: java.lang.NoClassDefFoundError: org/apache/tiles/startup/BasicTilesInitializer


    thanks in advance!

  • #2
    It seems that you are missing org.apache.tiles.startup.BasicTilesInitializer class. Double check that you have org.apache.tiles:tiles-core maven artifact in your pom (or tiles-core-2.2.2.jar in your classpath in case you aren't using maven).

    Comment


    • #3
      thanks .. but.. I checked and tiles-core is in the classpath..

      Comment


      • #4
        This question is a little old, but the issue may still come up if you're using the Spring By Example samples and Tiles 3.0. The solution, in addition with referencing tiles-core in the pom file is to look for any references to the TilesConfigurer, TilesView or other springframework web servlet beans defined as using tiles2. For example:

        Code:
        <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" ... />
        Change tiles2 to tiles3 and redeploy.

        Comment

        Working...
        X