0

Am try to integrate cometd(spring-jquery-jetty7) with the appfuse spring MVC project.

my web.xml is

<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/app/*</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>cometd</servlet-name>
    <servlet-class>org.cometd.server.CometdServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>cometd</servlet-name>
    <url-pattern>/cometd/*</url-pattern>
</servlet-mapping>

and did all other configuration like spring-jquery-jetty7 example, When i try cometd.handshake() from the script, it's failed and got error from the log like follows

WARN [http-8080-6] PageNotFound.handleHttpRequestMethodNotSupported(183) | Request method 'POST' not supported 115117 [http-8080-6] WARN org.springframework.web.servlet.PageNotFound - Request method POST' not supported

Anybody experience this? hope the dispatcher servlet process the request instead of cometd servlet, i dont know whats wrong in this, suggestion regarding this are welcome. thank you

mathi
  • 1,127
  • 12
  • 19
  • I don't see a startup order on the cometd servlet. I would think it would have to be loaded first, followed by Spring. Also, from the error message it appears like the URL was invalid...what is the full URL it's using to post? I would expect it would start with `/cometd/` from your web.xml posted. – CodeChimp Aug 28 '13 at 16:16
  • Hi @CodeChimp Thank you for your response, I resolve the issue by changing the servlet orders like cometd servlet first and dispatcher servlet second. thank you – mathi Aug 29 '13 at 16:48

1 Answers1

0

I resolve the issue by changing the servlet orders like cometd servlet first and dispatcher servlet second. The dispatcher servlet handle the cometd request first and throw the error always so i change the order like follows

 <servlet>
   <servlet-name>cometd</servlet-name>
   <servlet-class>org.cometd.server.CometdServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>

<servlet-mapping>
   <servlet-name>cometd</servlet-name>
   <url-pattern>/cometd/*</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>dispatcher</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>dispatcher</servlet-name>
  <url-pattern>/app/*</url-pattern>
</servlet-mapping>

and also add load-on-startup for initialize the comet servlet when application start. thank you

mathi
  • 1,127
  • 12
  • 19