[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] Not Found the target class when weaving
|
I use the -javaagent way to weave when class is loaded. My aspect code is in
the jar myaspect.jar . The server is Websphere 7.
The aspect source is the following:
public aspect MyAspect {
private pointcut myMessage() : execution(* *onMessage(*));
before () : myMessage() {
FileOutputStream out = null;
try {
out = new FileOutputStream(new File("C:/test.txt"));
out.write("hello, this is a test to intercepter mdb".getBytes());
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
the aop.xml is the following:
<aspectj>
<weaver options="-verbose -Xreweavable">
<include within="com.temenos.tocf.delivery.mdb.DeliveryMDB"/>
<include within="com.temenos.tocf.listener.mdb.TOCFListenerMDB"/>
<include within="com.temenos.tocf.ofsmessage.OFSMessageMDB"/>
</weaver>
<aspects>
<aspect name="xib.mdb.aspect.MyAspect"/>
</aspects>
</aspectj>
The target Class is three Message Drive Bean.They are
DeliveryMDB,TOCFListenerMDB,OFSMessageMDB
I want to modify the onMessage method of every MDB.
I store the aspect jar named myaspect.jar in %WAS_HOME%\AppServer\lib
Directory.
But the weaving operation doesn't happend.
SystemErr.log show:
R [CompoundClassLoader@12cf12cf] info AspectJ Weaver Version 1.6.11 built
on Tuesday Mar 15, 2011 at 15:31:04 GMT
[10-9-27 15:06:15:656 CST] 00000013 SystemErr R
[CompoundClassLoader@12cf12cf] info register classloader
com.ibm.ws.classloader.CompoundClassLoader@12cf12cf
[10-9-27 15:06:15:656 CST] 00000013 SystemErr R
[CompoundClassLoader@12cf12cf] info using configuration file:/D:/Program
Files/IBM/WebSphere/AppServer/lib/myaspect.jar!/META-INF/aop.xml
[10-9-27 15:06:15:656 CST] 00000013 SystemErr R
[CompoundClassLoader@12cf12cf] info register aspect xib.mdb.aspect.MyAspect
[10-9-27 15:06:15:656 CST] 00000013 SystemErr R
[CompoundClassLoader@12cf12cf] info weaver operating in reweavable mode.
Need to verify any required types exist.
[10-9-27 15:06:16:140 CST] 00000012 SystemErr R
[CompoundClassLoader@1cac1cac] info AspectJ Weaver Version 1.6.11 built on
Tuesday Mar 15, 2011 at 15:31:04 GMT
[10-9-27 15:06:16:140 CST] 00000012 SystemErr R
[CompoundClassLoader@1cac1cac] info register classloader
com.ibm.ws.classloader.CompoundClassLoader@1cac1cac
[10-9-27 15:06:16:140 CST] 00000012 SystemErr R
[CompoundClassLoader@1cac1cac] info using configuration file:/D:/Program
Files/IBM/WebSphere/AppServer/lib/myaspect.jar!/META-INF/aop.xml
[10-9-27 15:06:16:140 CST] 00000012 SystemErr R
[CompoundClassLoader@1cac1cac] info register aspect xib.mdb.aspect.MyAspect
[10-9-27 15:06:16:140 CST] 00000012 SystemErr R
[CompoundClassLoader@1cac1cac] info weaver operating in reweavable mode.
Need to verify any required types exist.
[10-9-27 15:06:19:593 CST] 00000014 SystemErr R
[ReflectLoaderJava2@6ed56ed5] info AspectJ Weaver Version 1.6.11 built on
Tuesday Mar 15, 2011 at 15:31:04 GMT
[10-9-27 15:06:19:593 CST] 00000014 SystemErr R
[ReflectLoaderJava2@6ed56ed5] info register classloader
org.apache.derby.impl.services.reflect.ReflectLoaderJava2@6ed56ed5
[10-9-27 15:06:19:593 CST] 00000014 SystemErr R
[ReflectLoaderJava2@6ed56ed5] info using configuration file:/D:/Program
Files/IBM/WebSphere/AppServer/lib/myaspect.jar!/META-INF/aop.xml
[10-9-27 15:06:19:593 CST] 00000014 SystemErr R
[ReflectLoaderJava2@6ed56ed5] info register aspect xib.mdb.aspect.MyAspect
[10-9-27 15:06:19:593 CST] 00000014 SystemErr R
[ReflectLoaderJava2@6ed56ed5] info weaver operating in reweavable mode.
Need to verify any required types exist.
[10-9-27 15:06:21:296 CST] 00000014 SystemErr R
[WarFileDynamicClassLoader@100c100c] info AspectJ Weaver Version 1.6.11
built on Tuesday Mar 15, 2011 at 15:31:04 GMT
[10-9-27 15:06:21:296 CST] 00000014 SystemErr R
[WarFileDynamicClassLoader@100c100c] info register classloader
org.eclipse.jst.j2ee.commonarchivecore.internal.util.WarFileDynamicClassLoader@100c100c
[10-9-27 15:06:21:296 CST] 00000014 SystemErr R
[WarFileDynamicClassLoader@100c100c] info using configuration
file:/D:/Program
Files/IBM/WebSphere/AppServer/lib/myaspect.jar!/META-INF/aop.xml
[10-9-27 15:06:21:296 CST] 00000014 SystemErr R
[WarFileDynamicClassLoader@100c100c] info register aspect
xib.mdb.aspect.MyAspect
[10-9-27 15:06:21:296 CST] 00000014 SystemErr R
[WarFileDynamicClassLoader@100c100c] info weaver operating in reweavable
mode. Need to verify any required types exist.
[10-9-27 15:09:22:703 CST] 0000001f SystemErr R
[URLClassLoader@1d431d43] info AspectJ Weaver Version 1.6.11 built on
Tuesday Mar 15, 2011 at 15:31:04 GMT
[10-9-27 15:09:22:703 CST] 0000001f SystemErr R
[URLClassLoader@1d431d43] info register classloader
java.net.URLClassLoader@1d431d43
[10-9-27 15:09:22:703 CST] 0000001f SystemErr R
[URLClassLoader@1d431d43] info using configuration file:/D:/Program
Files/IBM/WebSphere/AppServer/lib/myaspect.jar!/META-INF/aop.xml
[10-9-27 15:09:22:703 CST] 0000001f SystemErr R
[URLClassLoader@1d431d43] info register aspect xib.mdb.aspect.MyAspect
[10-9-27 15:09:22:718 CST] 0000001f SystemErr R
[URLClassLoader@1d431d43] info weaver operating in reweavable mode. Need to
verify any required types exist.
It seems that the target class can't be found when weaving. I think maybe
the directory of aspecjt jar is wrong.
Where should I store the aspect jar?
--
View this message in context: http://aspectj.2085585.n4.nabble.com/Not-Found-the-target-class-when-weaving-tp3846357p3846357.html
Sent from the AspectJ - users mailing list archive at Nabble.com.