cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques-Henri Berthemet <jacques-henri.berthe...@genesys.com>
Subject RE: ClassNotFoundException when trigger is fired
Date Thu, 07 Dec 2017 07:55:56 GMT
Hi,

I have a custom secondary index that works well with Cassandra, I put the jar file in Cassandra's
lib folder before starting Cassandra, maybe you can try to do the same thing?

I don't think that Cassandra's class loader is dynamic, you need to have your jars in the
classpath before starting Cassandra.

Regards,
--
Jacques-Henri Berthemet

From: Tsubasa.Narita@us.fujitsu.com [mailto:Tsubasa.Narita@us.fujitsu.com]
Sent: mercredi 6 d├ęcembre 2017 19:49
To: user@cassandra.apache.org
Subject: ClassNotFoundException when trigger is fired

Dear All

I use cassandra trigger to detect data change in DB and usually it works.
But sometime I get ClassNotFoundException when trigger is fired.

Following is what I did
1. create class which implement ITrigger interface. ex)class name is TestTrigger.java
2. create jar file and put it under conf/triggers ex)jar file name is TestTrigger.jar
3. start cassandra
4. I can find following log. Looks like jar file is loaded successfully
INFO  [OptionalTasks:1] 2017-11-30 03:55:43,541 CustomClassLoader.java:87 - Loading new jar
/home/tnarita/cassandra/conf/triggers/TestTrigger.jar
5. login cql and create trigger for test table.
6. insert value into test table
7. trigger is fired.
8. I got ClassNotFoundException. following is the log

java.lang.RuntimeException: Exception while executing trigger on table with ID: 1cb6a5a0-cb00-11e7-a737-49047aea57a8
                at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:241)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.triggers.TriggerExecutor.execute(TriggerExecutor.java:119)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:823)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:431)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:417)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:188)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:219)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:204)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:513)
[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:407)
[apache-cassandra-3.9.jar:3.9]
                at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.39.Final.jar:4.0.39.Final]
                at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
[netty-all-4.0.39.Final.jar:4.0.39.Final]
                at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35)
[netty-all-4.0.39.Final.jar:4.0.39.Final]
                at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:357)
[netty-all-4.0.39.Final.jar:4.0.39.Final]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[na:1.8.0_66]
                at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [apache-cassandra-3.9.jar:3.9]
                at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]
Caused by: java.lang.ClassNotFoundException: com.test.TestTrigger
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_66]
                at org.apache.cassandra.triggers.CustomClassLoader.loadClassInternal(CustomClassLoader.java:118)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.triggers.CustomClassLoader.loadClass(CustomClassLoader.java:103)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.triggers.TriggerExecutor.loadTriggerInstance(TriggerExecutor.java:254)
~[apache-cassandra-3.9.jar:3.9]
                at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:226)
~[apache-cassandra-3.9.jar:3.9]
                ... 18 common frames omitted


When I get this issue, restarting cassandra resolve this issue.
TestTrigger.java output dummy log in static initializer. When I don't get this issue, I can
find dummy log after Step4.
But when I get this issue, I can't find it.
I checked system.log and debug.log but there weren't any error log which indicate jar loading
failure.

I would like to know whether this is known issue or not.
Does anyone know this issue?

Thanks
Tsubasa Narita

Mime
View raw message