java - Unable to configure resource mapping in spring framework 4.2.1 release -


i tried develop web project using spring framework 4.2.1 release raised error in resource mapping. can't find mapped resources(image,css,javascript, etc.)

-myservices-servlet.xml

<context:annotation-config/>    <context:component-scan base-package="com.mv.services"/>         <bean class="org.springframework.web.servlet.view.internalresourceviewresolver">         <property name="prefix" value="/web-inf/views/pages/" />         <property name="suffix" value=".jsp" />     </bean>     <bean id="tilesviewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver">         <property name="viewclass" value="org.springframework.web.servlet.view.tiles3.tilesview" />         <property name="order" value="1"/>     </bean>     <bean id="tilesconfigurer" class="org.springframework.web.servlet.view.tiles3.tilesconfigurer">         <property name="definitions">             <list>                  <value>/web-inf/tiles/tiles.xml</value>             </list>         </property>         <property name="preparerfactoryclass" value="org.springframework.web.servlet.view.tiles3.springbeanpreparerfactory"/>     </bean>     <bean id="multipartresolver"           class="org.springframework.web.multipart.commons.commonsmultipartresolver">         <property name="maxuploadsize" value="10485"/>     </bean>        <mvc:annotation-driven/>     <mvc:resources mapping="/resources/**" location="/resources/"/>      <bean id="localeresolver"         class="org.springframework.web.servlet.i18n.cookielocaleresolver">         <property name="defaultlocale" value="fr" />         <property name="cookiename" value="myapplocalecookie"/>         <property name="cookiemaxage" value="3600"/>     </bean> 

if enter resource url in browser windows, following error happend

21-sep-2015 14:02:08.293 severe [http-nio-8084-exec-11] org.apache.catalina.core.standardwrappervalve.invoke servlet.service() servlet [mvservices] in context path [/mvservices] threw exception [request processing failed; nested exception java.lang.illegalargumentexception: no matching constant [0]] root cause  java.lang.illegalargumentexception: no matching constant [0]     @ org.springframework.http.httpstatus.valueof(httpstatus.java:488)     @ org.springframework.web.context.request.servletwebrequest.iscompatiblewithconditionalrequests(servletwebrequest.java:244)     @ org.springframework.web.context.request.servletwebrequest.checknotmodified(servletwebrequest.java:181)     @ org.springframework.web.servlet.resource.resourcehttprequesthandler.handlerequest(resourcehttprequesthandler.java:240)     @ org.springframework.web.servlet.mvc.httprequesthandleradapter.handle(httprequesthandleradapter.java:51)     @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959)     @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893)     @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:970)     @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:861)     @ javax.servlet.http.httpservlet.service(httpservlet.java:618)     @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:846)     @ javax.servlet.http.httpservlet.service(httpservlet.java:725)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)     @  org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1556)     @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1513)     @ 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) 

help me ,what's reason?

-web.xml

<?xml version="1.0" encoding="utf-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">     <context-param>         <param-name>contextconfiglocation</param-name>         <param-value>/web-inf/applicationcontext.xml</param-value>     </context-param>     <filter>         <filter-name>characterencodingfilter</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>characterencodingfilter</filter-name>         <url-pattern>/*</url-pattern>     </filter-mapping>     <listener>         <listener-class>org.springframework.web.context.contextloaderlistener</listener-class>     </listener>     <servlet>         <servlet-name>mvservices</servlet-name>         <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class>         <load-on-startup>1</load-on-startup>     </servlet>     <servlet-mapping>         <servlet-name>mvservices</servlet-name>         <url-pattern>/</url-pattern>     </servlet-mapping>     <session-config>         <session-timeout>             30         </session-timeout>     </session-config>     <welcome-file-list>         <welcome-file>redirect.jsp</welcome-file>     </welcome-file-list> </web-app> 

currently i'm developing project in netbeans ide 8.0.2 apache tomcat 8.0.15.0

i'm trying reproduce issue in dedicated repro project.

it seems response comes http response status of value "0" breaks parsing algorithm. i'd know value coming from.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -