[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 >
<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 >
<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 >
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<tx:advice >
<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 />
<aop:advisor advice-ref="txAdvice" pointcut-ref="busiServiceOperation"/>
</aop:config>

<bean >
<property name="sessionFactory">
<ref bean="mySessionFactory" />
</property>
</bean>

<bean >
<property name="userPassDao">
<ref bean="userPassDao" />
</property>
</bean>

<bean >
<property name="userPassService">
<ref bean="userPassService" />
</property>
</bean>

</beans> 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-06-26
  • 2021-09-05
  • 2021-07-26
  • 2021-10-23
  • 2021-07-23
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-12-31
  • 2021-11-04
相关资源
相似解决方案