Summary: | [docs] Strange errors wheb jdom-b9.jar is in classpath | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Koen Muilwijk <pmuilwij> |
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> |
Status: | NEW --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 1.2.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Koen Muilwijk
2005-03-23 08:20:19 EST
The problem seemed to be caused by version problems between the different jdom versions. The nl.uu.retrieval package is compiled with jdom.jar. The actual object passed to StoreNode is an extension of a jdom.Element ant implements nl.uu.retrieval.IInfoNode. It seems that the class veriefier expected a different version (from jdom-b9.jar) then was actually passed (from jdom.jar). But the error message is very confusing. Maybe the aspectj compiler can check for these kind of version problems at compile time? That would make it easier to fix the problem then such cryptic runtime exceptions. Just to check I've understood the scenario correctly... which version of jdom did you have on the classpath when weaving your application? Sounds like it was jdom.jar? And then at runtime you replaced jdom.jar with jdom-b9.jar (or at least had jdom-b9.jar ahead of jdom.jar in your classpath)? Then the problem arises that there is an incompatible class change between the jdom and jdom-b9 libraries, and this is detected at runtime but with a confusing error message? (I don't see how we could put out a compile-time warning for a library change that will happen at some later point and of which we have no knowledge when compiling???) Yep, you are completly right. It will be almost impossible to provide a nice solution for this problem since you can only detect it at runtime. A possible solution is to include exception handling code into the woven code that catches this exception and gives a better error description. But this would probably have to much overhead. However, it might be useful to include this problem into the documentation or FAQ. Then will make it easier for others who run into similar problems to solve the problem. It took me quite some time to find this solution as I couldn't find any docs on it. a possible doc enhancement once we've cleared the decks for 1.5.0... |