softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.51k stars 194 forks source link

java.lang.NoClassDefFoundError: shapeless/HListerAux #51

Closed spiritedtechie closed 8 years ago

spiritedtechie commented 9 years ago

elasticmq version: 0.8.8

Not sure if this is an issue and I cannot see anything obviously wrong with my dependencies. I am getting the following exception:

java.lang.NoClassDefFoundError: shapeless/HListerAux$ at org.elasticmq.rest.sqs.directives.ElasticMQDirectives$class.action(ElasticMQDirectives.scala:24) at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.action(SQSRestServerBuilder.scala:89) at org.elasticmq.rest.sqs.CreateQueueDirectives$class.$init$(CreateQueueDirectives.scala:19) at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.(SQSRestServerBuilder.scala:89) at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.start(SQSRestServerBuilder.scala:89)

when I use this line in my test:

val server = SQSRestServerBuilder.start()

The below is how the shapeless library is imported via spray-routing-shapeless2_2.11:1.3.3. There is no other mention of shapeless in the dependency tree except here:

[info]  +-io.spray:spray-json_2.11:1.3.2 [S] [info]  +-io.spray:spray-routing-shapeless2_2.11:1.3.3 [S] [info]  +-com.chuusai:shapeless_2.11:2.1.0 [S] [info]  +-io.spray:spray-http_2.11:1.3.3 [S] [info]  | +-io.spray:spray-util_2.11:1.3.3 [S] [info]  | +-org.parboiled:parboiled-scala_2.11:1.1.7 [S] [info]  | +-org.parboiled:parboiled-core:1.1.7

Im using Spray 1.3.3, akka 2.3.11, aws-sdk 1.10.0.

Is this something that anyone has experienced?

adamw commented 9 years ago

hmm, "interesting" :) Just in case, I uploaded 2.3.9-SNAPSHOT which depends on akka 2.3.11 and aws-sdk 1.10.1. Can you try that?

This shouldn't really change anything as spray is the same, but who knows ;)

There's no other root cause exceptions further down the stack trace?

spiritedtechie commented 9 years ago

So I have managed to work around the problem by not using spray-routing-shapeless, and just using spray-routing. This seems to remove the shapeless 2.1.0 dependency and I end up with shapeless 1.2.4 on my classpath (transitive dependency of spray-routing (non shapeless)). This seems to work.

adamw commented 9 years ago

Ah, so 1.2.4 was evicted by 2.1.0. Soon I hope to move to akka-http which I think doesn't depend on shapeless, or at least on a newer one :)

adamw commented 8 years ago

0.9.0-beta1 now uses akka-http (https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.9.0-beta1.jar)