Springboot context is not being loaded from EJB.
I have a Java EJB based Application that is deployed on WebLogic. I also have in a springboot application in my EJB module that loads all the beans. I'm trying to access the springboot context to be able to get these beans in my EJB.
Springboot 2.7.8 EJB 6.0
Things I have tried:
1.
@Component
public class SpringApplicationContextProvider implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext context) {
applicationContext = context;
}
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
}
In my Ejb:
@Statless
public class MyEjb
public void m(){
ApplicationContext context =
SpringApplicationContextProvider.getApplicationContext();
...
}
- @Statless public class MyEjb implements ApplicationContextAware { private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext context) {
applicationContext = context;
}
@Statless
@DependsOn("springApplicationContextProvider")
public class MyEjb{
@Startup
@Statless
public class MyEjb