0

我使用以下配置开发了一个 Java EE 应用程序:

  • JDK 1.7
  • 方面J 1.7
  • 网络逻辑 12.1.3

但是,在将配置升级到以下配置后,所有带有“调用”通配符的方面都无法正常工作,因此,现在无法触及已经命中的连接点:

  • JDK 版本:1.8.0_66
  • AspectJ 版本:1.8.7
  • 应用服务器:Weblogic 12.2.1

方面片段如下:
@Before("call(public * com.gam.commons.core.api.services.Service+.(..)) && within(com.gam.calendar.biz.service.internal.impl.)") public void handle(JoinPoint thisJoinPoint) {
Class declaringType = thisJoinPoint.getSignature().getDeclaringType(); if (declaringType.isInterface()) { UserProfileTO userProfileTO = ((AbstractService) thisJoinPoint.getThis()).getUserProfileTO();/* Caller or this / ((Service) thisJoinPoint.getTarget()).setUserProfileTO(userProfileTO);/ Callee or target */ } }

现在,我很高兴地期待你有什么有意义的观点来喂养我。


注意:我的问题是由于其他原因造成的,请查看我的回答以收集有关该问题的更多信息。

4

1 回答 1

1

我犯了一个错误,因为我的问题完全是由于其他原因。当我更新我的项目以由 JDK 1.8.0_66 编译时,我应该重新配置 aspect-maven-plugin 以与此升级兼容。幸运的是,我的问题已经通过在pom文件上重新配置相应的插件解决了,如下:

<plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>aspectj-maven-plugin</artifactId>
       <version>1.8</version>
       <dependencies>
           <dependency>
               <groupId>org.aspectj</groupId>
               <artifactId>aspectjrt</artifactId>
               <version>1.8.7</version>
           </dependency>
           <dependency>
               <groupId>org.aspectj</groupId>
               <artifactId>aspectjtools</artifactId>
               <version>1.8.7</version>
           </dependency>
        </dependencies>
        <configuration>                        
            <complianceLevel>1.8</complianceLevel>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                    <goal>test-compile</goal>                               
                </goals>
            </execution>
        </executions>
    </plugin>

有关“aspectj-maven-plugin”的更多信息,请访问aspectj-maven-plugin

于 2015-12-21T12:12:16.150 回答