Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

achilles-junit(embedded cassandra) raises 2 exceptions during junit tests run #279

Open
vrudikov opened this issue Nov 22, 2016 · 11 comments

Comments

@vrudikov
Copy link

vrudikov commented Nov 22, 2016

Finished tests are marked with green in Intellij. So tests are ok. But the whole test can't finish and tries to reconnect

15:50:28.960 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.Host.STATES - [localhost/127.0.0.1:9276] marking host DOWN
15:50:28.964 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.ControlConnection - [Control connection] localhost/127.0.0.1:9276 is down/removed and it was the control host, triggering reconnect
15:50:28.991 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.AbstractReconnectionHandler - First reconnection scheduled in 0ms
15:50:28.992 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.Host.STATES - [Control connection] starting reconnection attempt
15:50:28.997 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.AbstractReconnectionHandler - First reconnection scheduled in 1000ms
15:50:28.998 [Achilles Embedded Cassandra Cluster-worker-4] DEBUG com.datastax.driver.core.Host.STATES - [localhost/127.0.0.1:9276] starting reconnection attempt
15:50:29.031 [Achilles Embedded Cassandra Cluster-reconnection-0] ERROR com.datastax.driver.core.ControlConnection - [Control connection] Cannot connect to any host, scheduling retry in 1000 milliseconds
15:50:29.031 [Achilles Embedded Cassandra Cluster-reconnection-0] DEBUG com.datastax.driver.core.Host.STATES - [Control connection] next reconnection attempt in 1000 ms

The first one is related to Sigar native library:

15:16:30.036 [pool-1-thread-1] INFO org.apache.cassandra.utils.SigarLibrary - Initializing SIGAR library
15:16:30.182 [pool-1-thread-1] DEBUG Sigar - no sigar-amd64-winnt.dll in java.library.path
org.hyperic.sigar.SigarException: no sigar-amd64-winnt.dll in java.library.path
	at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)
	at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)
	at org.apache.cassandra.utils.SigarLibrary.<init>(SigarLibrary.java:47)
	at org.apache.cassandra.utils.SigarLibrary.<clinit>(SigarLibrary.java:28)
	at org.apache.cassandra.service.StartupChecks$7.execute(StartupChecks.java:216)
	at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:112)
	at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:187)
	at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:585)
	at info.archinnov.achilles.embedded.ServerStarter.lambda$start$0(ServerStarter.java:164)
	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)

Solution:
I downloaded binary libs from here hyperic-sigar-1.6.4.zip.
Unpacked it to "root/sigar" folder and added system property initialization to the test to avoid this error

@BeforeClass
public static void init() {
    System.setProperty("org.hyperic.sigar.path", "C://sigar");
}

Anyway, this is not good, because test Another way is to try to include this library - sigar-native-deps but i can't get rid of the exception above. I think some configuration steps needed

The second one is related to datastax core:

14:12:13.977 [main] DEBUG com.datastax.driver.core.Native - Could not load JNR C Library, native system calls through this library will not be available
java.lang.UnsatisfiedLinkError: unknown
	at jnr.ffi.provider.jffi.NativeLibrary.loadNativeLibraries(NativeLibrary.java:87)
	at jnr.ffi.provider.jffi.NativeLibrary.getNativeLibraries(NativeLibrary.java:70)
	at jnr.ffi.provider.jffi.NativeLibrary.getSymbolAddress(NativeLibrary.java:49)
	at jnr.ffi.provider.jffi.NativeLibrary.findSymbolAddress(NativeLibrary.java:59)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:117)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
	at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:290)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
	at com.datastax.driver.core.Native$LibCLoader.<clinit>(Native.java:108)
	at com.datastax.driver.core.Native.isGettimeofdayAvailable(Native.java:190)
	at com.datastax.driver.core.ClockFactory.newInstance(Clock.java:51)
	at com.datastax.driver.core.AbstractMonotonicTimestampGenerator.<init>(AbstractMonotonicTimestampGenerator.java:43)
	at com.datastax.driver.core.LoggingMonotonicTimestampGenerator.<init>(LoggingMonotonicTimestampGenerator.java:49)
	at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.<init>(AtomicMonotonicTimestampGenerator.java:50)
	at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.<init>(AtomicMonotonicTimestampGenerator.java:37)
	at com.datastax.driver.core.policies.Policies.defaultTimestampGenerator(Policies.java:122)
	at com.datastax.driver.core.policies.Policies$Builder.build(Policies.java:287)
	at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1263)
	at com.datastax.driver.core.Cluster.<init>(Cluster.java:118)
	at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:183)
	at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1281)
	at info.archinnov.achilles.embedded.AchillesInitializer.createCluster(AchillesInitializer.java:117)
	at info.archinnov.achilles.embedded.AchillesInitializer.initializeCluster(AchillesInitializer.java:98)
	at info.archinnov.achilles.embedded.AchillesInitializer.initializeFromParameters(AchillesInitializer.java:58)
	at info.archinnov.achilles.embedded.CassandraEmbeddedServer.<init>(CassandraEmbeddedServer.java:64)
	at info.archinnov.achilles.embedded.CassandraEmbeddedServerBuilder.buildServer(CassandraEmbeddedServerBuilder.java:523)
	at info.archinnov.achilles.junit.AchillesTestResource.buildServer(AchillesTestResource.java:141)
	at info.archinnov.achilles.junit.AchillesTestResource.<init>(AchillesTestResource.java:118)
	at info.archinnov.achilles.junit.AchillesTestResourceBuilder.build(AchillesTestResourceBuilder.java:216)

