-
1. Re: JBoss 7 application loads resource from dependency, not from itself
jaikiran Mar 20, 2013 10:28 AM (in response to sven.plath)With that dependency, you have made available more than one resource with the same name in the classpath of that application. As a result, the classloader.getResource() returns the first one it finds in the classpath (note, there's a different classloader.getResources() method which returns more than one such resources which are found in the classpath).
I am not sure what the classloader policy is in JBoss Modules when it scans for resources (i.e. whether it checks for dependencies first or itself).
-
2. Re: JBoss 7 application loads resource from dependency, not from itself
sven.plath Mar 20, 2013 10:49 AM (in response to jaikiran)Hey,
yes you are right. When using the getClassloader().getResources() method, it returns two different resource.properties URLs. This clarifies everything, thanks a lot.
Regards,
Sven
-
3. Re: JBoss 7 application loads resource from dependency, not from itself
sven.plath Mar 20, 2013 11:25 AM (in response to sven.plath)I would like to add that this behavior is, from my point of view not very intuitive. I would always guess that even when there are multiple resources with the same name in the same location in different deployment units, where one depends on the other, the resource from the dependent is taken.
The JBoss 6 does also find two resources when using getClassloader().getResources(), however the behaivor is as expected, the resource from the dependent is returned.