mercredi 30 septembre 2015

SpringBoot and DynamoDb-Local Embedded

I have a spring-boot (1.2.6) webapp. I use DynamoDb as an event store for the app. In my integration tests I would like to use this approach to start up DynamoDb-Local from my integration test code.
However, after including the dependency:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>DynamoDBLocal</artifactId>
    <version>1.10.5.1</version>
</dependency>

I will get the following error when running integration test:

java.lang.IllegalStateException: Failed to load ApplicationContext
(....)
Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jettyEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedJetty.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory]: Factory method 'jettyEmbeddedServletContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
(....)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jettyEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedJetty.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory]: Factory method 'jettyEmbeddedServletContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
(....)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory]: Factory method 'jettyEmbeddedServletContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
(....)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
(....)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.webapp.WebAppContext

I did not even add any code to my integration test, I literally just added the repo and dependency to my POM (as described in the AWS forum announcement linked above). Without this dependency everything runs just fine. Any ideas?

Aucun commentaire:

Enregistrer un commentaire