Spring Загрузка и @ComponentScan между двумя банками

У меня есть 2 проекта. Один из них - проект DAL, который выполняет операции CRUD в базе данных neo4j с использованием API spring neo4j. Этот проект упакован как банка и включен в проект №2. Проект №2 - это проект spring restful services, который использует загрузку spring для упаковки и создает исполняемую банку, которая запускается на встроенном сервере tomcat.

При попытке запустить исполняемую банку, созданную для меня spring, я получаю это исключение. ожидаемый как минимум 1 bean, который квалифицируется как кандидат на автоподключение для этой зависимости. Аннотации зависимостей: {@org.springframework.beans.factory.annotation.Autowired(required = true)}

Основываясь на моем чтении, если я использую @ComponentScan, я могу предоставить каталоги аннотаций для просмотра. Поэтому я даю ему базовый каталог для моего проекта служб. И я даю ему базовый каталог для моего включенного DAL.jar, но до сих пор не повезло, вот как выглядит аннотация.

Извлечен из комментариев:

Объявление сканирования компонентов

@ComponentScan({"com.foo.dal.*","com.foo.notification.*"})

StackTrace:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pushCommandsController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.teradata.dal.example.PushRepository com.teradata.notification.rest.controller.PushCommandsController.repository; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.teradata.dal.example.PushRepository] found for dependency:
expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

UPDATE:

на основе ответа @chrylis: Сделано изменение на @ComponenetScan

@ComponentScan({"com.teradata.notification","com.teradata.dal"})

работает в:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.boot.autoconfigure.MessageSourceAutoConfiguration' is defined

ПОДРОБНАЯ ИНФОРМАЦИЯ О ПРОЕКТЕ DAL И ПРОЕКТЕ ОБСЛУЖИВАНИЯ:

ПРОЕКТ DAL:

DAL project structure


DAL classes


DAL classes


DAL classes


DAL classes


Проект служб:

Service project structure


Service classes


Service classes


Service classes

Ответы

Ответ 1

Аргумент @ComponentScan - это имя пакета, и эти строки не являются допустимыми пакетами. Отбросьте .* от них; Spring автоматически сканирует подпакеты.