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
1 answer

UnsatisfiedLinkError: Native Library C:\Domino\nlsxbe.dll already loaded in another classloader

I have an timer process which reads through lotus notes 5 and dumps the read document in modeshape repository. The process writes the timestamp and other relevant information into a DB table and uses this to pick up where it was stopped and then…
TusharPanda
  • 211
  • 2
  • 14
2
votes
1 answer

Java ensure class is resolved

I have come into a situation where I want to conditionally load and resolve a class. Loading it is as easy as getting a handle to the correct ClassLoader and calling the loadClass method. after calling the loadClass method, I get a valid handle to…
user545199
2
votes
3 answers

Classes instantiated with different classloaders in the same Dalvik/JVM cannot "see" each other

I'm working on an Android application with pluggable .jar modules. My problem is, when I load two different .jar files, the classes from the first .jar file cannot "see" (Class.forName()) classes from the second .jar file and vice-versa. I load…
Android5360
  • 33
  • 1
  • 5
2
votes
0 answers

Replicate Dynamic loaded groovy classes in cluster nodes

I'm working on web application where I have some groovy templating engine and some classes loaded dynamically at runtime. Those templates are cached in local using jbosscache. When trying to set a clustered environement, I'm going through problem…
tmarwen
  • 15,750
  • 5
  • 43
  • 62
2
votes
1 answer

Codeigniter Appropriate approach for accessing Model in MVC style

I'm currently working on a project with CodeIgniter and its HMVC. http://jenssegers.be/projects/CodeIgniter-HMVC-Modules) I have a general question regarding the best way to load a model in a different module. So far, I thought directly loading a…
Raccoon
  • 1,367
  • 4
  • 22
  • 45
2
votes
1 answer

Webstart application: SecurityException: setContextClassLoader

I have a webstart application which connects to a web service. The manifest has: Permissions: all-permissions And the jnlp has: However when the connection to the web service is created I get a…
assylias
  • 321,522
  • 82
  • 660
  • 783
2
votes
2 answers

How can I write a ClassLoader that does this?

I'm trying to make a URLClassLoader which behaves as follows: If asked for a class whose name is in a given set of inclusions, load it as normal Otherwise, return a dummy class of my choice How should I go about this? My attempt at doing this…
NellerLess
  • 955
  • 1
  • 8
  • 9
2
votes
1 answer

How to deploy two cross-dependent EARs in JBoss 7 in order to prevent ClassCastExceptions?

I have a problem when deploying two ear files in Jboss 7 and would be thankful for your help. Following scenario: EAR 1 contains EJBs which are looked up by EAR 2 (also) at server startup. Thus, EAR 1 has to be deployed before EAR 2 (via…
2
votes
1 answer

Adding external jar dynamically and registering class as beans in Spring

I am loading a jar dynamically in a war. The jar contains some java classes which I want to register as bean. The code looks like Load the jar file dynamically Resource jarFile = appContext.getResource("file:" +); URL url =…
lalit
  • 1,485
  • 2
  • 17
  • 32
2
votes
3 answers

JBoss 7 classloading miracles

I have problems with a webservice/OSGi application that is bundled as WAR under JBoss 7. My questions are: What modules are available to the application by default? I know how to add a dependeny and how to exclude one. But how do I know the…
2
votes
2 answers

How to load unknown class from downloaded jar file during runtime?

I'm building a client server application. During runtime the client application loads a jar file from the server application and stores it. I run both the client and the server application as jar files. I now want to load the class contained in this…
Christoph W.
  • 958
  • 2
  • 10
  • 24
2
votes
0 answers

BadParcelableException: unmarshalling: com.android.mail.providers.Account

I know that this a looks duplicate thread. But, I could not find the solution for this.. I have a application in which I try to a Intent filter for android.intent.action.VIEW When I touch on a email-id, it opens my activity. But throws…
Vinay
  • 2,395
  • 3
  • 30
  • 35
2
votes
0 answers

create a libgdx game for an android plugin

What I want is to run a libgdx game in a host android app. The game is hoding in jar or apk file, and loaded by the host with classloader dynamiclly. Notice that the game is not installed. I have written a test host app and it could load the…
2
votes
1 answer

Classloader and loading a class whose location does not equal its package

I'd like to be able to load a class(es) from a known directory whenever a compiled .class file appears in that particular directory. However the I'd like the .class to be loaded regardless of what the package decleration is in its .java file. For…
D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97
2
votes
1 answer

Loading Multiple Dex Files

I know that we can use customized class loader to load a DEX file. What I would like to know is that is it possible to load multiple DEX files in an application and can we use custom loader for this purpose?? Thanks :)
Shoaib
  • 65
  • 7