[MAGNOLIA-2577] Classloader related issues on JBoss 5.0 Created: 23/Jan/09  Updated: 02/Jun/17  Resolved: 27/Feb/09

Status: Closed
Project: Magnolia
Component/s: build
Affects Version/s: 4.0
Fix Version/s: 4.0

Type: Bug Priority: Critical
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File jboss-deploy-stacktrace.txt    
Issue Links:
relation
is related to MAGNOLIA-1751 Remove dependency from xerces Closed
is related to MAGNOLIA-2634 Update jackrabbit to 1.5.3 (before 4.... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

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.



 Comments   
Comment by Magnolia International [ 23/Jan/09 ]

Seems to me 3.6.3 suffers from the same problem, needs double-check.

Comment by Magnolia International [ 27/Jan/09 ]

Removing the xerces jar helps the deployment itself, but there is another issue, still related to classloading: module descriptors can't be found.

Comment by Magnolia International [ 27/Jan/09 ]

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)

Comment by Magnolia International [ 27/Jan/09 ]

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
Comment by Magnolia International [ 27/Jan/09 ]

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=149391

Comment by Magnolia International [ 17/Feb/09 ]

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.
Generated at Mon Feb 12 03:38:03 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.