Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-1878

IsInWhiteList matcher report No qualifying bean of type [org.apache.james.util.sql.JDBCUtil] found for dependency

    XMLWordPrintableJSON

    Details

    • Flags:
      Patch

      Description

      umcomments mailetcontainer.xml line 281 to add the WhiteList function
      report error as below

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.james.transport.matchers.IsInWhiteList': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.apache.james.transport.matchers.AbstractSQLWhitelistMatcher.setJdbcUtil(org.apache.james.util.sql.JDBCUtil); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.james.util.sql.JDBCUtil] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:298)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1148)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:336)
      at org.apache.james.container.spring.bean.factory.mailetcontainer.AbstractLoaderBeanFactory.load(AbstractLoaderBeanFactory.java:47)
      at org.apache.james.container.spring.bean.factory.mailetcontainer.MatcherLoaderBeanFactory.getMatcher(MatcherLoaderBeanFactory.java:45)
      ... 29 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.apache.james.transport.matchers.AbstractSQLWhitelistMatcher.setJdbcUtil(org.apache.james.util.sql.JDBCUtil); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.james.util.sql.JDBCUtil] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:295)
      ... 35 more
      Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.james.util.sql.JDBCUtil] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:997)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:867)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:779)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:575)
      ... 37 more

      this is because the jdbcUtil can't be Inject at line 78 at AbstractSQLWhitelistMatcher.java.
      I check those jdbcUtil is setup as below

      protected final JDBCUtil jdbcUtil = new JDBCUtil() {
      protected void delegatedLog(String logString)

      Unknown macro: { log("JDBCAlias}

      };

      But only this place is Inject.
      So I think we should change it to as others.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              luo877280 leviluo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

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