java - Typesafe config - Null Pointer Exception -


i manually constructing classpath play/scala/akka application can use scalatest runner test application during different stages of ci pipeline without need recompile. however, following error:

java.lang.nullpointerexception:   @ com.typesafe.config.impl.parseable$parseableresources.rawparsevalue(parseable.java:509)   @ com.typesafe.config.impl.parseable$parseableresources.rawparsevalue(parseable.java:492)   @ com.typesafe.config.impl.parseable.parsevalue(parseable.java:171)   @ com.typesafe.config.impl.parseable.parsevalue(parseable.java:165)   @ com.typesafe.config.impl.parseable.parse(parseable.java:204)   @ com.typesafe.config.impl.configimpl$1.call(configimpl.java:368)   @ com.typesafe.config.impl.configimpl$1.call(configimpl.java:365)   @ com.typesafe.config.impl.configimpl$loadercache.getorelseupdate(configimpl.java:58)   @ com.typesafe.config.impl.configimpl.computecachedconfig(configimpl.java:86)   @ com.typesafe.config.impl.configimpl.defaultreference(configimpl.java:365) 

here command running:

/usr/lib/jvm/java-7-openjdk//bin/java -xmx256m -xms32m -xbootclasspath/a:$bootcp -classpath '""' -dscala.home=/usr/opt/scala -dscala.usejavacp=true -jar /home/nick/repos/testrunnnertest/lib/scalatest.jar -r target/scala-2.10/test-classes -o  

the value $bootcp massive list of dependencies including application jars, dependencies in .ivy2 , folders containing config files (/conf, /test/resources). copied command scala shell script. used value $bootcp value -classpath, still had same problem.

this problem happens when run acceptance tests spinning play framework test server. seems problem loading main application configs in /conf rather /test/resources configs appear load find when unit , integration tests happily run.

coming question pretty late, did ever figure out? typesafe config version on classpath?

line 509 on master doesn't quite right line: https://github.com/typesafehub/config/blob/master/config/src/main/java/com/typesafe/config/impl/parseable.java#l509

so may have version different source.

version 1.0.2 line 509 looks maybe more likely: https://github.com/typesafehub/config/blob/v1.0.2/config/src/main/java/com/typesafe/config/impl/parseable.java#l509

on line class loader null guess? it's supposed come here in trace: https://github.com/typesafehub/config/blob/v1.0.2/config/src/main/java/com/typesafe/config/impl/configimpl.java#l365 in turn comes from: https://github.com/typesafehub/config/blob/v1.0.2/config/src/main/java/com/typesafe/config/configfactory.java#l380

so 1 theory thread has no context class loader set in case throws exception. can't tell why that's case in scenario, if is, perhaps lead.

i don't think typesafe config should throw npe "late" in case created https://github.com/typesafehub/config/issues/155 fix up. problem in play and/or how you're setting things thread context class loader null , no other class loader provided configfactory methods.

this assuming npe null class loader, don't think that's problem, looks plausible stack trace.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -