Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法转换JndiRmiProxyFactoryBean类型的值找不到匹配的编辑器或转换策略_Java_Spring_Hibernate_Spring Context - Fatal编程技术网

Java 无法转换JndiRmiProxyFactoryBean类型的值找不到匹配的编辑器或转换策略

Java 无法转换JndiRmiProxyFactoryBean类型的值找不到匹配的编辑器或转换策略,java,spring,hibernate,spring-context,Java,Spring,Hibernate,Spring Context,在我的项目中,我已经如下配置了Springbeans。(通过JNDI获取DataSource)。当我使用spring3.2.5和hibernate4时,下面的配置工作得很好 <bean id="dataSource" class="org.springframework.remoting.rmi.JndiRmiProxyFactoryBean"> <property name="jndiName" v

在我的项目中,我已经如下配置了Springbeans。(通过
JNDI
获取
DataSource
)。当我使用
spring3.2.5
hibernate4
时,下面的配置工作得很好

 <bean id="dataSource" class="org.springframework.remoting.rmi.JndiRmiProxyFactoryBean">
        <property name="jndiName" value="java:/jdbc/mydb"/>
        <property name="serviceInterface" value="javax.sql.DataSource"/>
 </bean>

 <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" scope="singleton">
        <property name="dataSource" ref="dataSource"/>
        <property name="packagesToScan" value="com.abc.core.system_configuration.implGeneral.bean.*"/>
        <property name="configLocations" value="implGeneral/sysConfigHibernate.cfg.xml"/>
    </bean>
为什么
org.springframework.remoting.rmi.jndrirmiproxyfactorybean
不能转换为
javax.sql.DataSource
。有人对此有想法吗

更新: 完整的错误日志如下所示

13:59:30,939 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; 
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleCacheControler' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Cannot resolve reference to bean 'ruleHibernatePersister' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleHibernatePersister' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Initialization of bean failed; 
nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.remoting.rmi.JndiRmiProxyFactoryBean' to required type 'javax.sql.DataSource' for property 'dataSource'; 
nested exception is java.lang.IllegalStateException: Cannot convert value of type 'org.springframework.remoting.rmi.JndiRmiProxyFactoryBean' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found

你能添加完整的堆栈跟踪吗。此外,升级还需要相当多的版本(4.0、4.1、4.2、4.3、5.0.5.1,范围相当大),因此您可能需要查看所有这些版本的升级说明,以了解发生了什么变化。@M.Deinum感谢您的回复。完整的日志被添加到问题中。应该没有任何东西阻止它工作(除非你忘记了我提到的一些东西)。另外,我强烈建议使用5.1.16作为最新的5.1版本。
13:59:30,939 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; 
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleCacheControler' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Cannot resolve reference to bean 'ruleHibernatePersister' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleHibernatePersister' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Cannot resolve reference to bean 'sessionFactory' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [implGeneral/spring-config-systemconfig.xml]: Initialization of bean failed; 
nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.remoting.rmi.JndiRmiProxyFactoryBean' to required type 'javax.sql.DataSource' for property 'dataSource'; 
nested exception is java.lang.IllegalStateException: Cannot convert value of type 'org.springframework.remoting.rmi.JndiRmiProxyFactoryBean' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found