Topic
4 replies Latest Post - ‏2013-12-23T15:01:22Z by AlexMulholland
jdcalus
jdcalus
2 Posts
ACCEPTED ANSWER

Pinned topic Liberty Profile User Registry Error

‏2013-12-20T17:10:05Z |

I am using Liberty Profile 8.5.5.1 within Eclipse Kepler

I wrote a custom user registry and an exception keep getting thrown 

java.lang.NullPointerException: 

at java.util.Hashtable.put(Hashtable.java:542)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.setPrivateAttribute(SRTServletRequest.java:286)
at [internal classes]

Thinking it was an error in my code a created a new server and added the Basic User Registry to the server.

<basicRegistry>
    <user password="{xor}MjQwb2Y2NTE=" name="jdcalus" />
    <group name="2">
    <member name="jdcalus" />
    </group>
    </basicRegistry>

and whola, I get the same error at the same location.

Below is the full server.xml...

<server description="new server">
 
    <!-- Enable features -->
    <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>jpa-2.0</feature>
        <feature>jdbc-4.0</feature>
        <feature>jaxrs-1.1</feature>
    <feature>appSecurity-2.0</feature>
</featureManager>
 
    <httpEndpoint host="localhost" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
    <applicationMonitor updateTrigger="mbean"/>
 
    <enterpriseApplication id="RacedayEAR" location="RacedayEAR.ear" name="RacedayEAR"/>
    <authentication cacheEnabled="true"></authentication>
    <basicRegistry>
    <user password="{xor}MjQwb2Y2NTE=" name="jdcalus" />
    <group name="2">
    <member name="jdcalus" />
    </group>
    </basicRegistry>
</server>

I have added a protected resource in my web.xml, which is picked up properly since I am prompted with a login dialog from the browser. After typing in the userid and password the above error occurs.

web.xml section for security....

<security-role>
<description>Registered User</description>
<role-name>2</role-name>
</security-role>
<security-constraint>
<display-name>RC_Registered</display-name>
<web-resource-collection>
<web-resource-name>RC_Secure</web-resource-name>
<url-pattern>/web/*</url-pattern>
<http-method>DELETE</http-method>
 
<http-method>GET</http-method>
 
</web-resource-collection>
<auth-constraint>
<role-name>2</role-name>
</auth-constraint>
</security-constraint>
 

I have to believe that with two different user registries, that produce the same error, there is something wrong with Liberty. Looking at the ffdc log, it leads me to believe there is a bug in a filter. I have attached the log.

Thanks in advance.

Attachments

  • AlexMulholland
    AlexMulholland
    32 Posts
    ACCEPTED ANSWER

    Re: Liberty Profile User Registry Error

    ‏2013-12-20T17:37:34Z  in response to jdcalus

    Hi,

    In liberty, custom user registries are implemented as user features - I don't see such a feature listed in your server.xml, how are you implementing and configuring your user registry?

    Regards, Alex.

    • jdcalus
      jdcalus
      2 Posts
      ACCEPTED ANSWER

      Re: Liberty Profile User Registry Error

      ‏2013-12-20T17:45:34Z  in response to AlexMulholland

      Alex, thanks for responding.

      The server.xml that is provided above is for the basic user registry. I didn't mean to confuse you. I have two servers. My original one is where I have the custom user registry. It was throwing the null pointer exception. So I created a second server, so to have a very minimal environment, removing as much complexity as possible and to get my custom code out the equation. Both servers exhibit the same problem.

      Server 1 = Customer User Registry -> Null Pointer

      Server 2 = Basic User Registry ->Null Pointer

      Same spot for both. I figured I would post based on the basic user registry, since that code is a part of Liberty and should make debugging easier.

      Thanks in advance.

      • AlexMulholland
        AlexMulholland
        32 Posts
        ACCEPTED ANSWER

        Re: Liberty Profile User Registry Error

        ‏2013-12-20T18:39:16Z  in response to jdcalus

        Thanks that makes sense :-)

        Please can you set this trace property in server.xml and re-run?

         <logging traceSpecification="*=info:com.ibm.ws.webcontainer.security*=all:com.ibm.ws.webcontainer.srt=all"></logging>

         

        You can email me the trace.log file directly.

         

        Regards, Alex.

        • AlexMulholland
          AlexMulholland
          32 Posts
          ACCEPTED ANSWER

          Re: Liberty Profile User Registry Error

          ‏2013-12-23T15:01:22Z  in response to AlexMulholland

          For info - we found a work-around to the problem which is to include a login-config entry in the web.xml like this:

          <login-config>
              <auth-method>BASIC</auth-method>
          </login-config>

          - Alex.