java.lang.NullPointerException: Name is null

Spring JIRA | Mattias Severson | 4 years ago
  1. 0

    There is a NullPointerException when Spring Security attempts to find which Http methods that are allowed for a resource whose _intercept-url_ does not have any specific _method_. # Unzip the provided project # Execute "mvn jetty:run" # Navigate to http://localhost:8080/application.wadl in a browser # Enter the credentials "user" / "secret" *Expected result:* A generated wadl file such as the provided _application.3.0.7.wadl_ (see the root folder of the attached .zip file). *Actual result:* java.lang.NullPointerException: Name is null at java.lang.Enum.valueOf(Enum.java:235) at org.springframework.http.HttpMethod.valueOf(HttpMethod.java:1) at org.springframework.security.web.util.AntPathRequestMatcher.matches(AntPathRequestMatcher.java:83) at org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource.getAttributes(DefaultFilterInvocationSecurityMetadataSource.java:86) at org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:90) at org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:67) at com.jayway.security.WADLGenerator.createResource(WADLGenerator.java:39) at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:330) at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:326) at com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:108) at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.getApplication(WadlApplicationContextImpl.java:111) at com.sun.jersey.server.impl.wadl.WadlApplicationContextInjectionProxy.getApplication(WadlApplicationContextInjectionProxy.java:63) at com.sun.jersey.server.impl.wadl.WadlResource.getWadl(WadlResource.java:95) [...] *Note:* The above steps work in the 3.0.7 version of Spring Security. Simply # Change the _org.springframework.security.version_ in the _pom.xml_ to _3.0.7.RELEASE_ # Update the spring security schema location in the _securityContext.xml_ to http://www.springframework.org/schema/security/spring-security-3.0.4.xsd # Visit http://localhost:8080/application.wadl (log in using the credentials above) # The result is the _application.3.0.7.wadl_ file in the root folder of the attached zip file The NPE may (or may not) be another manifestation of the issue that was reported in https://jira.springsource.org/browse/SEC-1836 ?

    Spring JIRA | 4 years ago | Mattias Severson
    java.lang.NullPointerException: Name is null
  2. 0

    There is a NullPointerException when Spring Security attempts to find which Http methods that are allowed for a resource whose _intercept-url_ does not have any specific _method_. # Unzip the provided project # Execute "mvn jetty:run" # Navigate to http://localhost:8080/application.wadl in a browser # Enter the credentials "user" / "secret" *Expected result:* A generated wadl file such as the provided _application.3.0.7.wadl_ (see the root folder of the attached .zip file). *Actual result:* java.lang.NullPointerException: Name is null at java.lang.Enum.valueOf(Enum.java:235) at org.springframework.http.HttpMethod.valueOf(HttpMethod.java:1) at org.springframework.security.web.util.AntPathRequestMatcher.matches(AntPathRequestMatcher.java:83) at org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource.getAttributes(DefaultFilterInvocationSecurityMetadataSource.java:86) at org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:90) at org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:67) at com.jayway.security.WADLGenerator.createResource(WADLGenerator.java:39) at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:330) at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:326) at com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:108) at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.getApplication(WadlApplicationContextImpl.java:111) at com.sun.jersey.server.impl.wadl.WadlApplicationContextInjectionProxy.getApplication(WadlApplicationContextInjectionProxy.java:63) at com.sun.jersey.server.impl.wadl.WadlResource.getWadl(WadlResource.java:95) [...] *Note:* The above steps work in the 3.0.7 version of Spring Security. Simply # Change the _org.springframework.security.version_ in the _pom.xml_ to _3.0.7.RELEASE_ # Update the spring security schema location in the _securityContext.xml_ to http://www.springframework.org/schema/security/spring-security-3.0.4.xsd # Visit http://localhost:8080/application.wadl (log in using the credentials above) # The result is the _application.3.0.7.wadl_ file in the root folder of the attached zip file The NPE may (or may not) be another manifestation of the issue that was reported in https://jira.springsource.org/browse/SEC-1836 ?

    Spring JIRA | 4 years ago | Mattias Severson
    java.lang.NullPointerException: Name is null
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    NullPointerException: Name is null

    GitHub | 3 years ago | vinzenco
    java.lang.NullPointerException: Name is null
  5. 0

    Name is null NPE when exporting HTML

    GitHub | 2 years ago | GoogleCodeExporter
    java.lang.NullPointerException: Name is null

  1. tfr 1 times, last 6 months ago
3 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

    Name is null

    at java.lang.Enum.valueOf()
  2. Java RT
    Enum.valueOf
    1. java.lang.Enum.valueOf(Enum.java:235)
    1 frame
  3. Spring
    HttpMethod.valueOf
    1. org.springframework.http.HttpMethod.valueOf(HttpMethod.java:1)
    1 frame
  4. Spring Security
    DefaultWebInvocationPrivilegeEvaluator.isAllowed
    1. org.springframework.security.web.util.AntPathRequestMatcher.matches(AntPathRequestMatcher.java:83)
    2. org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource.getAttributes(DefaultFilterInvocationSecurityMetadataSource.java:86)
    3. org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:90)
    4. org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator.isAllowed(DefaultWebInvocationPrivilegeEvaluator.java:67)
    4 frames
  5. com.jayway.security
    WADLGenerator.createResource
    1. com.jayway.security.WADLGenerator.createResource(WADLGenerator.java:39)
    1 frame
  6. Jersey
    WadlResource.getWadl
    1. com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:330)
    2. com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:326)
    3. com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:108)
    4. com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.getApplication(WadlApplicationContextImpl.java:111)
    5. com.sun.jersey.server.impl.wadl.WadlApplicationContextInjectionProxy.getApplication(WadlApplicationContextInjectionProxy.java:63)
    6. com.sun.jersey.server.impl.wadl.WadlResource.getWadl(WadlResource.java:95)
    6 frames