Scheduled Maintenance: over the next few days, we will update Jira to a newer version.

If you don't know Jira 4.x yet, you might be a little surprised by the UI changes ... :)

Issue Details (XML | Word | Printable)

Key: MAGNOLIA-2577
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Grégory Joseph
Reporter: Grégory Joseph
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Magnolia

Classloader related issues on JBoss 5.0

Created: 23/Jan/09 01:23 AM   Updated: 27/Feb/09 04:38 PM
Component/s: build
Affects Version/s: 4.0
Fix Version/s: 4.0

Time Tracking:
Not Specified

File Attachments: 1. Text File jboss-deploy-stacktrace.txt (30 kB)

Issue Links:
relation

Labels:
Resolution Date: 27/Feb/09 04:38 PM
Date of First Response: 16/Feb/09 05:39 PM


 Description  « Hide
From the exception (see attachment), it seems related to xerces - possibly because we ship with a version and jboss with another. Goes in the direction of my feeling we shouldn't bundle this at all.
On surprising thing is:
01:14:43,764 ERROR [JBossContextConfig] XML error parsing: jboss.web/localhost/context.xml.default
— well, it looks like the infamous jboss classloader "issue", where the jars in the webapp seem to be used to load stuff which is outside.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Grégory Joseph added a comment - 23/Jan/09 01:25 AM
Seems to me 3.6.3 suffers from the same problem, needs double-check.

Grégory Joseph added a comment - 27/Jan/09 05:05 PM - edited
Removing the xerces jar helps the deployment itself, but there is another issue, still related to classloading: module descriptors can't be found.

Grégory Joseph added a comment - 27/Jan/09 05:59 PM
Note that deployment on JBoss 4.2.2 still works like a breeze: adding the jaas config is sufficient; no need to remove xerces, and the current classloader as used in ClasspathResourcesUtil.findResources() behaves as expected (i.e returns URLs for the webapp's WEB-INF/lib jars and WEB-INF/classes folder)

Grégory Joseph added a comment - 27/Jan/09 08:55 PM
JBoss5 seems to behave differently, depending on how the webapp is deployed: as an exploded war directory, or as a war file
(which is really weird, since afaik, all jboss should do is extract the war file and start from there - weirder is that its in the war file case that it works properly (or at least in the way we've expected it to work in the past)

Essentially, our code (ClasspathResourceUtil) is doing this:

URLClassLoader cl = (URLClassLoader) Thread.currentThread().getContextClassLoader();
 URL[] urls = cl.getURLs();
  • in the war file case, we get what we expect: an array of URLs: WEB-INF/classes, and one URL for each jar in WEB-INF/lib
  • when deploying an expanded war as a directory, we only get the WEB-INF/classes url, which is why module descriptors aren't found


Hudson CI server added a comment - 16/Feb/09 05:39 PM
Integrated in magnolia_main-trunk #697
Working around a classloading issue in JBoss 5 - if the current URLClassLoader only contains one URL pointing to WEB-INF/classes, try to find the resources using the filesystem

Grégory Joseph added a comment - 17/Feb/09 06:24 PM - edited
Status so far:
  • xerces needs to be removed from webapp (it is anyway in jboss's lib/endorsed folder)
  • exploded war directories and archived war files now deploy and find their modules, following the patch on ClasspathResourcesUtil of r22553.