Spring引导创建bean错误

时间:2016-08-09 05:19:09

标签: java spring spring-boot stack-trace

我有错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstracException in thread "main" tBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 common frames omitted
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.jaorg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.Auctiva:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 common frames omitted

onIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 more
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 more

AuctionQueryController.java:

code

AuctionService.java:

code

AuctionIndexRepository.java:

code

昨天一切都很好,这肯定是一个小错误,但我无法辨认。如果你需要查看要写的文件,我会添加它。

AuctionIndexRepository中的问题解决我认为我在网络中点击生成方法或类似的东西,因为这种方法是不必要的。

所以AuctionIndexRepository应该如下所示:

package pl.bpo.archiwumallegro.repositories;

import org.springframework.data.elasticsearch.core.FacetedPage;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import pl.bpo.archiwumallegro.model.index.auctions.AuctionIndex;

public interface AuctionIndexRepository extends ElasticsearchRepository<AuctionIndex, Integer> {

}

谢谢你的有趣!

3 个答案:

答案 0 :(得分:1)

stacktrace中的最后一个嵌套异常是:

Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)

您的一个Spring Data类中有一个查询应该返回FacetedPage,我认为它实现了org.springframework.data.domain.Page接口。在这种情况下,Spring Data要求您的方法具有org.springframework.data.domain.Pageable类型的参数。

您可以在Spring Data Docs

中找到更多信息

答案 1 :(得分:0)

由于多个属性的构造函数中的@Autowired,可能存在该错误。

所以尝试@Autowired以下任何一个

  1. Setter方法
  2. 声明属性。
  3. 设置方法

     public class Class {     
    
       private MyClass myClass;
    
       @Autowired
    
       public void setMyClass ( MyClass myClass){
    
         this.spellChecker = myClass;
       }
    
       public MyClass getMyClass ( ) {
    
         return myClass;
       }
    
       public void yourrMehod() {
    
          myClass.methodCalling();
    
       }
    
    }
    

    声明属性。

        public class Class {     
           @Autowired
           private MyClass myClass;
    
           public void yourrMehod() {
    
              myClass.methodCalling();
    
            }
    
         }
    

答案 2 :(得分:0)

这可能是因为您进行了错误的Pageable导入, 检查您的导入是否为: 导入org.springframework.data.domain.Pageable;

,不能从java.awt.print中进行分页