问题描述
- spring问题,急!!!Property 'sqlMapClient' is required
-
用Struts2+spring做项目时,在Tomcat上部署运行出现org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registerService' defined in file [C:Usersmacjeeworkspace.metadata.pluginsorg.eclipse.wst.server.core mp0wtpwebappsmywebWEB-INFclassesapplicationContent-service.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlMapClient' is required,求大神解答,很急,在线等
解决方案
这是Content-service.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="loginService" class="com.login.service.impl.LoginServiceImpl">
<property name="userDao">
<ref bean="userDao"/>
</property>
</bean>
<bean id="personService" class="com.login.service.impl.PersonServiceImpl">
<property name="personDao">
<ref bean="personDao"/>
</property>
</bean>
<bean id="registerService" class="com.login.service.impl.RegisterServiceImpl">
<property name="userDao">
<ref bean="userDao"/>
</property>
</bean>
解决方案二:
你的registerService的配置中没有sqlMapClient属性的配置,添加上试试。
解决方案三:
你看看你的sqlMapClient 配置好了没。
解决方案四:
Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
解决方案:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins
spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
时间: 2024-08-30 13:05:18