ReplyController를 등록하고 댓글을 json 방식으로 불러오려는데 다음과 같은 에러가 계속 나옴.
11월 07, 2014 11:42:17 오전 org.apache.catalina.core.ApplicationContext log
정보: Marking servlet ReplyController as unavailable
11월 07, 2014 11:42:17 오전 org.apache.catalina.core.StandardWrapperValve invoke
심각: Allocate exception for servlet ReplyController
java.lang.ClassCastException: org.hotsix.web.ReplyController cannot be cast to javax.servlet.Servlet
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
이유는 web.xml에 BbsController가 잡혀 있기 때문으로 보임.
따라서 BbnController 부분을 지우고 나서,
<servlet>
<description></description>
<display-name>BbsController</display-name>
<servlet-name>BbsController</servlet-name>
<servlet-class>org.hotsix.web.BbsController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>BbsController</servlet-name>
<url-pattern>/bbs</url-pattern>
</servlet-mapping>
ajax 부분의 url 부분을 고쳐주니 됨.
url: "reply"
-->>
url: "/reply/getReply",
현재 web.xml 내용.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
'코딩 > WEB' 카테고리의 다른 글
에러: 406 not acceptable (0) | 2014.11.14 |
---|---|
에러 : ajax 파일 전송 오류 (2) | 2014.11.13 |
Web : 글 보기 게시판에 댓글 보는 기능 붙여주기 (ajax+JSON) (0) | 2014.11.06 |
Spring - Transaction 예제 (0) | 2014.10.17 |
Spring - Cookie Filter 예제 (0) | 2014.10.17 |