Platform: debian 10.3 "buster", amd64, openjdk 11, karaf 4.1.8, shiro 1.5.0

I get the following error when upgrading from shiro 1.4.1 to 1.5.0:
 IllegalArgumentException: There is no configured chain under the name/key []

Full stack trace here: 
https://gist.github.com/steinarb/39d8b14b09bdd24ce4f32e46793a11e5

Does anyone know what might cause this?


Details on what I do:
 1. I use karaf and the OSGi web whiteboard where servlets and filters
    are declarative services (DS) components, and the servlets and
    filters become OSGi services that plug into the web whiteboard
 2. Everything work as expected when using Shiro 1.4.1
 3. I create the shiro realm and SessionDAO in a web application called 
authservice
     https://github.com/steinarb/authservice
 4. The shiro realm and SessionDAO become OSGi services created by DS
    components
     a. 
https://github.com/steinarb/authservice/blob/master/authservice.web.security.dbrealm/src/main/java/no/priv/bang/authservice/web/security/dbrealm/AuthserviceDbRealm.java#L13
     b. 
https://github.com/steinarb/authservice/blob/master/authservice.web.security.memorysession/src/main/java/no/priv/bang/authservice/web/security/memorysession/MemorySession.java#L23
 5. Authservice create a ServletContextHelper DS component to create the
    "/authservice" web context
     
https://github.com/steinarb/authservice/blob/master/authservice.web.security/src/main/java/no/priv/bang/authservice/web/security/AuthserviceServletContextHelper.java#L22
 6. A ShiroFilter is created as a DS component and connected to the
    context created by the ServletContextHelper (I look forward to be
    able to use servlet annotations from OSGi 7 here...:-) )
     
https://github.com/steinarb/authservice/blob/master/authservice.web.security/src/main/java/no/priv/bang/authservice/web/security/AuthserviceShiroFilter.java#L44
     Note:
      a. The filter uses setup by code instead of from a shiro.ini file
         because the shiro.ini code doesn't work inside OSGi
      b. I still read a shiro.ini to get the mapping between paths and
         usernames and/or roles and/or permissions
          
https://github.com/steinarb/authservice/blob/master/authservice.web.security/src/main/resources/shiro.ini
      c. I'm still using deprecated classes to setup shiro, because
         that's the only approach I've so far been able to make work
         (replacing the deprecated classes is on the block, but not
         right now)
 7. The other servlets in the authservice application use the web
    context created and authentication and authorization works fine for
    authservice with shiro 1.5.0
 8. The web applications that use authservice are built over the same
    pattern: multiple DS components creating filters and servlets
    connecting the web whiteboard. All web applications have their own
    ServletContext, created using ServletContextHelper
 9. The web applications currently using authservice, are:
     a. ukelonn, with servlet context "/ukelonn"
         https://github.com/steinarb/ukelonn
     b. handlereg, with servlet context "/handlereg"
         https://github.com/steinarb/handlereg
     c. authservice-sampleclient, with sevlet context "/sampleauthserviceclient"
         https://github.com/steinarb/authservice-sampleclient
10. The web application that gets the failure is the first one I've
    tried upgrading to shiro 1.5.0 and the only changes from the current
    version are upgrading the dependencies in the pom to 1.5.0 for shiro
    and 1.11.0 of authservice (a maven central released version of
    authservice, using shiro 1.5.0)
    I haven't pushed the changes
    No code changes in ukelonn after the upgrade
11. The shiro setup of ukelonn, is:
     a. The ServletContextHelper DS component setting up "/ukelonn"
         
https://github.com/steinarb/ukelonn/blob/master/ukelonn.web.security/src/main/java/no/priv/bang/ukelonn/web/security/UkelonnServletContextHelper.java#L7
     b. The ShiroFilter DS component of ukelonn
         
https://github.com/steinarb/ukelonn/blob/master/ukelonn.web.security/src/main/java/no/priv/bang/ukelonn/web/security/UkelonnShiroFilter.java#L41
     c. The shiro.ini loaded by UkelonnShiroFilter
         
https://github.com/steinarb/ukelonn/blob/master/ukelonn.web.security/src/main/resources/shiro.ini#L1

Thanks!

- Steinar

Reply via email to