zoukankan      html  css  js  c++  java
  • Does the parameter type of the setter match the return type of the getter?

    [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> 
  • 相关阅读:
    Centos 下安装php
    php 基础 PHP保留两位小数的几种方法
    php基础 php 全局变量
    php 基础 语句include和require的区别是什么?为避免多次包含同一文件,可用(?)语句代替它们?
    php 基础 获取远程连接
    php 基础 php获取前一天,前一个月,前一年的时间
    redis 基础 Redis 数据类型
    [Poj2349]Arctic Network(二分,最小生成树)
    [USACO07DEC]Sightseeing Cows(负环,0/1分数规划)
    [Tyvj2032]升降梯上(最短路)
  • 原文地址:https://www.cnblogs.com/bjanzhuo/p/3575950.html
Copyright © 2011-2022 走看看