You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streams.apache.org by Renato Marroquín Mogrovejo <re...@gmail.com> on 2014/09/16 00:17:03 UTC

About RSS provider

Hi guys,

It's me again :)
So I am trying to create a simple example of using Streams but for
consuming RSS [1]. But I am getting this beautiful stack trace.
I know that the RSS doesn't have the changes that Steve has been making to
the other examples, and I thought it would be a good place for me to start
poking around and pushing some changes.
Thanks in advance!


Renato M.
[1]
https://github.com/renato2099/streams-rss/blob/master/src/main/java/org/apache/streams/examples/rss/RssTest.java


00:05:59.016 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder - Attaching
shutdown handler
00:05:59.030 [pool-3-thread-1] DEBUG
o.a.s.l.t.LocalStreamProcessMonitorThread - [monitor] Used Memory: 20.0 MB,
Max: 954.7 MB
00:05:59.044 [main] INFO  o.a.s.l.builders.LocalStreamBuilder - Started
stream with 2 components
00:05:59.067 [pool-2-thread-4] ERROR o.a.s.l.tasks.StreamsProviderTask -
Error in processing provider stream
java.lang.ClassCastException: java.util.concurrent.ConcurrentLinkedQueue
cannot be cast to org.apache.streams.core.StreamsResultSet
at
org.apache.streams.rss.provider.RssStreamProvider.readCurrent(RssStreamProvider.java:140)
~[classes/:na]
at
org.apache.streams.local.tasks.StreamsProviderTask.run(StreamsProviderTask.java:148)
~[streams-runtime-local-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0_67]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_67]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
00:05:59.067 [pool-2-thread-4] DEBUG o.a.s.l.tasks.StreamsProviderTask -
Complete Provider Task execution for RssStreamProvider
00:05:59.077 [pool-1-thread-2] INFO  o.a.s.rss.provider.RssEventProcessor -
Terminating!
00:05:59.475 [pool-1-thread-1] INFO  o.a.s.rss.provider.RssStreamProvider -
Connected: http://www.thelocal.ch/feeds/rss.php
java.lang.NullPointerException
at
org.apache.streams.rss.provider.RssStreamProviderTask.run(RssStreamProviderTask.java:62)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Re: About RSS provider

Posted by Ryan Ebanks <ry...@gmail.com>.
Renato,

I'll have to take a closer look at this.  I'll try to get back to you soon.

-Ryan

On Tue, Sep 16, 2014 at 12:09 PM, Renato Marroquín Mogrovejo <
renatoj.marroquin@gmail.com> wrote:

