在Websphere上使用Aspectj

Vis*_*ish 4 websphere spring aspectj java-ee

我们在Spring源工具套件中使用Aspectj编译时加载..当我们尝试在websphere服务器上部署这个项目时,我们得到了以下异常.这个项目在tomcat服务器上工作得很好..库存在一些问题AspectJ编译器已经存在于Spring Source Tool中.

Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions
(1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'exceptionProp' threw exception; nested exception is java.lang.NoSuchMethodError:   org/aspectj/runtime/internal/AroundClosure.linkClosureAndJoinPoint(I)
Lorg/aspectj/lang/ProceedingJoinPoint
Run Code Online (Sandbox Code Playgroud)

小智 6

WebSphere附带了它自己的AspectJ Runtime版本.它安装在:

基地_ $ {}版本/lib/aspectjrt.jar

将类加载器顺序从"父级第一个"翻转到"父级最后"将不起作用 - 您将不得不采用不同的路径.

  1. 创建共享库(在WebSphere管理控制台中)
  2. 将您的AspectJ版本添加到此共享库中
  3. 为您的应用程序或服务器创建一个新的类加载器,并将此类加载器附加到它.

有关如何做到这一点的说明可以在IBM的网站上找到:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tcws_sharedlib.html