Flume twitter config error - flume

I am trying to extract twitter data using flume. but i am getting the following error
15/04/08 23:16:36 ERROR node.PollingPropertiesFileConfigurationProvider: Unhandled error
java.lang.NoSuchMethodError: twitter4j.conf.Configuration.isStallWarningsEnabled()Z
at twitter4j.TwitterStreamImpl.<init>(TwitterStreamImpl.java:60)
at twitter4j.TwitterStreamFactory.<clinit>(TwitterStreamFactory.java:40)
at com.cloudera.flume.source.TwitterSource.<init>(TwitterSource.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at java.lang.Class.newInstance(Class.java:433)
at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:42)
at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:327)
at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I have used the flume-sources-1.0-SNAPSHOT.jar from cloudera.The TwitterAgent runs with the above mentioned error.
Is there any work around for it?
Thanks in advance.

This is obviously a dependency error. the flume-sources library expects a version of Twitter4j that isn't present, hence the NoSuchMethod error. I would suggest that you pull the right versions, whihc would be
1.6.0-SNAPSHOT for twitter source and 3.0.3 for twitter4j. You should consult flume's pom.xml, which has all the version info you need.
It should be noted that you should use the most current version as possible, as old implementations will not work. Twitter broke their old APIs in the meantime.
Hope this helps.

This is an issue with fully qualified name of the Class in your Agent.conf file.
In the older versions, class name is: com.cloudera.flume.source.TwitterSource
In the latest version of the flume TwitterSource is already shipped and no need to download separately.
The class name is changed to org.apache.flume.source.twitter.TwitterSource
Please carefully change the class name, defitely It will work for you

Related

How do I fix this: "ClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder"?

I was trying to run my grails project which I upgraded to 2.4.4 from 2.3.5.
Now after trying to run it, I get these error:
|Running Grails application
context.GrailsContextLoaderListener Error initializing the application: org/codehaus/groovy/grails/commons/ConfigurationHolder
java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ConfigurationHolder
at grails.plugin.hibernate3.HibernatePluginSupport$__clinit__closure1.doCall(HibernatePluginSupport.groovy:129)
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:754)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:584)
at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:527)
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)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.commons.ConfigurationHolder
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
... 8 more
Error |
Forked Grails VM exited with error
Based on Grail's migration doc, it looks like they have remove ConfigurationHolder from 2.4.
You need to update the hibernate plugin.
From their doc:
Static Holder Classes The following deprecated classes have been
removed from Grails 2.4.x:
org.codehaus.groovy.grails.commons.ApplicationHolder
org.codehaus.groovy.grails.commons.ConfigurationHolder
org.codehaus.groovy.grails.plugins.PluginManagerHolder
org.codehaus.groovy.grails.web.context.ServletContextHolder
org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder
If you or any plugins you have installed are using these classes you
will get a compilation error. The problem can be rectified by updating
to new plugins and using grails.util.Holders instead.
If your application uses the jquery plugin you will need to update to
version 1.11.0.2 or later as previous versions of the plugin made use
of the ApplicationHolder class. If your application uses the resources
plugin you will need to update to version 1.2.7 or later as previous
versions of the plugin made use of the ConfigurationHolder class.
migration doc: http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom23.html
If you are using Eclipse, go to Java build path, Order and Export, tick all the libraries and then execute the application

Grails Reverse Engineer Database

I'm trying to evaluate Grails as a solution for an upcoming project. There is already a large database in use that won't be modified much if it all. I wan't to reverse engineer the database into GORM domain objects as a starting point.
I found one here http://www.grails.org/plugin/db-reverse-engineer. I got it installed and configured however when I run it I see the same error over and over. The stacktrace is below.
Can someone help me correct the error, or recommend another tool for reverse engineering to grails? I've used Netbeans in the past to reverse engineer databases to JPA entities that worked out pretty well. I'm hoping for something similar with Grails.
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction (NOTE: Stack trace has been filtered. Us
e --verbose to see entire trace.)
java.lang.NoClassDefFoundError: javax/transaction/Transaction
at grails.plugin.reveng.GrailsJdbcBinder.readDatabaseSchema(GrailsJdbcBinder.groovy:51)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:93)
at org.hibernate.cfg.JDBCBinder$readFromDatabase.call(Unknown Source)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration.readFromJDBC(GrailsJdbcMetaDataConfiguration.groovy:32)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration$readFromJDBC.call(Unknown Source)
at grails.plugin.reveng.Reenigne.buildConfiguration(Reenigne.groovy:114)
at grails.plugin.reveng.Reenigne.execute(Reenigne.groovy:60)
at grails.plugin.reveng.Reenigne$execute.call(Unknown Source)
at grails.plugin.reveng.RevengRunner.run(RevengRunner.groovy:81)
at grails.plugin.reveng.RevengRunner$run.call(Unknown Source)
at DbReverseEngineer$_run_closure1.doCall(DbReverseEngineer:36)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1
85)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.lang.ClassNotFoundException: javax.transaction.Transaction
... 29 more
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction
Actually this plugin is not compatible with Hibernate 4... yet. But since the last push was like ages ago, it doesn't look like that you will get a new version soon enough to work with it :)
However, you can still keep using this version of Grails and the db-reverse-engineer:0.5 plugin, by switching your Hibernate version, back to 3. And it is quite easy to do so !
In BuildConfig.groovy, comment the line
runtime ":hibernate4:4.X.X.X"
And add instead:
runtime ":hibernate:3.6.10.17"
(And btw, do not forget to add the correct connector to your database, I use myself this dependency:
compile 'mysql:mysql-connector-java:5.1.22'
)
Well, the plugin uses Hibernate Tools to do the reverse-engineering, so you could try just using those directly.
There is a new version which fixs many bugs such this :It is 0.5.1 insead of 0.5
BuildConfig.groovy
runtime ':db-reverse-engineer:0.5.1'
I too faced the same problem but I didn't switch to hibernate 3.x version the main problem is connector, un comment the mysql connector in BuildConfig.groovy
and I have added the javax.transaction jar in lib folder of grails application this solved the problem

