2011-12-23 84 views
2

我們使用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之間的事情......問題

回答

相關問題