-
1. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
choonny Dec 14, 2012 5:17 PM (in response to choonny)Apology, I accidentally submit it withouth providing the full explanation.
Anyway...this is what I have in my module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.<companyname>.configuration">
<resources>
<resource-root path="props"/>
</resources>
</module>
This is how my jboss-deployment-structure.xml file looks like:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.<companyname>" slot="configuration" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Any idea how to get it to work?
Thanks,
Juniana
-
2. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
sfcoy Dec 14, 2012 9:02 PM (in response to choonny)You have specified a slot in your jboss-deployment-structure.xml file, but there isn't a slot specified in your module definitition.
-
3. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
choonny Dec 18, 2012 1:46 PM (in response to sfcoy)Stephen, I don't think I need to specify the slot in module definition.
-
4. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
nickarls Dec 18, 2012 2:12 PM (in response to choonny)No, but then you shouldn't have slot="configuration" either
-
5. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
choonny Dec 18, 2012 2:16 PM (in response to nickarls)Nicklas, my slot is configuration. That's where my module definition is.
-
6. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
nickarls Dec 18, 2012 2:25 PM (in response to choonny)looking how the jsf 1.2 impl is defined, I would try
<module xmlns="urn:jboss:module:1.1" name="com.<companyname>" slot="configuration">
-
7. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
cfang Dec 18, 2012 2:43 PM (in response to choonny)depending on the structure of your app, the Context class loader may not have visibility to the resource file. Can you try a classloader from an application class that are in the same module of the target resource file?
MyApplicationClass.class.getClassLoader.getResource("a/b/foo.txt");
-
8. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
choonny Dec 18, 2012 7:20 PM (in response to cfang)I can't use the application class to get the resource because this code is inside the framework. Thus, the use of Thread.getContextClassLoader.
I was reading this article specifically about TCCL but it didn't really give me the sample code solution on how to get it to work.
-
9. Re: Thread.currentThread().getContextClassLoader().getResource(....) null
choonny Dec 18, 2012 7:26 PM (in response to choonny)Sorry, the link to the article:
https://community.jboss.org/wiki/ModuleCompatibleClassloadingGuide