둘러보기 생략.
 

AOP의 XML based AOP 사용시, Pattern Matching 문법 문제..

<bean id="messagePrinter" class="com.sds.emp.common.aspect.MessagePrinter" />

<aop:config>
<aop:pointcut id="printMethod" expression="execution(* com.sds.emp..*ServiceImpl.*(..) || samsungfund.pool.test..*ServiceImpl.*(..))" />
<aop:aspect ref="messagePrinter">
<aop:before method="printM" pointcut-ref="printMethod" />
</aop:aspect>
</aop:config>

위와 같이, 2개 혹은 그 이상의 패키지들을 동시에 넣으려고 하는 경우 에러가 발생합니다.
물론, config를 하나 더 만들어서 pointcut id를 printMethod2 이렇게 주고 해도 가능하지만, 여러개가 될 경우 지저분해 보일 가능성이 있어서,
위와 같은 경우 어떻게 해야 하나의 config 안에 여러개의 패키지를 넣을 수 있는지 궁금합니다.

아래는 발생한 에러메시지입니다.

--------------- nested within: ------------------
weblogic.management.ManagementException: - with nested exception:
[weblogic.management.DeploymentException:
Exception:weblogic.management.ApplicationException: start() failed.
Module: PoolNewApps-web Error: weblogic.management.DeploymentException: Error creating bean with name 'messageSource' defined in ServletContext resource [/WEB-INF/config/spring/common/context-common.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#2': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 44
execution(* com.sds.emp..*ServiceImpl.*(..) || samsungfund.pool.test..*ServiceImpl.*(..))
^^
- with nested exception:
[java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 44
execution(* com.sds.emp..*ServiceImpl.*(..) || samsungfund.pool.test..*ServiceImpl.*(..))
^^
]
]
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2414)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:884)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:592)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:501)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>

도움말씀 부탁드리겠습니다.

안녕하세요.

execution(* com.sds.emp..*ServiceImpl.*(..) || samsungfund.pool.test..*ServiceImpl.*(..))

위 구문은 문법에 맞지 않습니다.

pointcut이 여러개일 경우 각각의 pointcut 대한 요소를 따로 정의해야합니다.

execution(* com.sds.emp..*ServiceImpl.*(..)) || execution (* samsungfund.pool.test..*ServiceImpl.*(..))

이렇게 변경하여 작성하시면 됩니다.