This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes JBoss classloader issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss classloader issue" Watch "JBoss classloader issue" New topic

JBoss classloader issue

sundaram venugopal

Joined: Jul 24, 2008
Posts: 7

We have developed one web application which has to be deployed separately for different customers.

say for example : customer X ,customer Y and customer Z are our clients.
we need to deploy three different WAR files for all these 3 customers. Source code and package structure will be the same, but some XML files and images will differ. We have to have 3 different builds, all running on the same jboss server, but with different Context names and URLs.

The problem is here : when we deploy all these 3 war files, the class files which are repeated in all the 3 war files are loaded only once for all the 3 deployments. But our requirement is to load 3 different versions of class files , but with different state and data.

How do we force JBoss to load these classes again and again. Say if there are 10 customer, we need 10 builds, and the same classes should be loaded 10 times.

If we change the package names different in all the 3 war files, no issues. Working fine ..may be because all these classes have different absolute names, although the source is exactly the same .

Thanks in advance,

Peter Johnson

Joined: May 14, 2008
Posts: 5812

Package the WAR into an EAR file and define separate class loader repositories, that would force each app to use its own classes.
[ July 24, 2008: Message edited by: Peter Johnson ]

JBoss In Action
I agree. Here's the link:
subject: JBoss classloader issue
Similar Threads
Question of class loaders.
How can we configure jboss startup script
why Customer[] customers[10]; doesnt work?
Deploying a webservice with isolated namespace
JBoss class loading and reading .properties files