Announcement Announcement Module
Collapse
No announcement yet.
Exception when trying to use tiles Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception when trying to use tiles

    Hello,
    I am new here, so I don't really know where to ask question. I am really sorry if I am posting it at wrong place.
    I am getting following exception:

    Code:
    HTTP Status 500 - Servlet.init() for servlet appServlet threw exception
    type Exception report
    message Servlet.init() for servlet appServlet threw exception
    exception
    root cause
    java.lang.NoClassDefFoundError: org/apache/tiles/startup/BasicTilesInitializer
    	java.lang.ClassLoader.defineClass1(Native Method)
    	java.lang.ClassLoader.defineClass(Unknown Source)
    	java.security.SecureClassLoader.defineClass(Unknown Source)
    	org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
    	org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    	java.lang.Class.getDeclaredConstructors0(Native Method)
    	java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    	java.lang.Class.getDeclaredConstructors(Unknown Source)
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:229)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:962)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:935)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	javax.servlet.GenericServlet.init(GenericServlet.java:160)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	java.lang.Thread.run(Unknown Source)
    
    root cause
    
    java.lang.ClassNotFoundException: org.apache.tiles.startup.BasicTilesInitializer
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    	java.lang.ClassLoader.defineClass1(Native Method)
    	java.lang.ClassLoader.defineClass(Unknown Source)
    	java.security.SecureClassLoader.defineClass(Unknown Source)
    	org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
    	org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
    	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    	java.lang.Class.getDeclaredConstructors0(Native Method)
    	java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    	java.lang.Class.getDeclaredConstructors(Unknown Source)
    	org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:229)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:962)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:935)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    	org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
    	javax.servlet.GenericServlet.init(GenericServlet.java:160)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	java.lang.Thread.run(Unknown Source)
    I have dependancies in POM.xml specific to tiles as:

    Code:
    <dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-core</artifactId>
    			<version>2.2.2</version>
    			<type>jar</type>
    			<scope>compile</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-template</artifactId>
    			<version>2.2.2</version>
    			<type>jar</type>
    			<scope>compile</scope>
    		</dependency>
    
    		<dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-jsp</artifactId>
    			<version>2.2.2</version>
    			<type>jar</type>
    			<scope>compile</scope>
    		</dependency>
    
    		<dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-servlet</artifactId>
    			<version>2.2.2</version>
    			<type>jar</type>
    			<scope>compile</scope>
    		</dependency>
    I am really not getting this exception. I solved few before this. I also moved the tiles-core-2.2.1.jar(as this was the jar I downloaded) in WEB-INF/lib folder.

    My servlet-context.xml has following entries:
    Code:
    <beans:bean id="viewResolver" 
    	class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <beans:property name="viewClass">
            <beans:value>
                org.springframework.web.servlet.view.tiles2.TilesView
            </beans:value>
        </beans:property>
    	</beans:bean>
    
    	<beans:bean id="tilesConfigurer" 
    	class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
        <beans:property name="definitions">
            <beans:list>
                <beans:value>/WEB-INF/tiles.xml</beans:value>
            </beans:list>
       	</beans:property>
    	</beans:bean>
    I am just trying to show the menu.jsp on each page using tiles but getting this exception.
    Please help. If any file is needed, please ask. Thanks in advance.
Working...
X