Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4052

NPE in RepositoryClassLoader when loading BouncyCastle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.0.5.GA
    • ClassLoading
    • None
    • Hide

      restart the appserver.

      Show
      restart the appserver.

      Occasionally, I will get the exception below when trying to load the bouncy castle library. One would think it is a problem in BC, except for the fact that the NPE is clearly coming from JBoss's RepositoryClassLoader.

      The hard part about this bug is that it happens some of the time and not other times. It's been impossible to reliably reproduce. Restarting the appserver/jvm causes the problem to go away and everything works just fine, but eventually it will happen again.

      BC is being started in a @Service Bean. The start() method looks like this:

      public void start() throws Exception

      { Security.addProvider(new BouncyCastleProvider()); }

      Has anyone else seen this problem?

      Caused by: java.security.NoSuchAlgorithmException: No such algorithm: AES/CBC/PKCS5Padding
      at javax.crypto.Cipher.getInstance(DashoA13*..)
      at javax.crypto.Cipher.getInstance(DashoA13*..)
      at com.kink.heart.biz.system.EncryptorBean.encrypt(EncryptorBean.java:349)
      ... 73 more
      Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: AES, provider: BC, class: org.bouncycastle.jce.provider.JCEBlockCipher$AES)
      at java.security.Provider$Service.newInstance(Provider.java:1201)
      ... 76 more
      Caused by: java.lang.NullPointerException
      at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:620)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.security.Provider$Service.getImplClass(Provider.java:1218)
      at java.security.Provider$Service.newInstance(Provider.java:1176)
      ... 76 more

              starksm64 Scott Stark (Inactive)
              whichever Jon Stevens (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: