Questions tagged [classloader]

A class loader is an object that is responsible for loading classes in Java.

A class loader is an object that is responsible for loading classes in Java.

Given the binary name of a class, a class loader should attempt to locate or generate data that constitutes a definition for the class. A typical strategy is to transform the name into a file name and then read a "class file" of that name from a file system. A class loader may also chose to delegate to another class loader. It may do this before or after doing a normal lookup.

Every Class object contains a reference to the class loader that defined it. This class loader is used by the runtime for linking to other classes referenced by this class. Together with the name of the class the defining class loader uniquely identifies a class. It's therefore possible to have several classes in with the same name in Java as long as they have a different defining class loader.

4126 questions
2
votes
3 answers

tools.jar missing - but only on the very first call (Tomcat 8/Java 8/ Axis)

Now that I upgraded my webapp to Java 8, I'm running into strange classloading problem with an axis webservice that is running in Tomcat 8. The very first call to the webservice after installing the webapp will cause a RuntimeException and a "No…
John
  • 21
  • 1
  • 4
2
votes
2 answers

Java Classloader: How to load class with binary name different from looked up name?

Edit: seems to be something different, read Edit2 first. How to load a class with binary name different from looked up name? I know the Java Spec does not allow that, but I have an application in front of me that does it somehow. I have a…
2
votes
0 answers

How to access classes in war from Wildfly module

I have a ear deployment which contain several war. A common library is needed by these wars so a custom module is created. This library would somehow load the classes in the war (using class.forName() may be)). However, it seems that the module is…
Quincy
  • 4,393
  • 3
  • 26
  • 40
2
votes
1 answer

WebSphere Liberty Profile Verbose Class Logging - where is it's output?

I'm getting an error in my program about a class not being found. I have double (and triple) checked and the class is definitely in my jar - it's finding other classes from the same jar just fine. To help with debugging this, I want to turn on…
ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
2
votes
2 answers

Unable to load classes which are not in the jars of the uber jar

I am trying to load classes from jar in jar (uber jar) and I have followed the way of such class loading from org.eclipse.jdt.internal.jarinjarloader. I have checked other resources and SO thread and I came up with the following…
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331
2
votes
3 answers

Laravel - custom classes don't work

I was reading some tutorials on creating custom classes for Laravel. I followed instructions and did exactly what tutorials say: Created new folder laravel/app/libraries/graphics/ Edited laravel/app/start/global.php where I…
Tomas Turan
  • 1,195
  • 3
  • 17
  • 27
2
votes
0 answers

How to serve files generated by sbt-js using spray-can

This is probably a very basic thing, but I just can't get it to work. To the spray-template project I have added the sbt-js plugin. When I run the js command it finds and processes my js files in src/main/[resources]/web/js/ and places them in…
Knotgrund
  • 23
  • 4
2
votes
1 answer

Load external jar in Groovy on Websphere

I have an application which is deployed on Websphere 8.5, the class loading is configured to "Parent Last". In the application, we use GroovyScriptEngine to run a groovy script file. In this groovy script file, we…
gfytd
  • 1,747
  • 2
  • 24
  • 47
2
votes
0 answers

Java class loading from jar file at runtime in Tomcat

I need to load some servlet from jar file and map it to the URL in Tomcat. Servlet code is package net.arturik.mymodulepackage; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import…
Arthur
  • 3,253
  • 7
  • 43
  • 75
2
votes
1 answer

Object is not an 'instanceof' it's own class

I'm trying to hunt down some issues with spring not expending a factoryBean. I've plugged into a debugger and proven that the failure is in this line of AbstraceBeanFactory: if(!(beanInstance instanceof FactoryBean) ||…
dsollen
  • 6,046
  • 6
  • 43
  • 84
2
votes
0 answers

StatefullSession repeat load classes - causes performance issuses

I have a server that gets request and use DROOLS to evaluate the request. For each incoming request I create a new statefull session, insert facts (can be more than 100 facts), fire all the rules and dispose of the session. I find that every insert…
Glass
  • 91
  • 7
2
votes
2 answers

getResourceAsStream() returning null for properties file

I try to load a file named config.properties in the package config. A snippet of my code in Main.java: //Read config.properties Properties properties = new Properties(); …
ikhebgeenaccount
  • 353
  • 6
  • 20
2
votes
1 answer

Are Android Static References Strong

I have a singleton that I'd like to keep alive for the lifetime of an Application. public final class KeepAlive extends Whatever { private KeepAlive() {} private static class Singleton { private static final KeepAlive instance = new…
Eliezer
  • 7,209
  • 12
  • 56
  • 103
2
votes
2 answers

Mule hot deploy running out of PermGen

I have a Mule instance running with numerous RSS Connectors, and I have a service running within the same Mule context that receives RSS feed updates/deletes/additions. When something with a feed changes, that service triggers a hot deploy by…
kash
  • 199
  • 2
  • 7
2
votes
1 answer

Dynamic Class Loading From Jar File

I have been trying to figure out how to dynamically load classes from a jar file during runtime, knowing the name of the package to load them from. I have tried this: How to get all classes names in a package? It didnt work, I later realized it was…