微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Open quote is expected for attribute "{1}" associated with an element type "name".

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.xml.XmlBeanDeFinitionStoreException: Line 37 in XML document from URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain-1.0-SNAPSHOT.jar!/spring/base-orm.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an  element type  "name".



xml解析 属性必须用引号

class属性必须用引号。。

添上  <bean id="flMusicUserDBJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource"ref="flMusicUserDBDataSource" />
</bean>


有了之前的思路,这个轻而易举的就resolve

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.xml.XmlBeanDeFinitionStoreException: Line 54 in XML document from URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain-1.0-SNAPSHOT.jar!/spring/base-orm.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The end-tag for element type "bean" must end with a '>' delimiter.


需要一个结束的</bean>标签           delimiter(定界符)




2011-12-15 16:26:08|ERROR|main|org.springframework.web.context.ContextLoader  215|Context initialization Failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/UserInfoController.do' defined in file [E:\workspace\.Metadata\.plugins\org.eclipse.wst.server.core\tmp5\wtpwebapps\clm-webapp\WEB-INF\classes\spring\controller-inteface.xml]: Cannot resolve reference to bean 'userInfoService' while setting bean property 'userInfoService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoService' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-service.jar!/spring/clm-service.xml]: Cannot resolve reference to bean 'clmJdbcDao' while setting bean property 'clmJdbcDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clmJdbcDao' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-dao-jdbc.xml]: Cannot resolve reference to bean 'flMusicUserDBJdbcTemplate' while setting bean property 'flMusicUserDBJdbcTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flMusicUserDBJdbcTemplate' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-orm.xml]: Cannot resolve reference to bean 'flMusicUserDBDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'flMusicUserDBDataSource' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-orm.xml]; nested exception is java.lang.classNotFoundException: org.apache.commons.dbcp.BasicDataSource


 org.apache.commons.dbcp.BasicDataSource
这个没有引入这个包 
用proxool的DATASOURCE也可以 如果你要用DBCP的.那么你就要在clm_intf的要目录中的pom.xml中导入这个DBCP包.在网上查一下maven dbcp就能找到.

<bean id="flMusicUserDBDataSource" class="org.apache.commons.dbcp.BasicDataSource"   org.logicalcobwebs.proxool.ProxoolDataSource
destroy-method="close">
<property name="driverClassName">
<value>com.microsoft.sqlserver.jdbc.sqlServerDriver</value>
</property>
<property name="url">
<value>jdbc:sqlserver://192.168.0.108:1433;databasename=flMusicUserDB</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value>mmiku</value>
</property>
</bean>


2011-12-15 16:54:19|ERROR|main|org.springframework.web.context.ContextLoader  215|Context initialization Failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/UserInfoController.do' defined in file [E:\workspace\.Metadata\.plugins\org.eclipse.wst.server.core\tmp5\wtpwebapps\clm-webapp\WEB-INF\classes\spring\controller-inteface.xml]: Cannot resolve reference to bean 'userInfoService' while setting bean property 'userInfoService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoService' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-service.jar!/spring/clm-service.xml]: Cannot resolve reference to bean 'clmJdbcDao' while setting bean property 'clmJdbcDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clmJdbcDao' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-dao-jdbc.xml]: Cannot resolve reference to bean 'flMusicUserDBJdbcTemplate' while setting bean property 'flMusicUserDBJdbcTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flMusicUserDBJdbcTemplate' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-orm.xml]: Cannot resolve reference to bean 'flMusicUserDBDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flMusicUserDBDataSource' defined in URL [jar:file:/E:/workspace/.Metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps/clm-webapp/WEB-INF/lib/clm-domain.jar!/spring/base-orm.xml]: Initialization of bean Failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'driverClassName' of bean class [org.logicalcobwebs.proxool.ProxoolDataSource]: No property 'driverClassName' found

在改了DataSource后,它的属性也不跟之前的相同了,得将相应的属性也改过来.

<bean id="flMusicUserDBDataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource"> <property name="driver" value="com.microsoft.sqlserver.jdbc.sqlServerDriver"> </property> <property name="driverUrl" value="jdbc:sqlserver://192.168.0.108:1433;databasename=flMusicUserDB"> </property> <property name="user" value="sa"> </property> <property name="password" value="mmiku"> </property> </bean>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