永发信息网

Spring 报错:解析xml失败

答案:1  悬赏:40  手机版
解决时间 2021-02-27 18:10
  • 提问者网友:杀手的诗
  • 2021-02-26 17:51
<?xml version="1.0" encoding="UTF-8"?>
<! DOCTYPE bean PUBLIC"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-bean.dtd">
<bean>
<bean id = "message" classv= "com.vo.Message">
<property name = "message">
<value>Hello Spring!</value>
</property>
</bean>
</bean>
现在报这个错了Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 2 in XML document from class path resource [springtest.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
最佳答案
  • 五星知识达人网友:鱼忧
  • 2021-02-26 18:53
<bean>
<bean id = "message" classv= "com.vo.Message">
<property name = "message">
<value>Hello Spring!</value>
</property>
</bean>
</bean>

外面的是beans标签 class那多了个v
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