netbeans ssh开发,因为applicationContext.xml格式导致部署失败的解决办法

最近在netbeans上做一个基于ssh的编程作业,但是遇到一个问题,总是部署失败,tomcat 报错如下:

Context initialization Failed
org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 23 in XML document from ServletContext resource [/WEB-INF/applicationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "p" for attribute "p:driverClassName" associated with an element type "beans:bean" is not bound.

因为初次接触ssh,一直不明白怎么回事,网上关于netbeans开发ssh的资料也很少,后来在国外一个网站(http://forum.spring.io/forum/spring-projects/security/57614-error-in-configuration-file)上找到了解决办法,原来在applicationContext.xml中用到了

<bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
	p:driverClassName="com.MysqL.jdbc.Driver"
        p:url="jdbc:MysqL://127.0.0.1:3306/test"
        p:username="root"
        p:password="123456"/>

但是缺乏p命名空间,所以在开头加一行:xmlns:p="http://www.springframework.org/schema/p" 即可。

开发过程中可能还有一些其他的问题导致部署失败,首先可以考虑下”清理并重新生成“,然后看看报错,基本都可解决

希望能给需要的朋友提供一点帮助!

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念