This class loader is used to load classes and resources from a search path of URLs referring to both JAR files and directories.
Questions tagged [urlclassloader]
286 questions
0
votes
1 answer
Using a Class Loader, how do I check Instance of For Two Classes
So in my scenario I am using the URLClassLoader and I've loaded a directory containing class a, b and c.
class b extends class a, class c extends nothing.
How can I check this in my code I have been trying to use
b.isInstance(a) however this returns…

Chris Brown
- 25
- 2
0
votes
1 answer
Unloading Java classes using CustomClassLoader
I have been through many posts and questions but none of them had a absolute Java program to implement this.
Requirement : For some reasons my application loads the Common-codec 1.3.jar,
and later on ,within same jvm the process needs to use…

Sriharsha g.r.v
- 456
- 5
- 13
0
votes
2 answers
jar file conflicts in maven
Right now I am using a maven project. And this project uses some logging.1.jar. There is a new functionality which we are going to add to this project and is dependent on logging.3.jar.
The compilation is fine, but the application is failing at…

RamhaKrishna
- 1
- 2
0
votes
1 answer
accessing classes from a directory without knowing directory content
If I'm provided an address to a directory, but I have no information regarding what is within the directory, can I check to see if the directory contains any classes and access the classes via URLClassLoader.
I'm currently creating a URL array with…

Brosef
- 2,945
- 6
- 34
- 69
0
votes
0 answers
Stop loading singleton class twice using Different Classloader
I am just following this answer and stucked.
What I am doing is safeguarding my Singleton class being loaded twice with different class loader. I am not using any custom class loader.
Is there any way to stop loading twice with URLClassLoader ?
my…

Santanu Sahoo
- 1,137
- 11
- 29
0
votes
0 answers
Quartz job error: Job class must implement the Job interface
I have a spring boot application that uses a custom classloader to load jars from an external library at runtime and then creates Quartz Jobs. The classloader is taking all the urls from the context classloader and then adding in the external…

M Fick
- 21
- 2
0
votes
0 answers
dynamically setting classpath
I am writing a calculator that loads all the classes needed through maven dependencies dynamically.such as slf4j,...
but i have a problem.since i don't want to set my class path to manifest,my customClassLoader does it itself.
but my logger is a…

PegahK
- 105
- 2
- 11
0
votes
1 answer
Gemfire 8.1 - Exception - ServerOperationException - SerializationException - A ClassNotFoundException
We are coding in Java 8 + Play 2 application.
We are in process of migrating from Gemfire 6 to Gemfire 8.
Below is my gemfire client-cache.xml file.

user3616964
- 63
- 8
0
votes
1 answer
Loading external Classes with external dependencies - URLClassLoader ClassNotFoundException
I am loading a Class from an external.JAR file and by means of URLClassLoader, which works as long as the external Class does not reference another JAR. If I do it yields a ClassNotFoundException.
As a workaround I add the other second tier JAR as a…

Josephus87
- 1,126
- 9
- 19
0
votes
1 answer
Where does ClassLoader.getSystemResource() go to?
There is existing code that has a call
URL resource = ClassLoader.getSystemResource("hp.obo.gz");
From my understanding, this searches the classpath for the requested file. I printed out the classpath using the code from here:…

information_interchange
- 2,538
- 6
- 31
- 49
0
votes
3 answers
Spark Java ClassNotFound
I'm coding an application which is module based, so it loads other jar files into the classpath. One module of this application is a RestAPI. For the RestAPI I'm using Spark Java. Now my problem is, that one class is not able to be loaded.
The…

Joel
- 138
- 10
0
votes
0 answers
How to use reflection to invoke a static overloaded method in Java
I want to use Java Reflection to invoke a method from a class which I have in my classpath via URLClassLoader from a jar file.
Class I want to access from the Jar file:
package org.example;
public final class Sample {
private Sample() {}…

mosawi
- 1,283
- 5
- 25
- 48
0
votes
1 answer
Loading different versions of the same library in JVM in parallel
I need to test differences between executions of the same library, but different versions - and in runtime. Hence I need to load lots classes which have the same package names.
The whole execution starts from just one class which has all the rest as…

Paul Ilves
- 21
- 1
- 7
0
votes
1 answer
java loses class after several executions
I have a handler class that is instantiated dynamically during the run time. It's instantiated fine for certain number of invocations, but at some moment X I get this exception:
java.lang.ClassNotFoundException:…

batu
- 1
0
votes
1 answer
Jdk update 121 URLClassloader change
In Java 121 release notes I could see that they mention that the URLClassloader will throw ClassNotFoundException instead of a SecurityException. While looking at the code, I could not see any methods being modified to throw this new exception. …

Amar Dev
- 1,360
- 2
- 18
- 38