Spring 使用Aspectj在WebSphere8上加载时编织第三方类

Spring 使用Aspectj在WebSphere8上加载时编织第三方类,spring,websphere,aspectj,load-time-weaving,websphere-8,Spring,Websphere,Aspectj,Load Time Weaving,Websphere 8,我们使用AspectJ1.6.12编写第三方库类SpringbeanlResolver。我们使用启用LTW,方面使用AspectJ注释配置。jetty上的一切都很好,在Aspectj的调试输出中可以看到完整的类列表。正如Spring上的文档所述,我们不使用-javaagent,因为在Websphere平台上不需要它 在WebSphere8上,我们看到Spring正确初始化WebSphereLoadTimeWeaver的日志,Aspectj正确初始化。但我们在aspectj的调试输出上只看到了一部

我们使用AspectJ1.6.12编写第三方库类SpringbeanlResolver。我们使用启用LTW,方面使用AspectJ注释配置。jetty上的一切都很好,在Aspectj的调试输出中可以看到完整的类列表。正如Spring上的文档所述,我们不使用-javaagent,因为在Websphere平台上不需要它

在WebSphere8上,我们看到Spring正确初始化WebSphereLoadTimeWeaver的日志,Aspectj正确初始化。但我们在aspectj的调试输出上只看到了一部分类。SpringBeanELResolver也不包括在织造中。因此,我们的班级不是编织的

我们可以编织调试输出上列出的类,例如我们的类

我们最后将类加载策略配置为PARENT_

以下是一些日志和配置:

WebSphereSystemErr大多数第三方类在这里都没有看到,包括SpringBeanELResolver

aop.xml

我认为CompoundClassLoader在加载WEB-INF/lib中的所有第三方库时可能会遇到问题,或者,
它是Aspectj和CompoundClassLoader之间的东西…

因为我所有的Java类都在${src.dir}中,所以我给iajc一个源代码列表。在源代码列表中只有一行


因为我所有的Java类都在${src.dir}中,所以我给了iajc一个源代码列表。在源代码列表中只有一行

00000022 SystemErr     R [CompoundClassLoader@1293b09] info AspectJ Weaver Version 1.6.12 built on Tuesday Oct 18, 2011 at 17:52:06 GMT
00000022 SystemErr     R [CompoundClassLoader@1293b09] info register classloader com.ibm.ws.classloader.CompoundClassLoader@1293b09
00000022 SystemErr     R [CompoundClassLoader@1293b09] info using configuration <path-to-ear>/our_war.ear/our.war/WEB-INF/classes/META-INF/aop.xml
00000022 SystemErr     R [CompoundClassLoader@1293b09] info register aspect com.ourcompany.OurAspect
00000022 SystemErr     R [CompoundClassLoader@1293b09] debug not weaving 'org.springframework.instrument.classloading.websphere.WebSphereClassPreDefinePlugin$Dummy'
00000022 SystemErr     R [CompoundClassLoader@1293b09] debug not weaving 'org.apache.myfaces.shared_orchestra.util.ClassUtils'
00000022 SystemErr     R [CompoundClassLoader@1293b09] debug not weaving 'org.apache.myfaces.orchestra.conversation.annotations.ConversationRequire'

...
00000022 DefaultContex I org.springframework.context.weaving.DefaultContextLoadTimeWeaver setBeanClassLoader Determined server-specific load-time weaver: org.springframework.instrument.classloading.websphere.WebSphereLoadTimeWeaver
<!DOCTYPE aspectj PUBLIC
        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <weaver options="-showWeaveInfo -verbose -debug">
        <!-- only weave classes in packages below-->
        <include within="org.springframework.beans.factory.access.el.*"/>
        <include within="com.ourcompany.*"/>
    </weaver>
    <aspects>
        <!-- weave in just this aspect -->
        <aspect name="com.ourcompany.OurAspect"/>
    </aspects>
</aspectj>