I am following the http://docs.aws.amazon.com/streams/latest/dev/learning-kinesis-module-one.html tutorial on Kinesis Streams.
I have created two packages, one with the Producer and one with the Consumer. I can correctly produce data and I can see from the metrics dashboard that the data is getting into the stream.
When I run my consumer, I am getting the following stack trace:
1246 [main] DEBUG com.amazonaws.services.kinesis.samples.stocktrades.processor.StockTradesProcessor - Caught throwable while processing data.
java.lang.NoClassDefFoundError: com/amazonaws/util/json/JSONObject
at com.amazonaws.services.kinesis.leases.impl.Lease.toString(Lease.java:229)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at com.amazonaws.services.kinesis.leases.impl.LeaseManager.createLeaseIfNotExists(LeaseManager.java:281)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncer.syncShardLeases(ShardSyncer.java:127)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncer.checkAndCreateLeasesForNewShards(ShardSyncer.java:88)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncTask.call(ShardSyncTask.java:68)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.MetricsCollectingTaskDecorator.call(MetricsCollectingTaskDecorator.java:49)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:395)
at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:330)
at com.amazonaws.services.kinesis.samples.stocktrades.processor.StockTradesProcessor.main(StockTradesProcessor.java:102)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.util.json.JSONObject
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)
... 11 more
I just got the same problem .
Just change the version of aws-sdk to 1.10.x. I used 1.10.7
May be you are working with aws-sdk version 1.11.x
Kinesis Client Library (KCL) not compatible with AWS Java SDK 1.11. You need to use 1.10.x.
This has been fixed in KCL 1.6.4. So, you can update KCL ( > 1.6.4) to work with SDK 1.11.x
https://github.com/awslabs/amazon-kinesis-client/pull/75
Related
For the current moment, this error occurred only once. Ignite starts with one node in server mode and about 30 in client mode.
In the server's log, I found this stack trace:
Failed to reinitialize local partitions (rebalancing will be stopped):
...
java.lang.NoClassDefFoundError: sun/nio/ch/Invoker$2
...
at sun.nio.ch.Invoker.invokeIndirectly(Unknown Source)
at sun.nio.ch.Invoker.invoke(Unknown Source)
at sun.nio.ch.Invoker.invoke(Unknown Source)
at sun.nio.ch.WindowsAsynchronousFileChannelImpl$ReadTask.run(Unknown Source)
at sun.nio.ch.WindowsAsynchronousFileChannelImpl.implRead(Unknown Source)
at sun.nio.ch.AsynchronousFileChannelImpl.read(Unknown Source)
at org.apache.ignite.internal.processors.cache.persistence.file.AsyncFileIO.read(AsyncFileIO.java:77)
at org.apache.ignite.internal.processors.cache.persistence.file.AbstractFileIO$1.run(AbstractFileIO.java:82)
I inspected the rt.jar the server is used and found this Invoker$2.
Also I found this sun.nio.ch.Invoker$2 in the list of loaded classes in Java VisualVM.
So I don't understand at all what's the problem.
I made my own java library which uses some external libearies such as HttpClient from Apache.
When I compile it and try to use it, I am getting this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
at main.Main.main(Main.java:14)
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity
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)
... 1 more
Even though all dependent libraries are included in my jar.
I did some research and it looks like it is an issue with a compiler version. My lib is compiled with Java 8 while Apache libs are compiled with an older version.
My question is, why there isn't any warning about possible issues with such library upon compilation?
And how could I find out with what version of Java was used to compile these libraries?
I'm trying to create a Java program that uses a Cassandra database.
I'm 'trying' to use Hector client but when I run I'm getting some errors. I have searched on the internet but could find a fix that worked for me (it's probably something obvious).
Libs I included in my build path:
hector
libthrift-0.9.1
slf4j-simple-1.75
Errors im getting:
[main] INFO me.prettyprint.cassandra.connection.CassandraHostRetryService - Downed Host Retry service started with queue size -1 and retry delay 10s
[main] INFO me.prettyprint.cassandra.service.JmxMonitor - Registering JMX me.prettyprint.cassandra.service_Test Cluster:ServiceType=hector,MonitorType=hector
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cassandra/thrift/InvalidRequestException
at me.prettyprint.cassandra.connection.factory.HThriftClientFactoryImpl.createClient(HThriftClientFactoryImpl.java:42)
at me.prettyprint.cassandra.connection.ConcurrentHClientPool.createClient(ConcurrentHClientPool.java:179)
at me.prettyprint.cassandra.connection.ConcurrentHClientPool.<init>(ConcurrentHClientPool.java:61)
at me.prettyprint.cassandra.connection.RoundRobinBalancingPolicy.createConnection(RoundRobinBalancingPolicy.java:68)
at me.prettyprint.cassandra.connection.HConnectionManager.<init>(HConnectionManager.java:56)
at me.prettyprint.cassandra.service.AbstractCluster.<init>(AbstractCluster.java:67)
at me.prettyprint.cassandra.service.ThriftCluster.<init>(ThriftCluster.java:21)
at me.prettyprint.hector.api.factory.HFactory.createCluster(HFactory.java:197)
at me.prettyprint.hector.api.factory.HFactory.getOrCreateCluster(HFactory.java:144)
at me.prettyprint.hector.api.factory.HFactory.getOrCreateCluster(HFactory.java:133)
at org.codox.lobbyserver.data.CassandraAccess.test(CassandraAccess.java:39)
at org.codox.lobbyserver.Server.main(Server.java:22)
Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.thrift.InvalidRequestException
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)
... 12 more
Any help is welcome, if you need more info tell me.
That class seems to be in the cassandra-thrift library which you can find here.
Okay, so I'm working on a java server for an Apps backend, it must be able to issue iOS push notifications as part of a larger code-base, so I used the JavaPNS library (v2.1.1), which was used(and worked) previously on the tomcat version of the server. I'm developing locally using Eclipse on Arch Linux.
I'm trying the simplest test possible for it:
try{
Push.alert("Hello", "cert.p12", "password", false, "<my iPods UDID>");
}catch(Exception e){
e.printStackTrace();
}
The result exception is:
Exception in thread "main" java.lang.NoClassDefFoundError:org/bouncycastle/jce/provider/BouncyCastleProvider
at javapns.notification.PushNotificationManager.initializeConnection(PushNotificationManager.java:107)
at javapns.Push.sendPayload(Push.java:171)
at javapns.Push.alert(Push.java:47)
at testIOS.main(testIOS.java:20)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 4 more
the cert file is in the local directory(there were no complaints about it loading), the password and the UDID are both correct. I've tried a few things(in vain probably), such as installing the unlimited policy JCE from oracle:
http://www.bouncycastle.org/wiki/display/JA1/Provider+Installation
But I really have no clue what's wrong, it just seems to be unable to find that class/library, but I really don't know how to fix it. Thanks in advance for any tips.
Do you've bcprov-jdk15-146.jar in your lib ?
If not, download jar from this link and place it in your lib.
Bouncy Castle
I downloaded luke-1.0.1.jar (Luke 1.0.1 binary without any dependencies) from http://code.google.com/p/luke/downloads/list.
And I have WinXP, with latest Java 6 downloaded from Oracle/Sun web site.
I run the command line: "java -jar luke-1.0.1.jar" and try to launch Luke, but I got following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.Analyzer
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)
Could not find the main class: org.getopt.luke.Luke. Program will exit.
Any clue, what shall I do? I totally have no knowledge of Java.
Thanks
Hardy
So Java complains that it cant find a dependency. Which is little surprise since you downloaded a binary without dependencies.
Download the binary with all the dependencies (try the "featured" one) and you should be good.
Use luke-all.jar instead,
http://code.google.com/p/luke/downloads/detail?name=lukeall-1.0.1.jar&can=2&q=
Luke is a tool for examining lucene indices. You need to combine it with Lucene. You can either download Lucene and add appropriare JAR files to the classpath, or download a fatter Luke binary that includes Lucene.