2014-03-28 3 views
1

나는 동적으로 다음 코드를 사용하여 HTTP 아웃 바운드 주소를 설정하려고 -뮬 동적 HTTP 아웃 바운드 주소

<flow name="dynamic-http-address" doc:name="dynamic-http-address" processingStrategy="synchronous"> 
    <http:inbound-endpoint exchange-pattern="request-response" 
     host="localhost" port="8081" doc:name="HTTP" /> 
    <logger level="INFO" doc:name="Logger" /> 
    <set-variable variableName="address" value="http://www.google.com/" 
     doc:name="Variable" /> 
    <http:outbound-endpoint address="#[address]" 
     method="GET" doc:name="HTTP" /> 
</flow> 

그러나, 나는 그것을 시작하는 데 실패하고 다음과 같은 예외를 throw 응용 프로그램을 시작할 때 -

PropertyAccessException 1: 
org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// 
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1145) 
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902) 
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75) 
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353) 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) 
    at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89) 
    at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109) 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:119) 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46) 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78) 
    at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) 
    at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46) 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78) 
    at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84) 
    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:207) 
    at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64) 
    at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47) 
    at org.mule.tooling.server.application.ApplicationDeployer.run(ApplicationDeployer.java:58) 
    at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:91) 
Caused by: java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// 
    at org.mule.endpoint.URIBuilder.assertProtocolConsistent(URIBuilder.java:388) 
    at org.mule.endpoint.URIBuilder.assertAddressConsistent(URIBuilder.java:380) 
    at org.mule.endpoint.URIBuilder.setProtocol(URIBuilder.java:180) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1132) 
    ... 44 more 
INFO 2014-03-27 23:06:46,958 [main] org.mule.module.launcher.application.DefaultMuleApplication: App 'test' never started, nothing to dispose of 
Exception in thread "main" org.mule.module.launcher.DeploymentInitException: PropertyBatchUpdateException: Failed properties: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// 
    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:219) 
    at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64) 
    at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47) 
    at org.mule.tooling.server.application.ApplicationDeployer.run(ApplicationDeployer.java:58) 
    at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:91) 
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'dynamic-http-address': Cannot create inner bean '(inner bean)' of type [org.mule.config.spring.factories.OutboundEndpointFactoryBean] while setting bean property 'messageProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.mule.endpoint.URIBuilder] while setting bean property 'URIBuilder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: 
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52) 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78) 
    at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84) 
    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:207) 
    ... 4 more 
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'dynamic-http-address': Cannot create inner bean '(inner bean)' of type [org.mule.config.spring.factories.OutboundEndpointFactoryBean] while setting bean property 'messageProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.mule.endpoint.URIBuilder] while setting bean property 'URIBuilder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: 
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// (org.mule.api.lifecycle.InitialisationException) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52) 
    at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78) 
    at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) 
    at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46) 
    ... 7 more 
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name 'dynamic-http-address': Cannot create inner bean '(inner bean)' of type [org.mule.config.spring.factories.OutboundEndpointFactoryBean] while setting bean property 'messageProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.mule.endpoint.URIBuilder] while setting bean property 'URIBuilder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: 
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[address]' for protocol 'http' should start with http:// 
    at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:117) 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:119) 
    at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73) 
    at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46) 

왜 Mule에서 동적 주소를 http : //로 시작하게할까요?

답변

3

Mule의 URIBuilder 클래스는 엔드 포인트 주소가 항상 엔드 포인트에 대한 프로토콜과 일관성이 있다고 주장합니다. 믹싱 프로토콜이 어쨌든 작동하지 않으므로 이는 의미가 있습니다. address="http://#[address]"을 사용하십시오.

+0

고마워요! 주소 = "http : // # [주소]"로 작동합니다 ... 그러나 주소가 HTTP 또는 HTTPS가 될지 확실하지 않습니다. 그래서, 나는 HTTP와 HTTPS에 대한 별도의 하위 흐름을 생성하고 적절한 하위 흐름에 경로를 선택 라우터를 만들었습니다 ... 지금은 별도의 질문을 만들었습니다 새로운 문제가 http://stackoverflow.com/questions/ 22702325/mule-flow-with-jms-connector-threads-in-dynamic-outbound-endpoint – user1493140

관련 문제