[align=left][/align]当出现这个错误时应该就是你的bean.xml中的<property name="guohao"></property>
这个bean在相应的java类中没有set方法,这个在搭框架的时候特别容易犯错.
这里分析一下bean.xml
[/size][size=xx-small]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
>
<context:annotation-config/>
<bean id="mydataSource"class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL"/>
<property name="username" value="scott"/>
<property name="password" value="tiger"/>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="mydataSource"/>
<property name="mappingResources">
<list>
<value>com/guohao/rw/userpass/bean/UserInfor.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.OracleDialect
</value>
</property>
</bean>
<bean id="txManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="select*" read-only="true"/>
<tx:method name="get*" read-only="true"/>
<tx:method name="query*" read-only="true"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="busiServiceOperation" expression="execution(* com.guohao.rw.service..*.*(..)) "/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="busiServiceOperation"/>
</aop:config>
<bean id="userPassDao" class="com.guohao.rw.userpass.dao.UserPassDaoImpl" >
<property name="sessionFactory">
<ref bean="mySessionFactory" />
</property>
</bean>
<bean id="userPassService" class="com.guohao.rw.userpass.service.UserPassServiceImpl">
<property name="userPassDao">
<ref bean="userPassDao" />
</property>
</bean>
<bean id="userPass" class="com.guohao.rw.userpass.action" scope="prototype">
<property name="userPassService">
<ref bean="userPassService" />
</property>
</bean>
</beans>
这里面property 的name是不能变的,比如: bean id="mySessionFactory中property dataSource的name只能为dataSource ref后面的可以随便取
<bean id="txManager"中<property name="sessionFactory" ref="mySessionFactory"/>
name只能为sessionFactory,ref后面的可以随取
我下面有个搭好的架子 ,新手可以下下来看看
分享到:
相关推荐
之前上传的dubbo-admin 适用于jdk1.7 发现现在在 1.8的JDK上面跑出现了异常。现在解决后重新打包了一个完整的JDK1.8 的版本 。... Does the parameter type of the setter match the return type of the getter?
Does the parameter type of the setter match the return type of the getter? 这个问题我也在网上找了很久也没有好的解决方案,最后还是自己看源码看出问题,现在奉献出来。支持jdk8版本dubbo-admin,直接压缩放...
Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext ... Does the parameter type of the setter match the return type of the getter?
parameter type of the setter match the return type of the getter? 运行tomcat,然后访问tomcat根目录地址 (注意里面的WEB-INF/dubbo.properties中zookeeper的地址配置正确并且zookeeper服务正在运行) 默认...
Does the parameter type of the setter match the return type of the getter? 把其中的spring2的系列JAR包换成了spring3的,就可以在JDK8下正常运行了。 使用方法: 1. 删除tomcat webapps下面的ROOT目录 2. ...
配置proxool后,启动服务时报错的解决方法。 Invalid property 'houseKeepingSleepTime' of bean class [org.logicalcobwebs.proxool.... Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.... Does the parameter type of the setter match the return type of the getter?
java普通类编译成json但只是当前类的有getter、setter方法的版本
已经拥有一年经验的你真的了解get set方法吗?也许不!以前我以为都有上架项目,这都是太基础的东西,但今天我重新回头看了以前做的笔记,真的是书读百遍,其义自见。
eclipse中的setter与getter注释,实体的编写,在代码编写工程中能清晰了解此意
NULL 博文链接:https://lydawen.iteye.com/blog/501004
主要介绍了Vue getter setter,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
java 的eclipse或idea等 定义变量时 直接引入lombok.jar包 在类外部 引入@AllArgsConstructor @NoArgsConstructor @Data 简便方法引入getter/setter/tostring等方法
c++的成员变量的get和set生成器,简单易用。
如何使用它使用 getter/setter 方法创建对象 // Create an object with getter/setter methodvar obj = { name : new getterSetter ( 'John' )} ;// Access the property in read or write modeconsole . log ( obj ...
eclipse 自动为getter和setter添加中文注释 详细参见 http://blog.csdn.net/kongguoan/article/details/38293137
FastCoding是一个对Xcode所扩展的插件,主要是根据java的开发工具 eclipse 快速生成属性的getter ,setter 方法有感而发.出于兴趣开发本插件,目前主要功能是根据.h,.m文件声明的属性,自动生成get,set,lazy实例化方法
自动生成带注释的getter和setter方法(注释)插件