有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

春爪哇。lang.IllegalStateException:未找到匹配的编辑器或转换策略

所以我正在构建一个spring 3.2.3。发布/休眠4.0.1。最后一次申请,我得到了以下例外

[2017-03-22 09:29:47,860] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory [localhost-startStop-1] Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginService' defined in URL [jar:file:/D:/Programmes/apache-tomcat-7.0.33/webapps/perWeb/WEB-INF/lib/perService-2.0.jar!/applicationContext-transactional-service.xml]: Cannot resolve reference to bean 'loginServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginServiceImpl' defined in URL [jar:file:/D:/Programmes/apache-tomcat-7.0.33/webapps/perWeb/WEB-INF/lib/perService-2.0.jar!/applicationContext-simple-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'ma.dao.impl.GenericDAO' to required type 'ma.dao.IGenericDAO' for property 'dao'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [ma.dao.impl.GenericDAO] to required type [ma.dao.IGenericDAO] for property 'dao': no matching editors or conversion strategy found

这是我的豆子:登录服务

<bean id="loginService"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager">
            <ref bean="transactionManagerPER" />
        </property>
        <property name="target">
            <ref bean="loginServiceImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="loadUserByUsername">
                    PROPAGATION_REQUIRED,-Exception
                </prop>
            </props>
        </property>
    </bean>

loginServiceImpl

<bean id="loginServiceImpl"
          class="ma.service.login.LoginService">
        <property name="dao">
            <ref bean="userDAO" />
        </property>
    </bean>

用户道

<bean id="userDAO"
        class="ma.dao.impl.GenericDAO">
        <constructor-arg>
            <value>
                ma.dao.mappings.Utilisateur
            </value>
        </constructor-arg>
        <property name="sessionFactory">
            <ref bean="sessionFactoryPER" />
        </property>
    </bean>

利用者。爪哇

@Entity
@NamedQueries(
        {
            @NamedQuery(name="findUtilisateurByName", 
                    query = "select user from Utilisateur user where user.login=:userName"
                    ) 
        }
)
public class Utilisateur implements java.io.Serializable {

    private static final long serialVersionUID = 7214071893495381842L;
    private Integer id;
    private Profil  profil;
    private String  nom;
    private String  prenom;
    private String  login;
    private String  passwd;

    public Utilisateur() {
    }

    public Utilisateur(Integer id) {
        this.id = id;
    }

    @Id @GeneratedValue
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne
    public Profil getProfil() {
        return profil;
    }

    public void setProfil(Profil profil) {
        this.profil = profil;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }
}

我错过什么了吗? 如果你需要更多信息,请告诉我


共 (1) 个答案