how do I integrate hosebird client library to a Grails project? - grails

My goal is to use the hosebird client provided by Twitter to stream tweets in my Grails project.
I'm really not sure how I will approach this, but I first tried including it in the dependencies in my BuildConfig.groovy like this:
dependencies {
compile 'com.twitter:hbc-core:2.2.0'
}
And then, when I tried to mimic the example code, FilterStreamExample.java, in my TwitterService.groovy, GGTS (the IDE) just shows me errors as I write these lines of code:
import com.google.common.collect.Lists
import com.twitter.hbc.ClientBuilder
import com.twitter.hbc.core.Client
import com.twitter.hbc.core.Constants
import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint
import com.twitter.hbc.core.processor.StringDelimitedProcessor
import com.twitter.hbc.httpclient.auth.Authentication
import com.twitter.hbc.httpclient.auth.OAuth1
Obviously, this makes me unable to run the code because of the compile time error. It just tells that the error is something "Groovy was unable to resolve".
Can you tell what am I missing?
Is it just a groovy syntax error that I'm not noticing? I'm new to Groovy so please bear with me.
OR
Is the problem here is in the inclusion of the library in the dependencies?
My first aim is to be able to use the library this way as I have told it above (the BuildConfig way) before trying to make jars and put it in the src/java. Who knows, the compile time error will appear too. I just want to know if the current obstacle in the approach I did is easy to fix.

GGTS and STS don't parse BuildConfig.groovy - they get all classpath information from Grails. When you update BuildConfig.groovy with a new plugin or jar dependency, right-click on the project node in the tree on the left and select Grails Tools | Refresh Dependencies and GGTS will rebuild its classpath based on the current state of the app.

Related

kotlin native cannot import khttp

I'm having a problem with usage of khttp library (which is supposed to work in Kotlin and provides equal to python's request's library features)
My build.gradle contains those strings:
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "com.github.jkcclemens:khttp:-SNAPSHOT"
}
Project builds with success, but importing with import khttp doesn't work
In general, I'm using kotlin as framework to IOS project, and khttp is needed to connect to longpoll server. If khttp isn't supposed to work in my case so what are my options? Using it's sources aint good idea i think
Try using this:
compile "com.github.jkcclemens:khttp:0.1.0"
And add https://jitpack.io/ as a repository
I know that I might be necrobumping, but if anyone is looking for an answer, they wouldn't be able to get it from the above.
Khttp library is build for kotlin JVM and not native. If you take a look at the source code, you'll be able to notice that it's using Java's libraries for it to function, this for example.
That means that sadly you can't run it on iOS and any platform that doesn't run JVM, as khttp will only run on the JVM platform and won't be able to run on native because of missing libraries.

BUILD FAILED : a module is not authorized to depend on itself: com.vaadin.external.atmosphere#atmosphere-compat-jbossweb;2.0.1-vaadin1

my project is VaadinFramework based project.I was run build.xml file through jenkins.
i struck with error like this.
/build.xml:28: impossible to resolve dependencies:
java.lang.IllegalArgumentException: a module is not authorized to depend on itself: com.vaadin.external.atmosphere#atmosphere-compat-jbossweb;2.0.1-vaadin1,
if you know the answer please help me out
the above three addons i was added in ivy.xml file.my problem was salved.
Becouse my project is vaadin based project.so it using vaadin dependencies in compile and runtime.
anyhow im also looking otherways to soughtout this problem inspite of addons.

"Groovy:unable to resolve class ..." (import error in LoginController.groovy)

I am trying to use the ":spring-security-core:2.0-RC2" (using Grails version 2.3.1), but have my own LoginController.groovy. Following Burt's notes (here and here), I copied the LoginController.groovy from the original location at "myapp\target\work\plugins\spring-security-core-2.0-RC2\grails-app\controllers\grails\plugin\springsecurity" to my project location at "myapp\grails-app\controllers\com\company". Now I get a bunch of import error messages like "Groovy:unable to resolve class ..." (I have attached am image below showing all the imports giving errors). How do I take care of these errors?
Sorry if this is a trivial question (still getting used to Grails), and thank you for the help!
It looks like GGTS/STS isn't entirely aware that the plugin is installed, since those classes are from the two jars that the plugin depends on. Try right-clicking the project node in the tree and running Grails Tools > Refresh Dependencies. If that's not enough, run Project | Clean to force a full recompile.

InvientCharts Vaadin not working

I am working with Vaadin 6 and want to use InvientCharts because it is free.
After compiling the widgetset, all vaadins component instead of invientCharts are working. The error which appears as text on my app is the following:
After trying everything, including setting up a complete new project, I followed this tutorial: http://www.nightswatch.de/?x=entry:entry120125-234412
But it is still not working and shows the same error.
Has anyone an idea what is going on here?
Thanks in advance!
When you receive the message that the widgetset does not contain implementation of XY,
then usually you have forgotten to compile it with the additional jar files or you did not specify the new widgetset.
The nightswatch example is incomplete, you need to compile the widgetset.
Simplest would be to use the maven build script to build all dependencies and compile stuff as needed (or use eclipse for this)

TimeSeries Forecasting in Java

I'm trying to run TimeseriesExample code for forecasting(predicting) future 6-months data by giving 2-months data in Java. I need to use WekaForecaster object. But I'm unable to import these two files:
import weka.classifiers.timeseries.WekaForecaster;
import weka.classifiers.timeseries.core.TSLagMaker;
Both of these showing error. I have imported following jar files:
weka.jar,
pdm-timeseriesforecasting-ce-TRUNK-SNAPSHOT.jar,
jcommon-1.0.14.jar ,
jfreechart-1.0.13.jar
But still above files not importing, which jar I'm missing?
You have to install first the timeseriesForecasting package before use it in your code.
The package(jar file) can be found in wekafiles folder in your user folder.
You must to use the Package Manager to do it.
Best,
Use the "package manager" (weka >=3.7) and install the timeSeries plugin. then add the weka-37.jar to your build path. Here some information about the plugin.
Weka TimeSeries plugin
By the way, I think that 2 month data is not enough to forecast 6 months.

Resources