On Tue, Jul 14, 2009 at 9:50 AM, Claus Ibsen<[email protected]> wrote:
> On Tue, Jul 14, 2009 at 9:17 AM, Charles Moulliard<[email protected]> 
> wrote:
>> The syntax copied in the post was not correct. Here is the correct url used
>> which is not HTTP :
>>
>> stream:uri?file:///d:/temp/data/log/quickfix.log&scanStream=true
>>
> Your uri is wrong. The URI parameters is not valid, its not 
> key=value&key=value.
>
> You miss the key for filename:
> fileName=
>
> stream:uri?fileName=/d:/temp/data/log/quickfix.log&scanStream=true
>

I have fixed the NPE but I wonder whether Camel should parse this URI
and indicate that its invalid as such since the key=value was wrong.
However the java.net.URI did not indicate it was invalid.


>> ;-)
>>
>>
>> On Tue, Jul 14, 2009 at 8:07 AM, Claus Ibsen <[email protected]> wrote:
>>
>>> Hi Charles
>>>
>>> You gotta look in the stacktrace. There is a NPE.
>>> And your URI looks odd to me as you specify file but enter http
>>> instead. file is a file that uses java.io.File to read it.
>>>
>>>
>>>
>>> On Mon, Jul 13, 2009 at 5:35 PM, Charles Moulliard<[email protected]>
>>> wrote:
>>> > Hi,
>>> >
>>> > I try to use the following syntax for camel stream :
>>> >
>>> > stream:uri?file:/:/
>>> > <http://www.mibbit.com/chat/#
>>> >//xxx/yyy/file.txt&scanStream=true&scanStreamDelay=100"
>>> >
>>> >
>>> > but in response, I receive the following error :
>>> >
>>> > Caused by: org.springframework.beans.factory.BeanCreationException: Error
>>> > creating bean with name 'quickFixStreamEndpoint': FactoryBean threw
>>> > exception on object creation; nested exception is
>>> > org.apache.camel.ResolveEndpointFailedException: Failed to resolve
>>> endpoint:
>>> > stream:uri?file:///d:/temp/data/log/quickfix.log&scanStream=true due to:
>>> > null
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127)
>>> >    at java.security.AccessController.doPrivileged(Native Method)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:98)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
>>> >    at
>>> >
>>> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:884)
>>> >    at
>>> >
>>> org.apache.camel.spring.spi.ApplicationContextRegistry.lookup(ApplicationContextRegistry.java:41)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultRouteContext.lookup(DefaultRouteContext.java:120)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
>>> >    at
>>> >
>>> org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:70)
>>> >    at
>>> >
>>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:287)
>>> >    at
>>> >
>>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:120)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:564)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:988)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:965)
>>> >    at
>>> >
>>> org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:165)
>>> >    at
>>> >
>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:160)
>>> >    at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:875)
>>> >    at
>>> >
>>> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:99)
>>> >    at
>>> >
>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:119)
>>> >    ... 12 more
>>> > Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
>>> > resolve endpoint:
>>> > stream:uri?file:///d:/temp/data/log/quickfix.log&scanStream=true due to:
>>> > null
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:367)
>>> >    at
>>> >
>>> org.apache.camel.spring.CamelEndpointFactoryBean.createEndpoint(CamelEndpointFactoryBean.java:108)
>>> >    at
>>> >
>>> org.apache.camel.spring.CamelEndpointFactoryBean.getObject(CamelEndpointFactoryBean.java:54)
>>> >    at
>>> >
>>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121)
>>> >    ... 36 more
>>> > Caused by: java.lang.NullPointerException
>>> >    at java.net.URLEncoder.encode(URLEncoder.java:188)
>>> >    at
>>> > org.apache.camel.util.URISupport.createQueryString(URISupport.java:290)
>>> >    at org.apache.camel.util.URISupport.normalizeUri(URISupport.java:385)
>>> >    at
>>> >
>>> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:365)
>>> >
>>> > What is wrong in my syntax ?
>>> >
>>> > Regards,
>>> >
>>> > Charles Moulliard
>>> > Senior Enterprise Architect
>>> > Apache Camel Committer
>>> >
>>> > *****************************
>>> > blog : http://cmoulliard.blogspot.com
>>> >
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to