But I found details on official Datastax Driver page. How about to mention that in Wiki? Also it will be cool to move achilles-junit configuration steps in the Wiki as separate page

@kadamvandita
Copy link

Any solution to this?

@vrudikov
Copy link
Author

  1. Sigar - no sigar-amd64-winnt.dll in java.library.path - stays the same
  2. Could not load JNR C Library, native system calls through this library will not be available
    Strange but i don't receive such message since that time

@ranjankumar03
Copy link

Any workaround of the mentioned issue.?

atastax.driver.core.Native:113 - Could not load JNR C Library, native system calls through this library will not be available
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
at jnr.ffi.provider.InvalidProvider$1.loadLibrary(InvalidProvider.java:48)
at jnr.ffi.LibraryLoader.load(LibraryLoader.java:290)
at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
at com.datastax.driver.core.Native$LibCLoader.(Native.java:108)
at com.datastax.driver.core.Native.isGettimeofdayAvailable(Native.java:190)
at com.datastax.driver.core.ClockFactory.newInstance(Clock.java:51)
at com.datastax.driver.core.AbstractMonotonicTimestampGenerator.(AbstractMonotonicTimestampGenerator.java:43)
at com.datastax.driver.core.LoggingMonotonicTimestampGenerator.(LoggingMonotonicTimestampGenerator.java:49)
at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.(AtomicMonotonicTimestampGenerator.java:50)
at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.(AtomicMonotonicTimestampGenerator.java:37)
at com.datastax.driver.core.policies.Policies.defaultTimestampGenerator(Policies.java:121)
at com.datastax.driver.core.policies.Policies$Builder.build(Policies.java:286)
at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1317)
at com.datastax.driver.core.Cluster.(Cluster.java:113)
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:178)
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1335)

@kadamvandita
Copy link

Need to increase wait time for Cassandra server in Achilles source code

@ranjankumar03
Copy link

Where to increase this wait time? @kadamvandita

@jgmatos
Copy link

jgmatos commented Sep 1, 2017

I have this problem for a long time now. Is this ever going to get solved?

@jgmatos
Copy link

jgmatos commented Sep 4, 2017

@ranjankumar03 I finally figured out a workaround (not a solution for the root cause, but a way to stop the exception from appearing in the logs): I answered it in here

@doanduyhai
Copy link
Owner

The Sigar-related exception does not prevent Achilles embedded to start correctly...

@jgmatos
Copy link

jgmatos commented Sep 4, 2017

@doanduyhai In my case Achilles works just fine, as I am able to perform my tests resorting to its mock services. Still, I was getting that exception in my logs.

@RaAleks
Copy link

RaAleks commented Aug 10, 2018

Hi, i have the same exception UnsatisfiedLinkError, any solution?

@doanduyhai
Copy link
Owner

Guys, I think your issue is related to the Datastax java driver, some more info here: https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/ONpgXJyqTu0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants