我们使用AspectJ(1.6.12)编织第三方库类(SpringBeanELResolver)。我们使用<context:load-time-weaver/>
启用LTW,而我们的方面使用AspectJ注释配置。在Jetty的一切工作正常,在Aspectj的调试输出中看到的类的完整列表。正如Spring上所记录的,我们不使用-javaagent,因为它在Websphere平台上不需要。加载时间在Websphere 8上使用Aspectj编织第三方类使用Aspectj
在Websphere 8上,我们看到Spring正确初始化日志WebSphereLoadTimeWeaver
,Aspectj正确初始化。 但我们只看到了aspectj调试输出的一部分类。 SpringBeanELResolver也不包括在编织中。因此,我们班不编织。
我们可以编排调试输出上列出的类,例如我们的课程..
我们将Classloading策略配置为PARENT_LAST。
下面是一些日志和配置:
的Websphere SystemErr(大多数第三方类都没有在这里看到,包括SpringBeanELResolver)
00000022 SystemErr R [[email protected]] info AspectJ Weaver Version 1.6.12 built on Tuesday Oct 18, 2011 at 17:52:06 GMT
00000022 SystemErr R [[email protected]] info register classloader [email protected]
00000022 SystemErr R [[email protected]] info using configuration <path-to-ear>/our_war.ear/our.war/WEB-INF/classes/META-INF/aop.xml
00000022 SystemErr R [[email protected]] info register aspect com.ourcompany.OurAspect
00000022 SystemErr R [[email protected]] debug not weaving 'org.springframework.instrument.classloading.websphere.WebSphereClassPreDefinePlugin$Dummy'
00000022 SystemErr R [[email protected]] debug not weaving 'org.apache.myfaces.shared_orchestra.util.ClassUtils'
00000022 SystemErr R [[email protected]] debug not weaving 'org.apache.myfaces.orchestra.conversation.annotations.ConversationRequire'
...
的Websphere SystemOut
00000022 DefaultContex I org.springframework.context.weaving.DefaultContextLoadTimeWeaver setBeanClassLoader Determined server-specific load-time weaver: org.springframework.instrument.classloading.websphere.WebSphereLoadTimeWeaver
aop.xml文件
<!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>
我认为CompoundClassLoader可能加载所有第三方库在WEB-INF/lib或, 是AspectJ和CompoundClassLoader之间的事情......问题