SPRING配置文件出错的问题

beyh 2006-08-31 01:47:12
org.springframework.beans.factory.BeanDefinitionStoreException: Line 66 in XML document from file [D:\workspace\BlogOnline\src\applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Attribute "abstract" must be declared for element type "bean".
org.xml.sax.SAXParseException: Attribute "abstract" must be declared for element type "bean".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:126)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:125)
at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:65)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:226)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:60)
at test.TestArticleWork.setUp(TestArticleWork.java:37)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


在配置文件中相关内容为:
<bean id="absTxDef" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="set*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="delete*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>

他的意思大概是说abstract必须写在bean标签里面是吧,,我是这样的啊,不知道错在哪里了,请各位高手帮帮忙,看看到底哪里错了.
...全文
228 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
YuLimin 2006-09-02
  • 打赏
  • 举报
回复
没有什么不妥之处,先把 abstract="true"去掉吧
terry_yip 2006-09-01
  • 打赏
  • 举报
回复
你把abstract去掉,你这个例子我做过,我没加abstract属性一样可以的。
qinqinxiatiao 2006-08-31
  • 打赏
  • 举报
回复
XML文件错误~~
infowain 2006-08-31
  • 打赏
  • 举报
回复
是不是不是这一段出的错,
是不是有其他的bean定义的时候没有指定abstract属性
weiba9412 2006-08-31
  • 打赏
  • 举报
回复
配置文件的内容还有吧!!!不止这些吧!
beyh 2006-08-31
  • 打赏
  • 举报
回复
回楼上的,检查过了,不是xml文件格式的问题
infowain 2006-08-31
  • 打赏
  • 举报
回复
估计是你的xml格式坏了,你是怎么编辑这个xml的?用XMLSpy之类的软件看看你的xml是不是“格式良好的”

67,516

社区成员

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

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