cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vincent royer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11193) Missing binary dependencies for running Cassandra in embedded mode
Date Sun, 15 Oct 2017 17:51:00 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-11193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16205227#comment-16205227
] 

vincent royer commented on CASSANDRA-11193:
-------------------------------------------

As explained, you won't get the issue by building cassandra, because the org.ow2.asm jar is
provided in the cassandra lib directory.
If you build another project (like Elassandra) using cassandra-all as a dependency, you will
get this king of exception if you have an UDF in your CQL schema :

2017-10-15 17:11:25,114 ERROR [main] ElassandraDaemon.java:516 main Exception
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
        at org.apache.cassandra.cql3.functions.JavaBasedUDFunction.<clinit>(JavaBasedUDFunction.java:85)
        at org.apache.cassandra.cql3.functions.UDFunction.create(UDFunction.java:233)
        at org.apache.cassandra.schema.SchemaKeyspace.createUDFFromRow(SchemaKeyspace.java:1275)
        at org.apache.cassandra.schema.SchemaKeyspace.fetchUDFs(SchemaKeyspace.java:1229)
        at org.apache.cassandra.schema.SchemaKeyspace.fetchFunctions(SchemaKeyspace.java:1214)
        at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspace(SchemaKeyspace.java:947)
        at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspacesWithout(SchemaKeyspace.java:922)
        at org.apache.cassandra.schema.SchemaKeyspace.fetchNonSystemKeyspaces(SchemaKeyspace.java:910)
        at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:90)
        at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:80)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:266)
        at org.apache.cassandra.service.ElassandraDaemon.activate(ElassandraDaemon.java:208)
        at org.apache.cassandra.service.ElassandraDaemon.main(ElassandraDaemon.java:479)
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

You can reproduce this issue by removing the org.ow2.asm jar from cassandra lib, rebuid, and
restart cassandra after creating an UDF.
For Elassandra, the fix was to add a hard dependency to org.ow2.asm in its build.gradle.


> Missing binary dependencies for running Cassandra in embedded mode
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-11193
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11193
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: Cassandra 3.3
>            Reporter: DOAN DuyHai
>            Priority: Minor
>         Attachments: patch.txt
>
>
> When running Cassandra in embedded mode (pulling the *cassandra-all-3.3.jar* from Maven)
and activating *UDF*, I face the following exceptions when trying to create an UDF:
> {noformat}
> 18:13:57.922 [main] DEBUG ACHILLES_DDL_SCRIPT - 		SCRIPT : CREATE FUNCTION convertToLong(input
text) RETURNS NULL ON NULL INPUT RETURNS bigint LANGUAGE java AS $$return Long.parseLong(input);$$;
> 18:13:57.970 [SharedPool-Worker-1] ERROR o.apache.cassandra.transport.Message - Unexpected
exception during request; channel = [id: 0x03f52731, /192.168.1.16:55224 => /192.168.1.16:9240]
> java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
> 	at org.apache.cassandra.cql3.functions.JavaBasedUDFunction.<clinit>(JavaBasedUDFunction.java:79)
~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.functions.UDFunction.create(UDFunction.java:223) ~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.statements.CreateFunctionStatement.announceMigration(CreateFunctionStatement.java:162)
~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:93)
~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:206)
~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:237) ~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:222) ~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115)
~[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507)
[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401)
[cassandra-all-3.3.jar:3.3]
> 	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60-ea]
> 	at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
[cassandra-all-3.3.jar:3.3]
> 	at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [cassandra-all-3.3.jar:3.3]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60-ea]
> Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_60-ea]
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_60-ea]
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_60-ea]
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_60-ea]
> 	... 18 common frames omitted
> {noformat}
>  The stack-trace is quite explicit, some classes from the objectweb/asm are missing.
By looking into the {{$CASSANDRA_HOME/lib folder}}:
> {noformat}
>  19:44:07 :/opt/apps/apache-cassandra-3.2/lib]
> % ll
> total 48768
> -rw-r--r--@  1 archinnovinfo  wheel   234K Jan  7 22:42 ST4-4.0.8.jar
> -rw-r--r--@  1 archinnovinfo  wheel    85K Jan  7 22:42 airline-0.6.jar
> -rw-r--r--@  1 archinnovinfo  wheel   164K Jan  7 22:42 antlr-runtime-3.5.2.jar
> -rw-r--r--@  1 archinnovinfo  wheel   5.1M Jan  7 22:42 apache-cassandra-3.2.jar
> -rw-r--r--@  1 archinnovinfo  wheel   189K Jan  7 22:42 apache-cassandra-clientutil-3.2.jar
> -rw-r--r--@  1 archinnovinfo  wheel   1.8M Jan  7 22:42 apache-cassandra-thrift-3.2.jar
> -rw-r--r--@  1 archinnovinfo  wheel    52K Jan  7 22:42 asm-5.0.4.jar
> -rw-r--r--@  1 archinnovinfo  wheel   2.2M Jan  7 22:42 cassandra-driver-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar
> -rw-r--r--@  1 archinnovinfo  wheel   224K Jan  7 22:42 cassandra-driver-internal-only-3.0.0-6af642d.zip
> {noformat}
>  I can see there is a *asm-5.0.4.jar*. After adding the following dependency in Maven,
the issue is solved:
> {code:xml}
>             <dependency>
>                 <groupId>org.ow2.asm</groupId>
>                 <artifactId>asm</artifactId>
>                 <version>5.0.4</version>
>             </dependency>
> {code}
>  What is strange is that this dependency is not mentioned anywhere, neither in the *cassandra-all-3.3.pom.xml*
nor in the *build.xml* ant file...



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message