私はこの例を実行しようとしています: https://spring.io/guides/gs/accessing-data-neo4j/ ビルドツールとしてMavenを使用しています。 以下のようなエラーが表示されます。neo4j:依存関係のためにタイプの修飾Beanが見つかりません
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli) on project gs-accessing-data-neo4j: An exception occurred while running. null: InvocationTargetException: Error creating bean with name 'demo' defined in hello.Application: Unsatisfied dependency expressed through constructor argument with index 0 of type [hello.PersonRepository]: No qualifying bean of type [hello.PersonRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [hello.PersonRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {} -> [Help 1]
問題は何ですか?
これは私のPersonRepository.javaファイルです:あなたは慎重にチュートリアルを読めば、あなたが表示されます
package hello;
import java.util.List;
import org.springframework.data.neo4j.config.EnableNeo4jRepositories;
import org.springframework.data.repository.CrudRepository;
@EnableNeo4jRepositories(basePackageClasses=CrudRepository.class)
public interface PersonRepository extends CrudRepository<Person, String>
{
Person findByName(String name);
List<Person> findByTeammatesName(String name);
}