Noobish question here, but I'm struggling to make this work.
I've an old project with submodules which does not use Spring or anything, just final class and static Instance.
--- Main
------ Server
------ Business
------ Webservices
Server has a dependency with Business and Webservices.
Webservices has a dependency with Business
Server is the sub-module with the web.xml file.
I have to add a new service in Business sub-module and I want to start using Spring and dependency injection to do so, in order to start migrating the project to Spring. (I'm not talking SpringBoot, just regular Spring).
In Business sub-module, I did:
- add
spring-core
,spring-beans
,spring-contet
dependencies as well asjavax.inject
. Using spring version 4.3.2 - create an interface IMyService and its implementation MyServiceImpl and added the @Service annotation on the impl.
- add a
spring-context.xml
file in src/main/resources declaringcontext:annotation-config
andcontext:component-scan base-package
Then I created, in my submodule a "bridge" to try and use the Spring bean from my submodule in a non spring bean of another submodule, like described here : https://blog.jdriven.com/2015/03/using-spring-managed-bean-in-non-managed-object/
However the context never get injected.
I've tried adding in the web.xml of Server the contextConfigLocation
but no dice either.
What Am I missing so that my Spring context get initialized in the Business module ?