title: What's the way to bootstrap a play 2.4 Java app with Spring?
body: <p>The documentation at https:// www.playframework.com/documentation/2.4.x/JavaDependencyInjection mentions that DI is now integrated into the framework:</p>
  
  <blockquote>
    <p>Out of the box, Play provides dependency injection support based on
    JSR 330. The default JSR 330 implementation that comes with Play is
    Guice, but other JSR 330 implementations can be plugged in.</p>
  </blockquote>
  
  <p>I could not find any HOWTO or working example that uses Spring.</p>
  
  <p>The current documentation at https:// www.playframework.com/documentation/2.4.x/Tutorials links to an example "Play with Spring Data JPA" at https:// typesafe.com/activator/template/play-spring-data-jpa but the comments already mention that it's outdated. Also, on the GitHub page https:// github.com/typesafehub/play-spring-data-jpa there are open issues mentioning it's not working in Play 2.4.0.</p>
  
  <p>The code is 2 years old and still uses the Global.java class to bootstrap Spring. I'd be fine with that, but the code does not compile anymore in Play 2.4 because of the method getControllerInstance().</p>
  
  <p>This project https://  github.com/jroper/play-spring looks promising but it's in Scala, and there are many TODOs listed, and the SpringApplicationLoader class at https:// github.com/jroper/play-spring/blob/master/core/src/main/scala/play/api/inject/spring/SpringApplicationLoader.scala looks too complicated when all I want is to start a simple Spring context.</p>
  
  <p>Right now it looks like I have to downgrade Play to use the old Global.java hack (and figure out all the changes needed ...)</p>
  
  <p><em>(some editor pls put the links back in, they are legit, it would not let me ...)</em></p>