user3280876
user3280876

Reputation: 51

Class Loading in Deployments in JBoss as 7

Reading the documentation of redhat (https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html) I found that the application server classloader has a priority list when loading classes that are used to avoid any conflict between loaded classes, The order is as below

I tried to test this order by using a JSF webapp (rich faces) in my EAR archive My ear is as below :

sample.ear

--- sport.war

--- mysql.jar

--- lib

I can't understand why in the 1srt usescase the Class Loading Precedence is not respected while in the 2sd usescase the Class Loading Precedence is respected?

Could you please clarify me this point

ENV

  1. JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)
  2. JDK 6

Upvotes: 3

Views: 1673

Answers (1)

ShayM
ShayM

Reputation: 106

Without seeing the exact deployment exception that you got it is difficult to diagnose the issue.

  • In the first scenario the packaged libraries are loaded in the same class loader as your application.

  • In the second scenario the packaged libraries are loaded in a separate module and class loader.

The above means that , The deployment issue you were having fo not have to be related to Class Loading Precedence they could also be related to Class Loading Isolation.

Also Jboss and EAP already come with a prepackaged implementation of JSF, and you might be experiencing collisions due to version mismatch

If you were looking to replace the default JSF implementation on JBoss the better option to do so would have been to put the new JSF implementation in a static module, just like the default one , and have Jboss load it on demand.

Upvotes: 1

Related Questions