java.lang.NullPointerException

Spring JIRA | Rob Winch | 5 years ago
  1. 0

    spring-web-3.0.6.RELEASE fixed an issue with double encoding by allowing users to use the web.xml to disable double encoding. This logic was introduced into ExpressionEvaluationUtils.isSpringJspExpressionSupportActive which requires the PageContext to be a non null value. Since AuthzImpl internally uses the LegacyAuthorizeTag and does not inject the PageContext, it fails with a NullPointerException as show below. Note that this issue should have been caught with the current tests, but some of the tests in 3.0.x have not been ran. See SEC-1881 {code} spring-security-taglibs-TRUNK org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest testAlwaysReturnsUnauthorizedIfNoUserFound(org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest) java.lang.NullPointerException at org.springframework.web.util.ExpressionEvaluationUtils.isSpringJspExpressionSupportActive(ExpressionEvaluationUtils.java:73) at org.springframework.web.util.ExpressionEvaluationUtils.evaluateString(ExpressionEvaluationUtils.java:148) at org.springframework.security.taglibs.authz.LegacyAuthorizeTag.doStartTag(LegacyAuthorizeTag.java:74) at org.springframework.security.taglibs.velocity.AuthzImpl.ifGranted(AuthzImpl.java:103) at org.springframework.security.taglibs.velocity.AuthzImpl.allGranted(AuthzImpl.java:45) at org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest.testAlwaysReturnsUnauthorizedIfNoUserFound(AuthzImplAuthorizeTagTest.java:58) 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:592) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {code}

    Spring JIRA | 5 years ago | Rob Winch
    java.lang.NullPointerException
  2. 0

    spring-web-3.0.6.RELEASE fixed an issue with double encoding by allowing users to use the web.xml to disable double encoding. This logic was introduced into ExpressionEvaluationUtils.isSpringJspExpressionSupportActive which requires the PageContext to be a non null value. Since AuthzImpl internally uses the LegacyAuthorizeTag and does not inject the PageContext, it fails with a NullPointerException as show below. Note that this issue should have been caught with the current tests, but some of the tests in 3.0.x have not been ran. See SEC-1881 {code} spring-security-taglibs-TRUNK org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest testAlwaysReturnsUnauthorizedIfNoUserFound(org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest) java.lang.NullPointerException at org.springframework.web.util.ExpressionEvaluationUtils.isSpringJspExpressionSupportActive(ExpressionEvaluationUtils.java:73) at org.springframework.web.util.ExpressionEvaluationUtils.evaluateString(ExpressionEvaluationUtils.java:148) at org.springframework.security.taglibs.authz.LegacyAuthorizeTag.doStartTag(LegacyAuthorizeTag.java:74) at org.springframework.security.taglibs.velocity.AuthzImpl.ifGranted(AuthzImpl.java:103) at org.springframework.security.taglibs.velocity.AuthzImpl.allGranted(AuthzImpl.java:45) at org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest.testAlwaysReturnsUnauthorizedIfNoUserFound(AuthzImplAuthorizeTagTest.java:58) 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:592) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {code}

    Spring JIRA | 5 years ago | Rob Winch
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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 org.springframework.web.util.ExpressionEvaluationUtils.isSpringJspExpressionSupportActive()
    2. Spring
      ExpressionEvaluationUtils.evaluateString
      1. org.springframework.web.util.ExpressionEvaluationUtils.isSpringJspExpressionSupportActive(ExpressionEvaluationUtils.java:73)
      2. org.springframework.web.util.ExpressionEvaluationUtils.evaluateString(ExpressionEvaluationUtils.java:148)
      2 frames
    3. spring-security-taglibs
      AuthzImplAuthorizeTagTest.testAlwaysReturnsUnauthorizedIfNoUserFound
      1. org.springframework.security.taglibs.authz.LegacyAuthorizeTag.doStartTag(LegacyAuthorizeTag.java:74)
      2. org.springframework.security.taglibs.velocity.AuthzImpl.ifGranted(AuthzImpl.java:103)
      3. org.springframework.security.taglibs.velocity.AuthzImpl.allGranted(AuthzImpl.java:45)
      4. org.springframework.security.taglibs.velocity.AuthzImplAuthorizeTagTest.testAlwaysReturnsUnauthorizedIfNoUserFound(AuthzImplAuthorizeTagTest.java:58)
      4 frames
    4. 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:592)
      4 frames
    5. JUnit
      JUnit38ClassRunner.run
      1. junit.framework.TestCase.runTest(TestCase.java:168)
      2. junit.framework.TestCase.runBare(TestCase.java:134)
      3. junit.framework.TestResult$1.protect(TestResult.java:110)
      4. junit.framework.TestResult.runProtected(TestResult.java:128)
      5. junit.framework.TestResult.run(TestResult.java:113)
      6. junit.framework.TestCase.run(TestCase.java:124)
      7. junit.framework.TestSuite.runTest(TestSuite.java:232)
      8. junit.framework.TestSuite.run(TestSuite.java:227)
      9. org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91)
      9 frames
    6. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      1 frame
    7. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      5 frames