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
2 answers

BIRT 2.5 deployed with Xerces jar in WEB-INF/lib throws NullPointerException

so I am having pretty much exactly the same problem as what someone else has described here: birt-exchange. I have integrated BIRT with my existing web application that requires the xerces jar (mine is version 2.5) and the following exception is…
Ed .
  • 6,373
  • 8
  • 62
  • 82
2
votes
2 answers

How to load Zend classes when running php script by command lines

I have a php script needing Zend classes. It can be run in a browser, but errors occur when run the script by command lines in command prompt. require_once 'Zend/Loader.php'; // It can work in a browser but failed by command lines I also…
asdk77
  • 143
  • 1
  • 2
  • 12
2
votes
3 answers

Loading Images from a Jarfile

Alright so here is my problem and my question to you..... I have a game in which it needs to load images from the jar file (all the images are packed into the jar file like so): I first have the unzip of the jar file: Then it goes to: Then inside…
3kings
  • 838
  • 2
  • 13
  • 28
2
votes
0 answers

ClassCastException loading a class from an ExtensionPoint

We're trying to load a class via an Extensionpoint using Eclipse 3. We have defined the extensionPoint in our plugin that only requires a class that implements IScript. IScript is very simple: public interface IScript { void execute(ScriptEngine…
looper
  • 1,929
  • 23
  • 42
2
votes
3 answers

multiple versions of javamail jar causing NoSuchProviderException

I have a standalone library ( jar file) that is added to the application server classpath to monitor all the running applications in the JVM and send email when some issue happens. the jar file have all the dependencies bundled in the jar (using…
Sammy
  • 4,538
  • 8
  • 33
  • 52
2
votes
0 answers

Why do I get a ContextNotActiveException if my BDA are packaged in a EAR rather than WEB-INF/lib

I am using IBM Websphere 8.0. We are trying to create the ear archive with all our CDI beans packaged in JAR directly in the ear file. The war manifest lists down the names of the jars packaged. My issue is that I see a this stacktrace even though…
Sekhon
  • 108
  • 1
  • 10
2
votes
1 answer

Loading jdbc driver via resource (Tomcat 7)

I'm trying to use tomcat jdbc connection pool and I define it in my application context.xml file.
Timofei Davydik
  • 7,244
  • 7
  • 33
  • 59
2
votes
4 answers

MyClass.class.getClassLoader().getResource("").getPath() throws NullPointerException

I have code that is running correctly on a development machine but throws a NullPointerException when installed in a production environment. The line that throws the exception is the…
Zak
  • 311
  • 2
  • 5
  • 12
2
votes
1 answer

deployment.xml for WebSphere and Maven

I've converted an application to be built and deployed with Maven instead of RAD's built-in tools. It's mostly gone well, but the last "gotcha" is that the application needs a class loader policy of "parent last/application". I'd like to automate…
FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
2
votes
1 answer

ClassLoader loadClass throws ClassNotFoundException

String pathToJar = "C:\\Users\\dtn\\jb_workspace\\helloworld-mdb\\target\\jboss-as-helloworld-mdb.war"; URL[] urls = { new URL("jar:file:///" + pathToJar+"!/") }; URLClassLoader urlcl = new…
Tran Ngu Dang
  • 2,540
  • 6
  • 29
  • 38
2
votes
3 answers

Scala/Java subdirectories with dots in names

By some reasons I need to use long names of the packages in my project. Like: com.example.foo.bar.bazz.anotherlongsubpart.andfinallytheactualpackagname So considering the name convention(at least what I know about name convention in Java), I have…
Ilya Lakhin
  • 1,904
  • 1
  • 16
  • 31
2
votes
2 answers

java : ClassLoaders

Say, I have a class A, loaded by ClassLoader CL1. I have another class B, loaded by ClassLoader CL2. Assume both classes are now loaded by their respective ClassLoaders. From A, if I execute the following statement, what would be the result :…
user127377
  • 131
  • 2
  • 10
2
votes
2 answers

Dynamic classloading using only a String

Is there a way to compile and load a Java class during runtime without creating and storing a file in an operating system filesystem? Say I have a database record that contains the string representation of a java class. I pull that string into Java…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
2
votes
1 answer

Leaking reference to jruby runtime, getting PermGen OOM errors after reloading app

Something in my code, or in the gems I'm using is leaking a reference to the JRuby runtime: every time I reload an app on Torquebox, Trinidad, or anything else, the permgen just fills up until eventually after too many reloads I get a PermGen OOM…
Mohamed Hafez
  • 8,621
  • 7
  • 41
  • 49
2
votes
2 answers

Griffon resource loading differences between run-app and test-app

I am fairly new to Griffon and have some experience with Grails. I have a problem loading a file from the resources directory. I am using Griffon version 1.4.0. When I run griffon run-app the following code (inside a Service) to get the location of…
msung
  • 3,562
  • 3
  • 19
  • 30
1 2 3
99
100