|
|
|
Spring AOP (XML-based)
|
|||
|---|---|---|---|
|
#18+
Изучаю Spring AOP (Schema-based), пытаюсь передать значение параметра в метод «Before advice». По непонятным причинам получаю ошибку «BeanCreationException: Error creating bean with name ...» Делаю так: Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. Аспект: Код: java 1. 2. 3. 4. 5. 6. 7. Сообщение об ошибке: WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:278) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at or .................................................................................................................. В чем причина ошибки ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.02.2018, 19:05 |
|
||
|
Spring AOP (XML-based)
|
|||
|---|---|---|---|
|
#18+
Изучение docs.spring.io помогло выяснить, что причина ошибки состояла в том, что в «expression» надо было символ «+» заменить на «and», т.е pointcut должен быть такой: Код: xml 1. 2. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.02.2018, 20:05 |
|
||
|
|

start [/forum/topic.php?fid=59&gotonew=1&tid=2122216]: |
0ms |
get settings: |
10ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
151ms |
get topic data: |
12ms |
get first new msg: |
7ms |
get forum data: |
3ms |
get page messages: |
42ms |
get tp. blocked users: |
2ms |
| others: | 273ms |
| total: | 518ms |

| 0 / 0 |

Извините, этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
... ля, ля, ля ...