0

I am using template Spring Boot application with servlets. When I add to the application latest Jersey (for jax-rs) and then add Groovy framework to the application (only for testing) I start having problems running the application from within IntelliJ.

It seems that some libraries on the Groovy classpath collide with the libraries coming from Jersey (servlet-api and ASM) but I am not yet 100% sure this is the problem. For sure the classpath IntelliJ builds is different from maven's

seems to be connected to the tricks that the spring-boot maven plug-in does, but that's only a suspicion. running via java -jar fails, while running via mvn spring-boot:run works (from the command line as well from IntelliJ).

I get this exception: Caused by: org.apache.catalina.LifecycleException: A child container failed during start

gdanov
  • 312
  • 2
  • 12
  • That's a completely generic exception. You need to post the stack trace (actually the stack trace from the application, not the container, which will be printed out separately in normal circumstances). Even better share the code so we can see what you did. You probably can inspect the dependencies in your IDE (Eclipse is pretty good at that at least) and see if anything jumps out at you. – Dave Syer Feb 01 '14 at 16:31
  • I did that already, but it is a moving target. First it was ASM causing troubles, then the servlet api coming with groovy and so on...every time the exception was different and the only measure I could take is to eliminate a library from the groovy runtime lib folder. – gdanov Feb 02 '14 at 11:51
  • I really recommend quite strongly *not* using the groovy distribution (with servlet jars and stuff) to build or run your app. It's much better to use a dependency management system to control the dependencies. Just build the project with maven and run it. – Dave Syer Feb 02 '14 at 14:55
  • Thanks. This is also the approach I took, hoping somebody has resolved this. – gdanov Feb 02 '14 at 15:57

2 Answers2

1

looks like part of the problem was how I set-up my gmaven. when I set it up like in this post https://stackoverflow.com/a/19539452/672738 the problem is gone and my application happily boots with java -jar in IntelliJ

Community
  • 1
  • 1
gdanov
  • 312
  • 2
  • 12
0

I just solve this problem.

Groovy also includes the servlet-api lib which is conflict with the lib imported by spring boot.

You can just exclude the servlet-api from groovy.