java.lang.NullPointerException

Spring JIRA | Alexander Bulaev | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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.

    Spring JIRA | 4 years ago | Alexander Bulaev
    java.lang.NullPointerException
  2. 0

    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.

    Spring JIRA | 4 years ago | Alexander Bulaev
    java.lang.NullPointerException
  3. 0

    Develottment: Android TDD with Robolectric and JUnit

    develottment.com | 1 year ago
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    UI hang on console hyperlink calculation

    YouTrack | 3 years ago
    java.lang.reflect.InvocationTargetException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.springframework.scala.context.function.FunctionalConfiguration$class.environment()
    2. org.springframework.scala
      FunctionalConfiguration$class.environment
      1. org.springframework.scala.context.function.FunctionalConfiguration$class.environment(FunctionalConfiguration.scala:96)
      1 frame
    3. com.alexb.main
      FunctionalConfigurationBugDemo$ContextConfiguration.environment
      1. com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.environment(FunctionalConfigurationBugDemo.scala:15)
      1 frame
    4. org.springframework.scala
      FunctionalConfiguration$class.profile
      1. org.springframework.scala.context.function.FunctionalConfiguration$class.profile(FunctionalConfiguration.scala:238)
      1 frame
    5. com.alexb.main
      FunctionalConfigurationBugDemo$ContextConfiguration.<init>
      1. com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.profile(FunctionalConfigurationBugDemo.scala:15)
      2. com.alexb.main.context.FunctionalConfigurationBugDemo$ConfigPart$class.$init$(FunctionalConfigurationBugDemo.scala:8)
      3. com.alexb.main.context.FunctionalConfigurationBugDemo$ContextConfiguration.<init>(FunctionalConfigurationBugDemo.scala:15)
      3 frames
    6. Java RT
      Class.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      5. java.lang.Class.newInstance0(Class.java:372)
      6. java.lang.Class.newInstance(Class.java:325)
      6 frames
    7. Spring Beans
      BeanUtils.instantiate
      1. org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:79)
      1 frame
    8. org.springframework.scala
      FunctionalConfigApplicationContext$$anonfun$1.apply
      1. org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69)
      2. org.springframework.scala.context.function.FunctionalConfigApplicationContext$$anonfun$1.apply(FunctionalConfigApplicationContext.scala:69)
      2 frames
    9. Scala
      AbstractTraversable.map
      1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      3. scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      4. scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
      5. scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      6. scala.collection.AbstractTraversable.map(Traversable.scala:105)
      6 frames
    10. org.springframework.scala
      FunctionalConfigApplicationContext$.apply
      1. org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClasses(FunctionalConfigApplicationContext.scala:69)
      2. org.springframework.scala.context.function.FunctionalConfigApplicationContext.registerClass(FunctionalConfigApplicationContext.scala:57)
      3. org.springframework.scala.context.function.FunctionalConfigApplicationContext$.apply(FunctionalConfigApplicationContext.scala:114)
      3 frames
    11. com.alexb.main
      FunctionalConfigurationBugDemo$delayedInit$body.apply
      1. com.alexb.main.context.FunctionalConfigurationBugDemo$delayedInit$body.apply(FunctionalConfigurationBugDemo.scala:17)
      1 frame
    12. Scala
      App$class.main
      1. scala.Function0$class.apply$mcV$sp(Function0.scala:40)
      2. scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
      3. scala.App$$anonfun$main$1.apply(App.scala:71)
      4. scala.App$$anonfun$main$1.apply(App.scala:71)
      5. scala.collection.immutable.List.foreach(List.scala:318)
      6. scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
      7. scala.App$class.main(App.scala:71)
      7 frames
    13. com.alexb.main
      FunctionalConfigurationBugDemo.main
      1. com.alexb.main.context.FunctionalConfigurationBugDemo$.main(FunctionalConfigurationBugDemo.scala:5)
      2. com.alexb.main.context.FunctionalConfigurationBugDemo.main(FunctionalConfigurationBugDemo.scala)
      2 frames
    14. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    15. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      1 frame