I have a parent application Application1 which loads beans based on Spring XML
configuration.
I have child application Application2 (included/referred on Application1) with @Configuration
based fully annotated spring java
file.
When I deploy Application1 in tomcat, I see that none of the beans from Application2 loaded.
Am i missing anything?
I tried component-scan for Application2 in Application1's spring XML
but no change noticed.
Edited XML of Application 1:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd">
<context:annotation-config />
<context:component-scan base-package="com.test.work.aspect"/>
</beans>
Package of @Configuration file:
com.test.work.aspect.JMXConfiguration
Edit2:
@Configuration
@ComponentScan(basePackages="com.test.aspect.mbean")
@EnableAspectJAutoProxy(proxyTargetClass=true)
@Profile("aspect")
public class JMXConfiguration {
@Bean
public MyRmiRegistryFactoryBean myRmiRegistryFactoryBean(){
return new MyRmiRegistryFactoryBean();
}
@Bean
public MyConnectionServerFactoryBean myConnectionServerFactoryBean() {
return new MyConnectionServerFactoryBean();
}
}