Spring异常备忘录 博客分类: Spring SpringServletXMLWebMVC
程序员文章站
2024-02-21 20:02:22
...
引用
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/springmvc-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml]
在WEB-INF 下确实是没有找到springmvc-servlet.xml , 同时根本没有编辑这个xml文件,更加没有引用他
原因是:在web.xml里配置了如下的servlet
<servlet> <servlet-name>adminServlet</servlet-name> <servletclass>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- <init-param> <param-name>namespace</param-name> <param-value>admin-servlet</param-value> </init-param> <init-param> <param-name>namespace</param-name> <param-value>spring/mvc-config</param-value> </init-param> --> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>adminServlet</servlet-name> <url-pattern>/remote/*</url-pattern> </servlet-mapping>
注意在运行时,Spring会在WEB-INF下去找adminServlet-servlet.xml这个是默认规定的,当然你可以像斜体内容去指定加载的*.xml文件名
not allowed in read-only mode (FlushMode.NEVER)
即check打头的操作时,是不可操作数据库的,包括更新与增加数据。
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager" ref="transactionManager" /> <property name="transactionAttributes"> <props> <prop key="query*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="check*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="insert*"> PROPAGATION_REQUIRED,-GenericException </prop>
即check打头的操作时,是不可操作数据库的,包括更新与增加数据。
修改为
<prop key="check*">PROPAGATION_REQUIRED</prop>
推荐阅读
-
Spring异常备忘录 博客分类: Spring SpringServletXMLWebMVC
-
Spring mvc3的ajax 博客分类: Spring AjaxSpringjsonjQueryMVC
-
Spring事务管理 博客分类: Spring Spring配置管理DAOXMLBean
-
spring3.0+hibernate3.5整合那些事儿 博客分类: spring HibernateAOPSpringBeanMySQL
-
Spring in Action 笔记(I) 博客分类: BlogJava SpringBeanAOPIOCXML
-
Spring in Action 笔记(II) 博客分类: BlogJava SpringJavaSQLJDBCDerby
-
spring3.0+hibernate3.5整合那些事儿 博客分类: spring HibernateAOPSpringBeanMySQL
-
Spring in Action 笔记(II) 博客分类: BlogJava SpringJavaSQLJDBCDerby
-
struts2启动报错com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1 博客分类: JavaEE SpringJavaApacheStrutsBean
-
struts2启动报错com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1 博客分类: JavaEE SpringJavaApacheStrutsBean