java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • This simple example fails with the following stacktrace: {code} package com.alexb.main.context import org.springframework.scala.context.function.{FunctionalConfigApplicationContext, FunctionalConfiguration} object FunctionalConfigurationBugDemo extends App { trait ConfigPart extends FunctionalConfiguration { profile("someProfile") { bean("someBean") { "I will let you down!" } } } class ContextConfiguration extends ConfigPart FunctionalConfigApplicationContext[ContextConfiguration]().refresh() } {code} {noformat} Exception in thread "main" java.lang.NullPointerException at org.springframework.scala.context.function.FunctionalConfiguration$class.environment(FunctionalConfiguration.scala:96) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.environment(FunctionalConfigurationBugDemo.scala:15) at org.springframework.scala.context.function.FunctionalConfiguration$class.profile(FunctionalConfiguration.scala:238) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.profile(FunctionalConfigurationBugDemo.scala:15) at com.alexb.main.context.FunctionalConfigurationBugDemo$ConfigPart$class.$init$(FunctionalConfigurationBugDemo.scala:8) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.<init>(FunctionalConfigurationBugDemo.scala:15) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:79) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClasses(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClass(FunctionalConfigApplicationContext.scala:57) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$.apply(FunctionalConfigApplicationContext.scala:114) at com.alexb.main.context.FunctionalConfigurationBugDemo$delayedInit$body.apply(FunctionalConfigurationBugDemo.scala:17) at scala.Function0$class.apply$mcV$sp(Function0.scala:40) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32) at scala.App$class.main(App.scala:71) at com.alexb.main.context.FunctionalConfigurationBugDemo$.main(FunctionalConfigurationBugDemo.scala:5) at com.alexb.main.context.FunctionalConfigurationBugDemo.main(FunctionalConfigurationBugDemo.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {noformat} Seems like some initialization issues.
    via by Alexander Bulaev,
  • This simple example fails with the following stacktrace: {code} package com.alexb.main.context import org.springframework.scala.context.function.{FunctionalConfigApplicationContext, FunctionalConfiguration} object FunctionalConfigurationBugDemo extends App { trait ConfigPart extends FunctionalConfiguration { profile("someProfile") { bean("someBean") { "I will let you down!" } } } class ContextConfiguration extends ConfigPart FunctionalConfigApplicationContext[ContextConfiguration]().refresh() } {code} {noformat} Exception in thread "main" java.lang.NullPointerException at org.springframework.scala.context.function.FunctionalConfiguration$class.environment(FunctionalConfiguration.scala:96) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.environment(FunctionalConfigurationBugDemo.scala:15) at org.springframework.scala.context.function.FunctionalConfiguration$class.profile(FunctionalConfiguration.scala:238) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.profile(FunctionalConfigurationBugDemo.scala:15) at com.alexb.main.context.FunctionalConfigurationBugDemo$ConfigPart$class.$init$(FunctionalConfigurationBugDemo.scala:8) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.<init>(FunctionalConfigurationBugDemo.scala:15) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:79) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClasses(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClass(FunctionalConfigApplicationContext.scala:57) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$.apply(FunctionalConfigApplicationContext.scala:114) at com.alexb.main.context.FunctionalConfigurationBugDemo$delayedInit$body.apply(FunctionalConfigurationBugDemo.scala:17) at scala.Function0$class.apply$mcV$sp(Function0.scala:40) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32) at scala.App$class.main(App.scala:71) at com.alexb.main.context.FunctionalConfigurationBugDemo$.main(FunctionalConfigurationBugDemo.scala:5) at com.alexb.main.context.FunctionalConfigurationBugDemo.main(FunctionalConfigurationBugDemo.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {noformat} Seems like some initialization issues.
    via by Alexander Bulaev,
    • java.lang.NullPointerException at org.springframework.scala.context.function.FunctionalConfiguration$class.environment(FunctionalConfiguration.scala:96) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.environment(FunctionalConfigurationBugDemo.scala:15) at org.springframework.scala.context.function.FunctionalConfiguration$class.profile(FunctionalConfiguration.scala:238) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.profile(FunctionalConfigurationBugDemo.scala:15) at com.alexb.main.context.FunctionalConfigurationBugDemo$ConfigPart$class.$init$(FunctionalConfigurationBugDemo.scala:8) at com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.<init>(FunctionalConfigurationBugDemo.scala:15) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:79) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClasses(FunctionalConfigApplicationContext.scala:69) at org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClass(FunctionalConfigApplicationContext.scala:57) at org.springframework.scala.context.function.FunctionalConfigApplicationContext$.apply(FunctionalConfigApplicationContext.scala:114) at com.alexb.main.context.FunctionalConfigurationBugDemo$delayedInit$body.apply(FunctionalConfigurationBugDemo.scala:17) at scala.Function0$class.apply$mcV$sp(Function0.scala:40) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32) at scala.App$class.main(App.scala:71) at com.alexb.main.context.FunctionalConfigurationBugDemo$.main(FunctionalConfigurationBugDemo.scala:5) at com.alexb.main.context.FunctionalConfigurationBugDemo.main(FunctionalConfigurationBugDemo.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    No Bugmate found.