I am currently working on a strategy to refactor a Monolith Java/J2EE based application which is running with multiple web services and common EJB code on Weblogic 12c Platform as multiple MicroServices.The common EJB code has session beans which are specific to each web service and it also has common code which is accessed by multiple services.What is the best approach to refactor common EJB code ? Some of the options that I came across are
1.Refactor the common EJB beans as a shared library and deploy it as an EAR - The question here how will the web services lookup the beans (CDI will not work as they are outside the context,Local JNDI lookup is a possibility)
2.Package the common EJB beans as a JAR file and include it all the web services APP-INF/lib directory - This option will create multiple copies of code on various services
Please suggest any other options