> Hi Ryan,
>
> Thanks for the response. I have created a pull request for it [1] but this
> doesn't solve the problem.
> I would love the create test cases for this as soon as I understand how it
> should work. I mean I don't know what is wrong because I can't make it to
> run in spite of the change.
> I have updated my original code as I figured out that I was passing wrong
> parameters to the processor, but no luck just yet.
> What I have noticed is that the RssConverter does not get called even
> though the provider gets feeds into its queue. Maybe I am missing the
> connection on how to pass the provider's queue into the converter? I have
> seen that the local runtime usually takes care of this. But an explanation
> would be great.
> Thanks Ryan!
>
>
> Renato M.
>
> [1] https://github.com/apache/incubator-streams/pull/84/files
>
> 2014-09-16 18:32 GMT+02:00 Ryan Ebanks <ry...@gmail.com>:
>
> > Hey Renato,
> >
> > It looks like you discovered a bug.  At line 140 in RssStreamProvider it
> is
> > attempting to cast a LinkedConcurrentQueue to a StreamsResult set.  If
> > you're looking to contribute this would be a great place to start.  I
> > created a ticket, https://issues.apache.org/jira/browse/STREAMS-173.
> >  Please create unit tests to prove you fixed the problem and issue a pull
> > request referencing this ticket number.
> >
> > I am hoping in the next 2 weeks to have some documentation up on the
> > website on how to get started contributing, and some user guides.  But
> > until then, don't hesitate to ask questions on the list serve.
> >
> > -Ryan Ebanks
> >
> > On Mon, Sep 15, 2014 at 5:17 PM, Renato Marroquín Mogrovejo <
> > renatoj.marroquin@gmail.com> wrote:
> >
> > > Hi guys,
> > >
> > > It's me again :)
> > > So I am trying to create a simple example of using Streams but for
> > > consuming RSS [1]. But I am getting this beautiful stack trace.
> > > I know that the RSS doesn't have the changes that Steve has been making
> > to
> > > the other examples, and I thought it would be a good place for me to
> > start
> > > poking around and pushing some changes.
> > > Thanks in advance!
> > >
> > >
> > > Renato M.
> > > [1]
> > >
> > >
> >
> https://github.com/renato2099/streams-rss/blob/master/src/main/java/org/apache/streams/examples/rss/RssTest.java
> > >
> > >
> > > 00:05:59.016 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder -
> Attaching
> > > shutdown handler
> > > 00:05:59.030 [pool-3-thread-1] DEBUG
> > > o.a.s.l.t.LocalStreamProcessMonitorThread - [monitor] Used Memory: 20.0
> > MB,
> > > Max: 954.7 MB
> > > 00:05:59.044 [main] INFO  o.a.s.l.builders.LocalStreamBuilder - Started
> > > stream with 2 components
> > > 00:05:59.067 [pool-2-thread-4] ERROR o.a.s.l.tasks.StreamsProviderTask
> -
> > > Error in processing provider stream
> > > java.lang.ClassCastException:
> java.util.concurrent.ConcurrentLinkedQueue
> > > cannot be cast to org.apache.streams.core.StreamsResultSet
> > > at
> > >
> > >
> >
> org.apache.streams.rss.provider.RssStreamProvider.readCurrent(RssStreamProvider.java:140)
> > > ~[classes/:na]
> > > at
> > >
> > >
> >
> org.apache.streams.local.tasks.StreamsProviderTask.run(StreamsProviderTask.java:148)
> > > ~[streams-runtime-local-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
> > > at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> > > [na:1.7.0_67]
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> [na:1.7.0_67]
> > > at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > > [na:1.7.0_67]
> > > at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > > [na:1.7.0_67]
> > > at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
> > > 00:05:59.067 [pool-2-thread-4] DEBUG o.a.s.l.tasks.StreamsProviderTask
> -
> > > Complete Provider Task execution for RssStreamProvider
> > > 00:05:59.077 [pool-1-thread-2] INFO
> > o.a.s.rss.provider.RssEventProcessor -
> > > Terminating!
> > > 00:05:59.475 [pool-1-thread-1] INFO
> > o.a.s.rss.provider.RssStreamProvider -
> > > Connected: http://www.thelocal.ch/feeds/rss.php
> > > java.lang.NullPointerException
> > > at
> > >
> > >
> >
> org.apache.streams.rss.provider.RssStreamProviderTask.run(RssStreamProviderTask.java:62)
> > > at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> > > at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > > at
> > >
> > >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > > at java.lang.Thread.run(Thread.java:745)
> > >
> >
>

Re: About RSS provider

Posted by Renato Marroquín Mogrovejo <re...@gmail.com>.
Hi Ryan,

Thanks for the response. I have created a pull request for it [1] but this
doesn't solve the problem.
I would love the create test cases for this as soon as I understand how it
should work. I mean I don't know what is wrong because I can't make it to
run in spite of the change.
I have updated my original code as I figured out that I was passing wrong
parameters to the processor, but no luck just yet.
What I have noticed is that the RssConverter does not get called even
though the provider gets feeds into its queue. Maybe I am missing the
connection on how to pass the provider's queue into the converter? I have
seen that the local runtime usually takes care of this. But an explanation
would be great.
Thanks Ryan!


Renato M.

[1] https://github.com/apache/incubator-streams/pull/84/files

2014-09-16 18:32 GMT+02:00 Ryan Ebanks <ry...@gmail.com>:

> Hey Renato,
>
> It looks like you discovered a bug.  At line 140 in RssStreamProvider it is
> attempting to cast a LinkedConcurrentQueue to a StreamsResult set.  If
> you're looking to contribute this would be a great place to start.  I
> created a ticket, https://issues.apache.org/jira/browse/STREAMS-173.
>  Please create unit tests to prove you fixed the problem and issue a pull
> request referencing this ticket number.
>
> I am hoping in the next 2 weeks to have some documentation up on the
> website on how to get started contributing, and some user guides.  But
> until then, don't hesitate to ask questions on the list serve.
>
> -Ryan Ebanks
>
> On Mon, Sep 15, 2014 at 5:17 PM, Renato Marroquín Mogrovejo <
> renatoj.marroquin@gmail.com> wrote:
>
> > Hi guys,
> >
> > It's me again :)
> > So I am trying to create a simple example of using Streams but for
> > consuming RSS [1]. But I am getting this beautiful stack trace.
> > I know that the RSS doesn't have the changes that Steve has been making
> to
> > the other examples, and I thought it would be a good place for me to
> start
> > poking around and pushing some changes.
> > Thanks in advance!
> >
> >
> > Renato M.
> > [1]
> >
> >
> https://github.com/renato2099/streams-rss/blob/master/src/main/java/org/apache/streams/examples/rss/RssTest.java
> >
> >
> > 00:05:59.016 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder - Attaching
> > shutdown handler
> > 00:05:59.030 [pool-3-thread-1] DEBUG
> > o.a.s.l.t.LocalStreamProcessMonitorThread - [monitor] Used Memory: 20.0
> MB,
> > Max: 954.7 MB
> > 00:05:59.044 [main] INFO  o.a.s.l.builders.LocalStreamBuilder - Started
> > stream with 2 components
> > 00:05:59.067 [pool-2-thread-4] ERROR o.a.s.l.tasks.StreamsProviderTask -
> > Error in processing provider stream
> > java.lang.ClassCastException: java.util.concurrent.ConcurrentLinkedQueue
> > cannot be cast to org.apache.streams.core.StreamsResultSet
> > at
> >
> >
> org.apache.streams.rss.provider.RssStreamProvider.readCurrent(RssStreamProvider.java:140)
> > ~[classes/:na]
> > at
> >
> >
> org.apache.streams.local.tasks.StreamsProviderTask.run(StreamsProviderTask.java:148)
> > ~[streams-runtime-local-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
> > at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> > [na:1.7.0_67]
> > at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_67]
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > [na:1.7.0_67]
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > [na:1.7.0_67]
> > at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
> > 00:05:59.067 [pool-2-thread-4] DEBUG o.a.s.l.tasks.StreamsProviderTask -
> > Complete Provider Task execution for RssStreamProvider
> > 00:05:59.077 [pool-1-thread-2] INFO
> o.a.s.rss.provider.RssEventProcessor -
> > Terminating!
> > 00:05:59.475 [pool-1-thread-1] INFO
> o.a.s.rss.provider.RssStreamProvider -
> > Connected: http://www.thelocal.ch/feeds/rss.php
> > java.lang.NullPointerException
> > at
> >
> >
> org.apache.streams.rss.provider.RssStreamProviderTask.run(RssStreamProviderTask.java:62)
> > at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> > at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > at java.lang.Thread.run(Thread.java:745)
> >
>

Re: About RSS provider

Posted by Ryan Ebanks <ry...@gmail.com>.
Hey Renato,

It looks like you discovered a bug.  At line 140 in RssStreamProvider it is
attempting to cast a LinkedConcurrentQueue to a StreamsResult set.  If
you're looking to contribute this would be a great place to start.  I
created a ticket, https://issues.apache.org/jira/browse/STREAMS-173.
 Please create unit tests to prove you fixed the problem and issue a pull
request referencing this ticket number.

I am hoping in the next 2 weeks to have some documentation up on the
website on how to get started contributing, and some user guides.  But
until then, don't hesitate to ask questions on the list serve.

-Ryan Ebanks

On Mon, Sep 15, 2014 at 5:17 PM, Renato Marroquín Mogrovejo <
renatoj.marroquin@gmail.com> wrote:

> Hi guys,
>
> It's me again :)
> So I am trying to create a simple example of using Streams but for
> consuming RSS [1]. But I am getting this beautiful stack trace.
> I know that the RSS doesn't have the changes that Steve has been making to
> the other examples, and I thought it would be a good place for me to start
> poking around and pushing some changes.
> Thanks in advance!
>
>
> Renato M.
> [1]
>
> https://github.com/renato2099/streams-rss/blob/master/src/main/java/org/apache/streams/examples/rss/RssTest.java
>
>
> 00:05:59.016 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder - Attaching
> shutdown handler
> 00:05:59.030 [pool-3-thread-1] DEBUG
> o.a.s.l.t.LocalStreamProcessMonitorThread - [monitor] Used Memory: 20.0 MB,
> Max: 954.7 MB
> 00:05:59.044 [main] INFO  o.a.s.l.builders.LocalStreamBuilder - Started
> stream with 2 components
> 00:05:59.067 [pool-2-thread-4] ERROR o.a.s.l.tasks.StreamsProviderTask -
> Error in processing provider stream
> java.lang.ClassCastException: java.util.concurrent.ConcurrentLinkedQueue
> cannot be cast to org.apache.streams.core.StreamsResultSet
> at
>
> org.apache.streams.rss.provider.RssStreamProvider.readCurrent(RssStreamProvider.java:140)
> ~[classes/:na]
> at
>
> org.apache.streams.local.tasks.StreamsProviderTask.run(StreamsProviderTask.java:148)
> ~[streams-runtime-local-0.1-SNAPSHOT.jar:0.1-SNAPSHOT]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [na:1.7.0_67]
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_67]
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [na:1.7.0_67]
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [na:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
> 00:05:59.067 [pool-2-thread-4] DEBUG o.a.s.l.tasks.StreamsProviderTask -
> Complete Provider Task execution for RssStreamProvider
> 00:05:59.077 [pool-1-thread-2] INFO  o.a.s.rss.provider.RssEventProcessor -
> Terminating!
> 00:05:59.475 [pool-1-thread-1] INFO  o.a.s.rss.provider.RssStreamProvider -
> Connected: http://www.thelocal.ch/feeds/rss.php
> java.lang.NullPointerException
> at
>
> org.apache.streams.rss.provider.RssStreamProviderTask.run(RssStreamProviderTask.java:62)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
>