Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.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
Spring 需要关于JNDI连接问题的帮助吗_Spring_Apache Camel - Fatal编程技术网

Spring 需要关于JNDI连接问题的帮助吗

Spring 需要关于JNDI连接问题的帮助吗,spring,apache-camel,Spring,Apache Camel,正在尝试从应用程序连接两个JNDI, 代码如下 <?xml version="1.0" encoding="UTF-8"?> <bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent"> <property name="location" ref="osfCamelPropertyLocation" /> </bean&g

正在尝试从应用程序连接两个JNDI, 代码如下

<?xml version="1.0" encoding="UTF-8"?>

<bean id="properties"
    class="org.apache.camel.component.properties.PropertiesComponent">
    <property name="location" ref="osfCamelPropertyLocation" />
</bean>


<bean id="defaultPropertyFileLocation" class="java.lang.String">
    <constructor-arg value="classpath:spring-properties-configure.properties" />
</bean>
<!-- List of property files in defined order, alows multiple config files -->
<util:list id="propertyFileLocations">
    <value>#{defaultPropertyFileLocation}</value>
</util:list>


<beans profile="!test">
    <jee:jndi-lookup id="osfPropsCamel"
        jndi-name="properties/orderFulfillmentServiceCamel" expected-type="java.util.Properties" />
    <jee:jndi-lookup id="amqEnvProps" jndi-name="properties/AMQ"
        expected-type="java.util.Properties" />
    <!-- Allows mixing jndi and file properties in Camel context(s). The last 
        entry in the list takes precedennce, avoid spaces between entries -->
    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="properties" ref="osfPropsCamel" />
        <property name="ignoreUnresolvablePlaceholders" value="true" />
    </bean>

    <bean id="amqPropertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="properties" ref="amqEnvProps" />
    </bean>

    <bean name="prop"
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="propertiesArray">
            <list>
                <ref bean="osfPropsCamel" />
                <ref bean="amqEnvProps" />
            </list>
        </property>
    </bean>

    <bean id="bridgePropertyPlaceholder"
        class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
        <property name="properties" ref="prop" />
    </bean>

</beans>

<beans profile="test">
    <bean id="osfCamelPropertyLocation" class="java.lang.String">
        <constructor-arg value="#{defaultPropertyFileLocation}" />
    </bean>
    <bean id="propertyPlaceholderConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations" ref="osfCamelPropertyLocation" />
    </bean>
</beans>


</beans>
java.lang.IllegalArgumentException: Cannot convert value of type [javax.naming.Reference] to required type [java.util.Properties] for property 'properties': PropertyEditor [org.springframework.beans.propertyeditors.PropertiesEditor] returned inappropriate value of type [javax.naming.Reference]
[4/7/16 16:34:09:946 CDT] 00000050 SystemErr     R  at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:260)
[4/7/16 16:34:09:946 CDT] 00000050 SystemErr     R  at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)
[4/7/16 16:34:09:946 CDT] 00000050 SystemErr     R  ... 107 more