java - Spring-Data-Mongodb depedencies not picked by Play-Framework 2.4 -
i using play-framework 2.4 spring-data-mongodb. when compile project compile throw error:
[error] /home/james/play-spring-data-mongodb/app/configuration/springdatamongoconfiguration.java:10: package org.springframework.data.mongodb.config not exist [error] org.springframework.data.mongodb.config.abstractmongoconfiguration [error] /home/james/play-spring-data-mongodb/app/configuration/springdatamongoconfiguration.java:11: package org.springframework.data.mongodb.repository.config not exist [error] org.springframework.data.mongodb.repository.config.enablemongorepositories [error] /home/james/play-spring-data-mongodb/app/configuration/springdatamongoconfiguration.java:25: cannot find symbol [error] symbol: class abstractmongoconfiguration [error] abstractmongoconfiguration [error] /home/james/play-spring-data-mongodb/app/configuration/springdatamongoconfiguration.java:24: cannot find symbol [error] symbol: class enablemongorepositories [error] enablemongorepositories
the main thing that, yesterday works perfectly. today got error, when trying compile project. build.sbt
file below:
name := """play-mongo-template""" version := "1.0-snapshot" lazy val root = (project in file(".")).enableplugins(playjava) scalaversion := "2.11.6" librarydependencies ++= seq( javajdbc, cache, javaws, "org.springframework" % "spring-context" % "4.1.6.release", "org.springframework.data" % "spring-data-mongodb-parent" % "1.7.2.release" ) // play provides 2 styles of routers, 1 expects actions injected, // other, legacy style, accesses actions statically. routesgenerator := injectedroutesgenerator
update
i found problem, problem that, our play-framework
activator unable download spring-framework dependency. when open .ivy folder , there no jars available. system connected internet, still play sbt not resolve dependencies. how resolve problem?
to use repository feature in spring data, life cycle has managed spring.
hence using play 2.4 / 2.5, without adding spring dependency problem because default life cycle managed guice.
i figured out way create spring beans , transfer life cycle management guice. hence can injected anywhere in project guice instead of spring.
for other components don't have spring specific feature, can created , life cycle managed guice.
for other components, spring specific , can run inside spring container, can injected in project , life cycle managed guice.
i modified starter project included in play 2.5 docs demonstrate it.
please have @ repository.
https://github.com/mohitsinha/play-java-spring-data-mongodb
Comments
Post a Comment