Community
Participate
Working Groups
I got this exception while working on a static inner aspect. A full rebuild avoided the problem. java.lang.ClassCastException: org.aspectj.weaver.MissingResolvedTypeWithKnownSignature at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:774) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:627) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:867) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterProcessing(AjCompilerAdapter.java:206) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$4$6b855184(CompilerAdapter.aj:90) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:528) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:845) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:266) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:168) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)
I got a similar exception (ClassCastException thrown in recordClassFile) when using a perthis(..) aspect. A full rebuild fixed it. However this aspect, even after it builds, is causing me problems with Spring. Basically, I'm using Spring AOP to decorate the object with transaction semantics, and also using a plain-old compile-time aspect (this one), and I think they are interacting poorly. I don't know if perthis() is part of the problem. I'll probably open up another bug if it comes up. (In reply to comment #0) > I got this exception while working on a static inner aspect. A full rebuild > avoided the problem. > > java.lang.ClassCastException: > org.aspectj.weaver.MissingResolvedTypeWithKnownSignature > at > org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:774) > at > org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:627) > at > org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:867) > at > org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterProcessing(AjCompilerAdapter.java:206) > at > org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$4$6b855184(CompilerAdapter.aj:90) > at > org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:528) > at > org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329) > at > org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:845) > at > org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:266) > at > org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:168) > at > org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117) > at > org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) >
Created attachment 39519 [details] patch containing failing testcase Whilst trying to recreate another bug I stumbled into this one. The attached patch should be applied to the tests project and contains a failing testcase.
nice little testcase ;) initially looks like just an unnecessary cast...
interesting that the 'missing type' is actually one generated during weaving: A$ajcMightHaveAspect in Helens case (caused by the PerThis).
Created attachment 39642 [details] patch containing proposed fix Apply the attached patch to the org.aspectj.ajdt.core project. From discussions with Andy......the fix involves removing the unnecessary cast along with putting the A$ajcMightHaveAspect into the tMap within the world. It was placed in the typeXtoBinding map in the EclipseFactory but wasn't recorded in the world (Note that the first time through on the full build the A$ajcMightHaveAspect isn't generated because of the "abstract" keyword. When "abstract" is removed we generate this class.) This fix means that in all the tests the check "!newResolvedType.isMissing()" (AjState.java:784) returns true.
test and fix committed.