简体   繁体   中英

While starting the play server config locations must not be null exception?

While starting the play server, we are getting the exception "config locations must not be null", Can anyone let me know what's going wrong?

Exception

  Starting gpp-web at port 9000...                                      ERROR
java.lang.IllegalArgumentException: Config locations must not be null
        at org.springframework.util.Assert.noNullElements(Assert.java:241)
        at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations(AbstractRefreshableConfigApplicationContext.java:77)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:137)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
        at Global.onStart(Global.java:15)
        at play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:18)
        at play.api.GlobalPlugin.onStart(GlobalSettings.scala:203)
        at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
        at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
        at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
        at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
        at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
        at play.api.Play$.start(Play.scala:87)
        at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
        at play.core.server.NettyServer$.createServer(NettyServer.scala:243)
        at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:279)
        at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:274)
        at scala.Option.map(Option.scala:145)
        at play.core.server.NettyServer$.main(NettyServer.scala:274)
        at play.core.server.NettyServer.main(NettyServer.scala)

Thanks James,

But found the problem, actually we build three different configuration file for play depend on environment like dev, UAT & Prod.

I forgot to add the "spring.context.location="applicationContext.xml" the parameter in configuration file & error has been popping up.

But thanks for suggestion .....

Gladiator

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM