java.lang.NullPointerException

Spring JIRA | Lars Rosenberg | 1 decade ago
  1. 0

    public class MyBusinessImpl implements MyBusiness { public String doSomething() throws Exception { if (Math.random() > 0.9) { throw new Exception("my exception"); } else { return "my test"; } } } public void testRun() { MyBusiness business = (MyBusiness) applicationContext.getBean("business"); Assert.assertNotNull(business); try { business.doSomething(); } catch (Exception e) { getLogger().throwing("MyBusinessTestCase","testRun", e); } } <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="business" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="targetName" value="business-target"/> <property name="interfaces"> <list> <value>dk.pfa.si.spring.aoptest.MyBusiness</value> </list> </property> <property name="interceptorNames"> <list> <value>MyTraceInterceptor</value> </list> </property> </bean> <bean id="business-target" class="dk.pfa.si.spring.aoptest.impl.MyBusinessImpl"> </bean> <bean id="MyTraceInterceptor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/> </beans> java.lang.NullPointerException at java.lang.StringBuffer.<init>(StringBuffer.java:130) at org.springframework.aop.interceptor.AbstractPerformanceMonitorInterceptor.createInvocationTraceName(AbstractPerformanceMonitorInterceptor.java:80) at org.springframework.aop.interceptor.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:55) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy0.doSomething(Unknown Source) at dk.pfa.si.spring.aoptest.MyBusinessTestCase.testRun(MyBusinessTestCase.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)

    Spring JIRA | 1 decade ago | Lars Rosenberg
    java.lang.NullPointerException
  2. 0

    public class MyBusinessImpl implements MyBusiness { public String doSomething() throws Exception { if (Math.random() > 0.9) { throw new Exception("my exception"); } else { return "my test"; } } } public void testRun() { MyBusiness business = (MyBusiness) applicationContext.getBean("business"); Assert.assertNotNull(business); try { business.doSomething(); } catch (Exception e) { getLogger().throwing("MyBusinessTestCase","testRun", e); } } <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="business" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="targetName" value="business-target"/> <property name="interfaces"> <list> <value>dk.pfa.si.spring.aoptest.MyBusiness</value> </list> </property> <property name="interceptorNames"> <list> <value>MyTraceInterceptor</value> </list> </property> </bean> <bean id="business-target" class="dk.pfa.si.spring.aoptest.impl.MyBusinessImpl"> </bean> <bean id="MyTraceInterceptor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/> </beans> java.lang.NullPointerException at java.lang.StringBuffer.<init>(StringBuffer.java:130) at org.springframework.aop.interceptor.AbstractPerformanceMonitorInterceptor.createInvocationTraceName(AbstractPerformanceMonitorInterceptor.java:80) at org.springframework.aop.interceptor.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:55) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy0.doSomething(Unknown Source) at dk.pfa.si.spring.aoptest.MyBusinessTestCase.testRun(MyBusinessTestCase.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)

    Spring JIRA | 1 decade ago | Lars Rosenberg
    java.lang.NullPointerException
  3. 0

    Grid Control Agent Installation Issues

    Oracle Community | 10 years ago | 558876
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error in trying to Add Attachment RN

    Oracle Community | 9 years ago | 496242
    java.lang.NullPointerException
  6. 0

    JBO-30012 error

    Oracle Community | 1 decade ago | 278464
    java.lang.NullPointerException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at java.lang.StringBuffer.<init>()
    2. Java RT
      StringBuffer.<init>
      1. java.lang.StringBuffer.<init>(StringBuffer.java:130)
      1 frame
    3. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.interceptor.AbstractPerformanceMonitorInterceptor.createInvocationTraceName(AbstractPerformanceMonitorInterceptor.java:80)
      2. org.springframework.aop.interceptor.PerformanceMonitorInterceptor.invokeUnderTrace(PerformanceMonitorInterceptor.java:55)
      3. org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:94)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      5. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
      5 frames
    4. Unknown
      $Proxy0.doSomething
      1. $Proxy0.doSomething(Unknown Source)
      1 frame
    5. dk.pfa.si
      MyBusinessTestCase.testRun
      1. dk.pfa.si.spring.aoptest.MyBusinessTestCase.testRun(MyBusinessTestCase.java:93)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    7. JUnit
      TestRunner.doRun
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      9. junit.textui.TestRunner.doRun(TestRunner.java:116)
      9 frames
    8. com.intellij.rt
      IdeaJUnitAgent.doRun
      1. com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
      1 frame
    9. JUnit
      TestRunner.start
      1. junit.textui.TestRunner.start(TestRunner.java:172)
      1 frame
    10. IDEA
      TextTestRunner2.startRunnerWithArgs
      1. com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
      1 frame
    11. com.intellij.rt
      JUnitStarter.main
      1. com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
      2. com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
      2 frames
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    13. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
      1 frame