Jump to content
We've recently updated our Privacy Statement, available here ×
  • Error after upgrade: java.lang.IllegalStateException: No valid key alias or key present for jwtSecret configuration


    Friendly User
    • Features: JasperReports Server Version: v7.9, v7.9.0, v7.8, v7.8.1, v7.8.0 Product: JasperReports® Server

    Scenario:

    After upgrading you're getting java.lang.IllegalStateException: No valid key alias or key present for jwtSecret configuration on server startup:

    (ServerService Thread Pool -- 206) 2021-08-03T13:31:40,204 ERROR ContextLoader,ServerService Thread Pool -- 206:313 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jrioForwardingFilter' defined in ServletContext resource [/WEB-INF/applicationContext-jrio-web.xml]: Cannot resolve reference to bean 'jwtTokenProvider' while setting bean property 'tokenProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenProvider' defined in ServletContext resource [/WEB-INF/applicationContext-security-jwt.xml]: Cannot create inner bean 'com.jaspersoft.ji.security.jwt.KeystoreJwtKeyFactory#4f93b4ef' of type [com.jaspersoft.ji.security.jwt.KeystoreJwtKeyFactory] while setting bean property 'key'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.jaspersoft.ji.security.jwt.KeystoreJwtKeyFactory#4f93b4ef': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No valid key alias or key present for jwtSecret configuration.
    

    How to avoid this error?

    Solution:

    It's not entirely clear why this error happens, it's a very rare one. Should you get it, if you're not using integration with JRIO you can comment 'tokenProvider' property in applicationContext-jrio-web.xml and 'key' property for bean 'jwtTokenProvider' in applicationContext-security-jwt.xml file and restart. The impact of commenting these out is zero unless you're planning to integrate with JRIO.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...