Embedded neo4j with tinkerpop - Same Instance,Multiple access

I see that 'blueprints-neo4j-graph-2.5.0' is the latest released version to use tinkerpop blueprints api with neo4j graph which is version 1.9.6.
A few questions on this:
I understand that this neo4j instance will be an embedded database with community version. Is that right? If so, how do I switch to enterprise version?
I tried including this as gradle dependency: compile group: 'org.neo4j', name: 'neo4j-enterprise', version:'2.0.1'
But, I think 'blueprints-neo4j-graph-2.5.0' will get its own version(neo4j 1.9.6) as a dependency.
Is it possible to use neo4j webadmin console with the embedded version?
I tried changing the database location in neo4j.server.properties to the same location as given in the configuration for embedded instance, but I am not able to access them simultaneously.
I made this change in my build.gradle.
compile group: 'com.tinkerpop.blueprints', name: 'blueprints-neo4j2-graph', version:'2.5.0'
This picks up neo4j 2.0.1.
Also, I changed the tinkerpopConfig ( I am using GraphFactory to open and close the graph) as mentioned in tinkerpop sample to be:
"blueprints.neo4jha.directory" : "C:/data/my-test-model-graph",
"blueprints.graph" : "com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph",
"blueprints.neo4jha.conf.server_id" : "1",
"blueprints.neo4jha.conf.server" : "localhost:6364",
"blueprints.neo4jha.conf.cluster_server" : "localhost:5002",
"blueprints.neo4jha.conf.initial_hosts" : "localhost:5001,localhost:5002"
Now when I try to deploy, I get a null graph.
When you said, HA implementation requires Enterprise edition:
I also tried doing it this way,
compile(group: 'com.tinkerpop.blueprints', name: 'blueprints-neo4j2-graph', version:'2.5.0'){
exclude(module: 'neo4j')
exclude(module: 'neo4j-ha')
exclude(module: 'neo4j-management')
}
compile group: 'org.neo4j', name: 'neo4j-enterprise', version:'2.0.1'
which will get neo4j-enterprise-2.0.1.
But this also doesn't seem to work and is not able to open a graph instance.
Do you see anything odd here?
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph].
at com.tinkerpop.blueprints.GraphFactory.open(GraphFactory.java:50) ~[blueprints-core-2.5.0.jar:na]
at com.repo.GraphManager.getGraphDatabase(GraphManager.java:314) [com.repo~repo_module~1.0.0-SNAPSHOT/:na]
at com.repo.GraphManager.start(GraphManager.java:164) [com.repo~repo_module~1.0.0-SNAPSHOT/:na]
at org.vertx.java.platform.Verticle.start(Verticle.java:82) [vertx-platform-2.1M1.jar:na]
at com.englishtown.vertx.hk2.HK2VerticleLoader.start(HK2VerticleLoader.java:77) [com.englishtown~vertx-mod-hk2~1.6.0-SNAPSHOT/:na]
at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1551) [vertx-platform-2.1M1.jar:na]
at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176) [vertx-core-2.1M1.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_51]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_51]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_51]
at com.tinkerpop.blueprints.GraphFactory.open(GraphFactory.java:43) ~[blueprints-core-2.5.0.jar:na]
... 9 common frames omitted
Caused by: java.lang.NullPointerException: null
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124) ~[na:1.7.0_51]
at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:1162) ~[na:1.7.0_51]
at org.neo4j.kernel.configuration.Config.applyChanges(Config.java:122) ~[neo4j-kernel-2.0.1.jar:2.0.1]
at org.neo4j.kernel.configuration.Config.<init>(Config.java:88) ~[neo4j-kernel-2.0.1.jar:2.0.1]
at org.neo4j.kernel.InternalAbstractGraphDatabase.<init>(InternalAbstractGraphDatabase.java:278) ~[neo4j-kernel-2.0.1.jar:2.0.1]
at org.neo4j.kernel.ha.HighlyAvailableGraphDatabase.<init>(HighlyAvailableGraphDatabase.java:136) ~[neo4j-ha-2.0.1.jar:2.0.1]
at org.neo4j.graphdb.factory.HighlyAvailableGraphDatabaseFactory$1.newDatabase(HighlyAvailableGraphDatabaseFactory.java:47) ~[neo4j-ha-2.0.1.jar:2.0.1]
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:198) ~[neo4j-kernel-2.0.1.jar:2.0.1]
at com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph.<init>(Neo4j2HaGraph.java:23) ~[blueprints-neo4j2-graph-2.5.0.jar:na]
at com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph.<init>(Neo4j2HaGraph.java:31) ~[blueprints-neo4j2-graph-2.5.0.jar:na]
... 14 common frames omitted
If you want Neo4j 2.x then you need to use this dependency:
<dependency>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints-neo4j2-graph</artifactId>
<version>2.5.0</version>
</dependency>
As this version runs in embedded mode only one JVM process at a time can access the database, so you can't access a database via TinkerPop and have Neo4j Server running at the same time to get the Neo4j WebAdmin Console. If you want to run in that mode then you should use Neo4jHaGraph:
https://github.com/tinkerpop/blueprints/wiki/Neo4jHa-Implementation
which requires Enterprise Edition:
http://docs.neo4j.org/chunked/stable/ha-setup-tutorial.html
Neo4jHaGraph should also exist in the blueprints-neo4j2-graph packaging.

