Friday, February 14, 2014

Previously initiated loading for a different type with name "javax/management/MBeanServer"

When I was doing a migration / upgrade to Spring 3.1, I faced a really weird Error.

My App was using Jetty to run deploy my WAR file.


Short story / Long Story

Although I was not using MX4J library in my project, I remembered that:
"Jetty defaults to overriding the normal J2SE class loader delegation model  (which calls for delegating to the parent)."

Therefore, this could be fixed by using this System Property:


-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true



This is how you should do it in your pom:


And that error will go away.