【问题标题】:AspectJ: Issue on Weblogic 12AspectJ:Weblogic 12 上的问题
【发布时间】:2015-12-20 08:50:30
【问题描述】:

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

  • JDK 1.7
  • AspectJ 1.7
  • Weblogic 12.1.3

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

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

方面sn-p如下:
@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 */ } }

现在,如果您有任何有意义的点来喂我,我很高兴地期待。


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

【问题讨论】:

    标签: java-8 aspectj weblogic12c aspectj-maven-plugin


    【解决方案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

    【讨论】:

    • 您可以接受自己的答案以结束问题。
    猜你喜欢
    • 2012-08-20
    • 1970-01-01
    • 1970-01-01
    • 2019-03-08
    • 1970-01-01
    • 2020-04-27
    • 2022-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多