streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblackmon <>
Subject Re: provider.prepare(null) kicks NullPointerException
Date Thu, 03 Nov 2016 15:40:32 GMT

klass is a paradigm we used to use to allow the stream builder to tell the provider what type
of (JVM) Object document to produce.  

In this case, the provider always produces documents of org.apache.streams.facebook.Post
Yet the klass option hasn’t been fully removed.  

You’re probably fine to give it classOf[String] or classOf[org.apache.streams.facebook.Post]
or literally anything aside from null  

However, this provider doesn’t have any integration tests, so there’s no way to be sure
whether or not it still works.  

The place to start with facebook is - create
app/credentials for yourself and confirm these endpoints return data:  

GET /v2.8/me  
GET /v2.8/me/friends
GET /v2.8/me/feed

That last one is what org.apache.streams.facebook.provider.FacebookFriendFeedProvider uses. 

Good luck  

P.S. App tokens generated in graph explorer time out really fast.  You’ll have to do a
real oauth handshake to create tokens that last more than a day.

On November 3, 2016 at 8:33:49 AM, Trevor Grant (

> Sorry,
> would normally put this on user@ but we don't seem to have one yet.
> creating a facebook provider.
> The following code give a NullPointerException
> ```scala
> import org.apache.streams.facebook.FacebookUserstreamConfiguration
> import org.apache.streams.facebook.provider.FacebookFriendFeedProvider
> val typesafe = ConfigFactory.parseString(credentials)
> val config = new
> ComponentConfigurator(classOf[FacebookUserstreamConfiguration]).detectConfiguration(typesafe,
> "facebook");
> val provider = new FacebookFriendFeedProvider(config);
> provider.prepare(null)
> ```
> java.lang.NullPointerException
> at
> at
> org.apache.streams.facebook.provider.FacebookFriendFeedProvider.prepare(
> Upon examining the source:
> It seems we have some Class klass
> So after groking the code for a while this morning- I can't for the life of
> me figure out what Class klass is even supposed to do (other than jam me
> up).
> Can someone please help / explain what and where I have gone wrong?
> tg
> Trevor Grant
> Data Scientist
> *"Fortunate is he, who is able to know the causes of things." -Virgil*

View raw message