Flume fails on config file

I have some code I inherited and there is little documentation. The system keeps failing on various errors. It seems to me it is not reading the jar files and I am not even sure where it is looking. Here is the error below. Can anyone offer any advice?
- Creating instance of source Twitter, type uk.co.senym.flume.TweetDataSource
13 Dec 2013 15:29:55,923 ERROR [conf-file-poller-0](org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run:142) - Failed to load configuration data. Exception follows.
org.apache.flume.FlumeException: Unable to load source type: uk.co.senym.flume.TweetDataSource, class: uk.co.senym.flume.TweetDataSource
at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:67)
at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:40)
at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:327)
at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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:724)
Caused by: java.lang.ClassNotFoundException: uk.co.senym.flume.TweetDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:65)
... 11 more
If you're using a recent version of Flume then you should use the plugins.d directory.
I'll assume for the moment you are using a Bigtop-derived distribution such as Cloudera CDH4. Then you want to take a look # /etc/flume-ng/conf/flume-env.sh to see if they were customizing the Flume classpath to point to the jar file for your custom twitter source.
That is the old way and it kinda sucks. A better way is to put your stuff into plugins.d as documented here: http://archive.cloudera.com/cdh4/cdh/4/flume-ng/FlumeUserGuide.html#installing-third-party-plugins
I believe the default plugins.d directory on CDH4 is /var/lib/flume-ng/plugins.d
HTH

Opentaps ERP- ClassNotFoundException error during running

Hi I am new to openTaps ERP development just a day before I started it.I have install a previously done project in my eclips.When I run it it gives me following error.I dont understand that error.
what should be done?
(I am using Postgresql database in it)
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
at org.opentaps.foundation.infrastructure.Infrastructure.getSessionFactory(Infrastructure.java:120)
at org.opentaps.common.container.HibernateContainer.start(HibernateContainer.java:109)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:102)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:264)
at org.ofbiz.base.start.Start.startServer(Start.java:313)
at org.ofbiz.base.start.Start.start(Start.java:317)
at org.ofbiz.base.start.Start.main(Start.java:400)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
Anyone knows how to resolve it??
try to download http://www.slf4j.org/download.html and extract it to some folder, then add the jar file (slf4j-api-1.6.4.jar) to your project build path (http://www.cs.duke.edu/courses/cps004g/fall05/assign/final/addlibrary.html)
or http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29
, if another exception appeared related to (slf4j) , try to add all jar files in the (slf4j-1.6.4) folder.
It seems that there is problem in Ehcache jar file or configuration.
ensure that (ehcache-1.6.1.jar) in the build classpath, if not, try to download ehcache-1.6.1.jar.zip from http://www.java2s.com/Code/Jar/e/Downloadehcache161jar.htm then extract it and add it to the build path. or download the last version from http://ehcache.org/downloads/catalog ,
It seems also that opentaps ERP uses the hibernate library that uses the ehcache cache provider , but you have to configure it properly based on the version of hibernate and ehcache as mentioned here (https://forum.hibernate.org/viewtopic.php?f=1&t=1003897&view=previous)
or
http://forums.terracotta.org/forums/posts/list/4932.page
or
http://www.bonitasoft.org/forum/viewtopic.php?id=4783

Resources