I reordered my dependencies in build.gradle
in alphabetical order, after which I quickly noticed that my Spring application no longer works properly (it halts with message java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()
on start up). If I move the undertow dependency from the middle to the top, then everything works fine as before.
How does dependency ordering affect the way the application is run? What is the suggested order?
It has an influence on the classpath of the application. There is probably an older version of Servlet specification above undertown dependency. This answer explains why this particular error occurs for older Servlet specification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With