Community
Participate
Working Groups
getting below warning at the time of server start-up. I have only one aop.xml file and that too I commented the content of it still I am getting this warning. [GenericClassLoader@13c35a2] warning ignoring duplicate definition: zip:/export/home/oracle/bea/user_projects/domains/testServDom/servers/testServ/tmp/_WL_user/inventory/yoh5jv/APP-INF/lib/mslv-aop-filter.jar!/META-INF/aop.xml [GenericClassLoader@13c35a2] warning ignoring duplicate definition: zip:/export/home/oracle/bea/user_projects/domains/testServDom/servers/testServ/tmp/_WL_user/inventory/yoh5jv/APP-INF/lib/mslv-core.jar!/META-INF/aop-ajc.xml Environment: Appserver : weblogic 9.2 MP3 AspectJ : 1.6.1 DB : Oracle 11gR2. OS : Linux/windowsXP.
AspectJ is making a findResources call against the classloader that has been assigned to it, in order to discover all aop.xml files. If you have the same jar on the classpath twice, that would cause this message. It isn't a problem, it is just informational really. If it isn't easy for you to discover why there is duplication, we may have to turn on trace to get out the classpath being used by the loader, which should make it more obvious.
But we are getting this issue only from 1.6.1. Previously we were using 1.5.2a version, we never get this warning but when we started using 1.6.1 we are facing this issue. Are there any changes regarding this in 1.6.1 version. Anyway we are checking our classpath for the duplicate entries of our jar files.
I could imagine that warning is new between 1.5.2 and 1.6.1 - I will check for certain.
I have checked for the duplicate entries of jar files which are using aop.xml files in our product, I couldnot see any duplicate entries. So duplicate entries in classpath may be very less chance I guess.
The code is as simple as: Enumeration xmls = getClassLoader().getResources(name); // where name="aop.xml" Set seenBefore = new HashSet(); while (xmls.hasMoreElements()) { URL xml = (URL) xmls.nextElement(); if (!seenBefore.contains(xml)) { info("using configuration " + weavingContext.getFile(xml)); definitions.add(DocumentParser.parse(xml)); seenBefore.add(xml); } else { warn("ignoring duplicate definition: " + xml); } } which suggests getResources() returned two identical aop.xmls. The getResources() call will not only be looking at the classpath of the classloader in question, but it will also be able to see aop.xmls accessible through the parent class loader. I have checked the commit date and that check was not in AspectJ 1.5.2a As I say it does not real harm - we don't even parse the duplicates so there it is not expensive if they are found.
Is there anyway that I can avoid this warning by configuring in my environment. Can you provide some patch on this issue. Because we dont want to see such warinigs at the time of installation of our product. Please suggest the best for us.
i'll try and add a config flag to turn it off in 1.6.8. Then if you want to ignore what it is saying, you can.
unsetting the target field which is currently set for something already released