【发布时间】:2014-04-02 16:57:46
【问题描述】:
我有一个主类来运行 spring mvc 应用程序作为使用码头的独立应用程序。我使用 maven-shade-plugin 生成 jar 文件。
我在运行 jar 文件时看到以下错误
org.eclipse.jetty.servlet.ServletHolder$1: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 106; cvc-elt.1: Cannot find the declaration of element 'beans'.
我的 mvc-dispacher-servlet.xml 如下所示
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
任何人都可以帮助我缺少什么
【问题讨论】:
-
如果您的列表是完整的 XML,那么需要有一个 或
。 -
这只是我的 mvc-dispacher-servlet.xml 的一个 sn-p
标签: spring-mvc embedded-jetty maven-assembly-plugin