Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-6409

Internal Key Bindings page throws exceptions when there's a crypto token error

    Details

    • Issue discovered during:
      Review
    • Sprint:
      EJBCA Sprint 4

      Description

      The Internal Key Bindings page logs an exception when there's a crypto token error, and e.g. when you set the default responder.
      It appears that getCryptoTokenInfos needs better error handling.

      Stack trace:

      2017-12-12 08:19:02,733 ERROR [org.cesecore.keys.token.CryptoTokenFactory] (default task-26) Error initializing Crypto Token. Classpath=org.cesecore.keys.token.PKCS11CryptoToken: org.cesecore.keys.token.CryptoTokenOfflineException: Error when creating Crypto Token with ID 1388054472.
              at org.cesecore.keys.token.p11.P11Slot.getInstance(P11Slot.java:231)
              at org.cesecore.keys.token.p11.P11Slot.getInstance(P11Slot.java:181)
              at org.cesecore.keys.token.p11.P11Slot.getInstance(P11Slot.java:160)
              at org.cesecore.keys.token.PKCS11CryptoToken.init(PKCS11CryptoToken.java:110)
              at org.cesecore.keys.token.CryptoTokenFactory.createCryptoToken(CryptoTokenFactory.java:177)
              at org.cesecore.keys.token.CryptoTokenSessionBean.getCryptoToken(CryptoTokenSessionBean.java:100)
              at sun.reflect.GeneratedMethodAccessor617.invoke(Unknown Source)
      [...]
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
              at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
              at org.cesecore.keys.token.CryptoTokenSessionLocal$$$view233.getCryptoToken(Unknown Source)
              at org.cesecore.keys.token.CryptoTokenManagementSessionBean.getCryptoTokenInfo(CryptoTokenManagementSessionBean.java:127)
              at org.cesecore.keys.token.CryptoTokenManagementSessionBean.getCryptoTokenInfos(CryptoTokenManagementSessionBean.java:119)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [...]
              at org.cesecore.keys.token.CryptoTokenManagementSessionLocal$$$view258.getCryptoTokenInfos(Unknown Source)
              at org.ejbca.ui.web.admin.keybind.InternalKeyBindingMBean.getAvailableCryptoTokens(InternalKeyBindingMBean.java:1028)
              at org.ejbca.ui.web.admin.keybind.InternalKeyBindingMBean.flushCurrentCache(InternalKeyBindingMBean.java:793)
              at org.ejbca.ui.web.admin.keybind.InternalKeyBindingMBean.getCurrentInternalKeyBindingId(InternalKeyBindingMBean.java:775)
              at org.ejbca.ui.web.admin.keybind.InternalKeyBindingMBean.isAllowedToEdit(InternalKeyBindingMBean.java:828)
              at org.ejbca.ui.web.admin.keybind.InternalKeyBindingMBean.isForbiddenToEdit(InternalKeyBindingMBean.java:833)
              at sun.reflect.GeneratedMethodAccessor696.invoke(Unknown Source)
      [...]
      Caused by: <whatever cryptotoken / PKCS#11 exception>
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samuel Samuel Lidén Borell
                Reporter:
                samuel Samuel Lidén Borell
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: