Classloader woes after leaving Java 8. [message #1831058] |
Tue, 11 August 2020 01:18 |
Bruno Melloni Messages: 13 Registered: August 2020 |
Junior Member |
|
|
I am migrating from Java 8 to 11 and slowly resolving the many issues that popped up. The latest issue is figuring out how make the default classloader for my application be a URLClassLoader. In Java 8 you could just cast it, since Java 9 you cannot.
I realize this is more of a generic Java 11 question than an Eclipse specific question, but I expect that this is a common issue and hoping someone here already knows the answer or can point me to somewhere where I can find it.
1) In pure java, there are many tutorials and threads on how to create a class that inherits from a URLClassLoader, but none on how to make it the *default* for subsequent code. How can I do that?
2) I *suspect* that since Tomcat has a custom classloader tree, Tomcat 9 probably still uses a URLClassLoader from its *common* classloader and up the stack. Does anybody know if this is true?
EDIT - CONFIRMED : Tomcat 9 uses URLClassLoader for the *common* and *webapps* classloaders.
[Updated on: Thu, 13 August 2020 16:52] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02437 seconds