I have a project where I need to bootstrap @Configuration java-config classes into the XML configuration.
To do that, I’m reading that I also need to include the following bean definition (along with the bean definitions of the classes annotated with @Configuration).
<bean class="org.springframework.config.java.process.ConfigurationPostProcessor" />
But, I end up receiving the following error:
Caused by: java.lang.ClassNotFoundException: org.springframework.config.java.process.ConfigurationPostProcessor
I have to assume I’m missing a jar somewhere, but my various web searches hasn’t resulted in an answer yet. Any help would be greatly appreciated. Thanks.
EDIT: Evidently, I was reading old documentation, which is no longer current. Let me back up. My project contains older XML-based configuration. The newer code is all using ‘Java-config’. With that said, the contexts are apparently completely separate. I’d like to ‘import’ a java-config class into the XML configuration, so that both contexts have those particular beans. Does anyone know how I can do that?
This actually ended up being fairly simple. To get a Java-config bean definition into the xml-config, simply define the Java-config class as a bean within the XML-config. There are no extra jars necessary.
inside the XML-config, you define this class as a bean.
The XML-config, which may be part of a different context, now has all the bean definitions defined within the JavaConfig class.
UPDATED – to included Alan Franzoni’s comment below in the answer.