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.

  • 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)
    via by Lars Rosenberg,
  • Error in trying to Add Attachment RN
    via by 496242,
  • JBO-30012 error
    via by 278464,
  • 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)
    via by Lars Rosenberg,
  • Exception with hash index.
    via by Silvio Moioli,
  • Error deploying CMP on WAS 5.1
    via by Zurich Java,
  • reverseing strings in file
    via by piet,
    • java.lang.NullPointerException at java.lang.StringBuffer.<init>(StringBuffer.java:130) at com.sshtools.j2ssh.openssh.PEMReader.read(Unknown Source) at com.sshtools.j2ssh.openssh.PEMReader.<init>(Unknown Source) at com.sshtools.j2ssh.openssh.OpenSSHPrivateKeyFormat.isFormatted(Unknown Source) at com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile.parse(Unknown Source)

    Users with the same issue

    Unknown visitor2 times, last one,