tomcat发布时出现错误

cw1170359271 2013-05-14 09:26:57
2013-05-14 09:20:04 Loading XML bean definitions from file [D:\tomcat\apache-tomcat-6.0.33\webapps\Crm1\WEB-INF\classes\applicationContext-user-biz.xml]
2013-05-14 09:20:04 Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from file [D:\tomcat\apache-tomcat-6.0.33\webapps\Crm1\WEB-INF\classes\applicationContext-user-biz.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".这是什么错误!!下面是spring和hibernate整合一起的配置文件<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd ">


<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url"
value="jdbc:oracle:thin:@localhost:1521:orcl">
</property>
<property name="username" value="chenwang"></property>
<property name="password" value="sb"></property>
</bean>
...全文
59 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 3 楼 cw1170359271 的回复:
我用的是spring2.5版的,但是我我的配置是按spring3.0配置的,所以我想知道spring2.5怎么配置dataSource,可能使版本的原因
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null". 就目前错误,确实是少个</beans> sax解析的时候 匹配不成功。。
cw1170359271 2013-05-14
  • 打赏
  • 举报
回复
我用的是spring2.5版的,但是我我的配置是按spring3.0配置的,所以我想知道spring2.5怎么配置dataSource,可能使版本的原因
cw1170359271 2013-05-14
  • 打赏
  • 举报
回复
结尾有</beans> ,这只是配置信息的一半
wangyaya152150 2013-05-14
  • 打赏
  • 举报
回复
<beans>元素错误。结尾没有</beans>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