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
Cross-classloader class loading
I have a CustomClassLoader that loads classes from a Map. The classes that I am loading depend on other, unloaded classes. I have the jar files that contain said classes in a UrlClassLoader that is initiated before the…
user1497561
0
votes
1 answer
google reflections not resolving my type parameters on annotated methods
I have the following code that works nicely if the project is in my classpath locally and I do a getClass().getClassLoader(). But when I try to load dynamically from an external jar it fails.
It fails to load MyType, which is the type on the method…

grinder22
- 551
- 4
- 17
0
votes
1 answer
Processing Events from a Class that it was previously loaded by ClassLoader with Esper
I´m trying to process events using Esper, the problem is I´m using a Class that it was previously loaded by ClassLoader. And
the Statements does not seem be inserted in the stream. Any help, please?
Here the code:
public class CEPMotor {
public…

jkrlos
- 133
- 1
- 2
- 11
0
votes
1 answer
URLClassLoader Memory Leak Java
I have been going through a lot of URLClassLoader Memory leak solutions on the internet, but I haven't found any fully working code and precise solution. The closest to a solution I found was this
Any fully functional code or link to it, which uses…

chaity
- 163
- 2
- 11
0
votes
2 answers
NoClassDefFoundError when using URLClassLoader
I am trying to make a plugin storage where my java code downloads the existing jars in the storage dynamically at run time . I implemented an interface which should be implemented by each plugin.
Here is the code that i used ,
public void…

Karim Akhnoukh
- 91
- 16
0
votes
1 answer
Execute Java jar from it's directory using java program
I am trying to execute another java jar using ClassLoader, once this jar is executed. It looks for certain file in it's directory.
How do I setup the working directory when I start this jar?
I used System.setProperty("user.dir", "C:\\abc"); before…

Nikesh Jauhari
- 245
- 2
- 8
0
votes
2 answers
java.lang.NoClassDefFoundError: (wrong name )
I have run the application to load a class name called ChocolateMilk.java inside the netbeans project, I want to call this class using JFileChooser and then load it using ClassLoader.
here is the code for the method to get filename which is inside…

miss h
- 133
- 1
- 2
- 15
0
votes
1 answer
How to load resource bundle from file, not from jar, same bundle base name
There are resource bundles with the same base name in both file system and jar.
Try to load the resource bundle from file system, not from jar.
URLClassLoader urlLoader = new URLClassLoader(new java.net.URL[]{filePathURL});
ResourceBundle bundle =…

eastwater
- 4,624
- 9
- 49
- 118
0
votes
2 answers
Custom classloader trouble with getResources for names ENDING in slash
I am desperate for help but was unable to find anything on the web about this particular subject (many related ones that leave my particular problem unanswered).
Specifically, I need to be able to download code (jars) from a central and external…

Learner
- 1,215
- 1
- 11
- 26
0
votes
0 answers
custom Classloader for complete application including system classes
This is a follow up to java.net package - Override UDP transport. I am raising a new question here because I am trying a different approach to the problem. I have gone through simlar questions
java custom classloader: some classes are not loaded by…

user572964
- 600
- 5
- 12
0
votes
0 answers
How NOT to reload .class files from the disk in CustomClassLoader for every creation of an instance
I have created a CustomClassLoader that inherits from the ClassLoader to override loadClass method.
Below is the new CustomClassLoaded
public class DesignFactoryClassLoader extends ClassLoader{
public…

Kishore Vanapalli
- 114
- 9
0
votes
1 answer
Loading driver jar file at runtime resulting in Perm Gen Space Error
I have created a REST service in which I am loading the JDBC driver jar at runtime. Below is the code which does this:
Driver driverInstance;
URLClassLoader driverClassLoader;
driverClassLoader = new URLClassLoader (new URL[] { "c:/mysql.jar" },…

sf9251
- 268
- 1
- 3
- 16
0
votes
1 answer
Retrieve the value of fields in a class loaded from a jar
I have to retrieve the value of all fields in a class loaded from a jar.
So I need an instance to do that :
field.get(gameClassInstance);
for each field.
Here the code that load the class and try to create an instance :
private Loader() throws…

Spooky
- 315
- 1
- 3
- 12
0
votes
1 answer
using URLClassLoader gets the same reference as the default ClassLoader
I'm trying to test that a class can be loaded to the jvm more then once but using different ClassLoader
so my code tries to load a class (class name "Tzvika") twice
first using the default ClassLoader
and in the second try using the…

Tzvika Velich
- 15
- 5
0
votes
1 answer
How can I pass parameters to a jar, whilst using a ClassLoader?
Here's my code
package serverloader;
import java.net.URL;
import java.net.URLClassLoader;
public class ServerLoader {
public void initiate(String[] arguments) throws Exception {
System.out.println("Initiating...");
URL link =…

kbz
- 984
- 2
- 12
- 30