Class with Spring @Conditional is not weaved with AspectJ -
i want load spring 4.0 resources conditionally, below code can job (how achieve conditional resource import in spring xml context?):
@configuration @conditional(myconditionalconfiguration.condition) @importresource("/com/example/context-fragment.xml") public class myconditionalconfiguration { static class condition implements configurationcondition { @override public configurationphase getconfigurationphase() { return configurationphase.parse_configuration; } @override public boolean matches(conditioncontext context, annotatedtypemetadata metadata) { // load context-fragment.xml if system property defined return system.getproperty("com.example.context-fragment") != null; } } }
how ever code can not weaved aspectj, problem supposed @conditional
the trace is
org.aspectj.weaver.bcexception @ org.aspectj.ajdt.internal.core.builder.ajstate.recordclassfile(ajstate.java:1519) @ org.aspectj.ajdt.internal.core.builder.ajstate.noteresult(ajstate.java:1325) @ org.aspectj.ajdt.internal.core.builder.ajbuildmanager$3.acceptresult(ajbuildmanager.java:1061) @ org.aspectj.ajdt.internal.compiler.ajpipeliningcompileradapter.afterprocessing(ajpipeliningcompileradapter.java:426) @ org.aspectj.ajdt.intern ... .0_21-64\jre\lib\ext\sunmscapi.jar;e:\jdk1.7.0_21-64\jre\lib\ext\zipfs.jar;d:\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar;
Comments
Post a Comment