Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-321

NPE if custom interceptor is created from xml configuration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.0.0.CR4
    • 4.0.0.CR3
    • Configuration
    • None
    • Compatibility/Configuration
    • Workaround Exists
    • Hide

      Propsed bugfix in CustomInterceptorConfig:

      /**

      • Returns a the interceptor that we want to add to the chain.
        */
        public synchronized CommandInterceptor getInterceptor() {
        if (interceptor == null)
        Unknown macro: { try { interceptor = (CommandInterceptor) Class.forName(className).newInstance(); } catch (Exception e) { throw new ConfigurationException("Cannot create instance of " + className, e); } }

        return interceptor;
        }

      Show
      Propsed bugfix in CustomInterceptorConfig: /** Returns a the interceptor that we want to add to the chain. */ public synchronized CommandInterceptor getInterceptor() { if (interceptor == null) Unknown macro: { try { interceptor = (CommandInterceptor) Class.forName(className).newInstance(); } catch (Exception e) { throw new ConfigurationException("Cannot create instance of " + className, e); } } return interceptor; }
    • Low

      Add to config something like this:

      <customInterceptors>
      <interceptor after="org.infinispan.interceptors.CacheLoaderInterceptor" class="com.devexperts.PersistenceInterceptor"/>
      </customInterceptors>

      and it will fail Caused by: java.lang.NullPointerException
      at org.infinispan.interceptors.InterceptorChain.addInterceptorAfter(InterceptorChain.java:193)
      at org.infinispan.factories.InterceptorChainFactory.buildCustomInterceptors(InterceptorChainFactory.java:161)
      at org.infinispan.factories.InterceptorChainFactory.buildInterceptorChain(InterceptorChainFactory.java:143)
      at org.infinispan.factories.InterceptorChainFactory.construct(InterceptorChainFactory.java:177)

              manik_jira Manik Surtani (Inactive)
              kosiakk_jira Alexander Kosenkov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified