fixes #585 a problem with the way certain factories are used in spring. More specificaly the "Activiti engine" library, but other libraries might encounter the same problems.