spring的问题
各位大虾:
我在配置G-Roller时,因为我要使用的是oracle,而且我的数据库表也改名了,所以要重新配置,其它一切都很顺利,就是到测试的时候,总是报如下错误:
org.xml.sax.SAXParseException: Attribute "autowire" must be declared for element type "bean".
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
at org.springframework.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlBeanFactory.java:231)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:183)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:171)
at groller.framework.common.BeanFactoryWrapper.getBeanFactory(BeanFactoryWrapper.java:65)
at groller.framework.common.BeanFactoryWrapper.getBean(BeanFactoryWrapper.java:53)
................
我跟踪了一下
InputStream is = BeanFactoryWrapper.class.getClassLoader().getResourceAsStream(fileName);
BeanFactory factory = new XmlBeanFactory(is);
其中fileName是application.bean.xml
文件是找对了,可是找到我文件中的bean时,就报这个错,我在这个xml文件中即使添加如下内容:
<bean id="baseHibernateDAO" autowire="autodetect" class="groller.framework.dao.hibernate.BaseHibernateDAO">
<property name="entityType">
<value>testmodel.entity.Entity</value>
</property>
</bean>
其中注意autowire="autodetect".
可是还是发生这种异常,请问这是个什么道理哦,如果能有解决,一定高分相送!!!
我在配置G-Roller时,因为我要使用的是oracle,而且我的数据库表也改名了,所以要重新配置,其它一切都很顺利,就是到测试的时候,总是报如下错误:
org.xml.sax.SAXParseException: Attribute "autowire" must be declared for element type "bean".
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
at org.springframework.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlBeanFactory.java:231)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:183)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:171)
at groller.framework.common.BeanFactoryWrapper.getBeanFactory(BeanFactoryWrapper.java:65)
at groller.framework.common.BeanFactoryWrapper.getBean(BeanFactoryWrapper.java:53)
................
我跟踪了一下
InputStream is = BeanFactoryWrapper.class.getClassLoader().getResourceAsStream(fileName);
BeanFactory factory = new XmlBeanFactory(is);
其中fileName是application.bean.xml
文件是找对了,可是找到我文件中的bean时,就报这个错,我在这个xml文件中即使添加如下内容:
<bean id="baseHibernateDAO" autowire="autodetect" class="groller.framework.dao.hibernate.BaseHibernateDAO">
<property name="entityType">
<value>testmodel.entity.Entity</value>
</property>
</bean>
其中注意autowire="autodetect".
可是还是发生这种异常,请问这是个什么道理哦,如果能有解决,一定高分相送!!!
...全文
相关推荐
25个经典的Spring面试问题包含答案
java矿建之spring25个经典的Spring面试问题包含答案。
Spring AOP 问题
NULL 博文链接:https://qh8.iteye.com/blog/865821
解决Idea启动Spring Boot很慢的问题
主要介绍了解决Idea启动Spring Boot很慢的问题,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
spring boot创建项目包依赖问题的解决
本篇文章主要介绍了spring boot创建项目包依赖问题的解决,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
spring-session-issue:Spring-Session 的问题
Spring会议问题 Spring-Session 的问题 以下是重现它的方法: 导航到 spring-session-issue 文件夹并执行: mvn spring-boot:run 打开


