java - Apache Tiles - HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception -
i want use apache tiles in spring project. added these dependencies pom.xml
file:
<dependency> <groupid>org.apache.tiles</groupid> <artifactid>tiles-api</artifactid> <version>3.0.5</version> </dependency> <dependency> <groupid>org.apache.tiles</groupid> <artifactid>tiles-core</artifactid> <version>3.0.5</version> </dependency> <dependency> <groupid>org.apache.tiles</groupid> <artifactid>tiles-jsp</artifactid> <version>3.0.5</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>1.7.6</version> </dependency>
that's dispatcher-servlet.xml
file:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> <context:component-scan base-package="controller"/> <bean id="tilesconfigurer" class="org.springframework.web.servlet.view.tiles3.tilesconfigurer"> <property name="definitions"> <list> <value>/web-inf/defs/general.xml</value> </list> </property> </bean> <bean id="viewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver"> <property name="viewclass" value="org.springframework.web.servlet.view.tiles3.tilesview"/> </bean>
that's general.xml
file:
<?xml version="1.0" encoding="iso-8859-1" ?> <!doctype tiles-definitions public "-//apache software foundation//dtd tiles configuration 3.0//en" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> <tiles-definitions> <definition name="common" template="/web-inf/layout/template.jsp"> <put-attribute name="footer" value="/web-inf/layout/footer.jsp" /> </definition> <definition name="index" extends="common"> <put-attribute name="title" value="westory" /> <put-attribute name="body" value="/web-inf/pages/index.jsp" /> </definition> </tiles-definitions>
and error i'm getting when run project:
http status 500 - servlet.init() servlet dispatcher threw exception
type exception report message servlet.init() servlet dispatcher threw exception description server encountered internal error prevented fulfilling request. exception javax.servlet.servletexception: servlet.init() servlet dispatcher threw exception org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79) org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:616) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:673) org.apache.tomcat.util.net.aprendpoint$socketprocessor.dorun(aprendpoint.java:2503) org.apache.tomcat.util.net.aprendpoint$socketprocessor.run(aprendpoint.java:2492) java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) java.lang.thread.run(thread.java:745) root cause java.lang.noclassdeffounderror: org/apache/tiles/request/applicationcontext java.lang.class.getdeclaredmethods0(native method) java.lang.class.privategetdeclaredmethods(class.java:2701) java.lang.class.getdeclaredmethods(class.java:1975) org.springframework.util.reflectionutils.getdeclaredmethods(reflectionutils.java:606) org.springframework.util.reflectionutils.dowithmethods(reflectionutils.java:518) org.springframework.util.reflectionutils.dowithmethods(reflectionutils.java:504) org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.determinecandidateconstructors(autowiredannotationbeanpostprocessor.java:241) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.determineconstructorsfrombeanpostprocessors(abstractautowirecapablebeanfactory.java:1069) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:1042) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:510) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:305) org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:301) org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:196) org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:772) org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:835) org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:537) org.springframework.web.servlet.frameworkservlet.configureandrefreshwebapplicationcontext(frameworkservlet.java:667) org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:633) org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:681) org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:552) org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:493) org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:136) javax.servlet.genericservlet.init(genericservlet.java:158) org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79) org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:616) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:673) org.apache.tomcat.util.net.aprendpoint$socketprocessor.dorun(aprendpoint.java:2503) org.apache.tomcat.util.net.aprendpoint$socketprocessor.run(aprendpoint.java:2492) java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) java.lang.thread.run(thread.java:745) root cause java.lang.classnotfoundexception: org.apache.tiles.request.applicationcontext org.apache.catalina.loader.webappclassloaderbase.loadclass(webappclassloaderbase.java:1333) org.apache.catalina.loader.webappclassloaderbase.loadclass(webappclassloaderbase.java:1167) java.lang.class.getdeclaredmethods0(native method) java.lang.class.privategetdeclaredmethods(class.java:2701) java.lang.class.getdeclaredmethods(class.java:1975) org.springframework.util.reflectionutils.getdeclaredmethods(reflectionutils.java:606) org.springframework.util.reflectionutils.dowithmethods(reflectionutils.java:518) org.springframework.util.reflectionutils.dowithmethods(reflectionutils.java:504) org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.determinecandidateconstructors(autowiredannotationbeanpostprocessor.java:241) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.determineconstructorsfrombeanpostprocessors(abstractautowirecapablebeanfactory.java:1069) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:1042) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:510) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:305) org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:301) org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:196) org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:772) org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:835) org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:537) org.springframework.web.servlet.frameworkservlet.configureandrefreshwebapplicationcontext(frameworkservlet.java:667) org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:633) org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:681) org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:552) org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:493) org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:136) javax.servlet.genericservlet.init(genericservlet.java:158) org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79) org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:616) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:673) org.apache.tomcat.util.net.aprendpoint$socketprocessor.dorun(aprendpoint.java:2503) org.apache.tomcat.util.net.aprendpoint$socketprocessor.run(aprendpoint.java:2492) java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) java.lang.thread.run(thread.java:745)
add dependency below pom.xml
<dependency> <groupid>org.apache.tiles</groupid> <artifactid>tiles-request-api</artifactid> <version>1.0.6</version> </dependency>
Comments
Post a Comment