spring异常之:Document root element "beans", must match DOCTYPE root "null"
遇到一个新问题,ssh项目部署时遇到Document root element "beans", must match DOCTYPE root "null".的错误提示,网上很多人说要把applicationContex.xml文件中加上如下第二行的标签,说明DTD,其实并不准确。 …… 后来在spring forum上发现了正解: You have the wrong xml configuration for the version of spring. 1.x use DOCTYPE 2.x use schema You must have 1.x in the classpath. 引自http://forum.springframework.org/showthread.php?t=37883 现在明白了,spring 1.x 使用DOCTYPE,而2.x是用schema,我的项目出错原因是由于前面的其他错误怀疑spring版本问题把spring2.0换成了spring1.2,但applicationContex.xml还是使用 更换spring为2.0问题解决。