-
1. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
pushpak1981 Dec 27, 2011 2:20 AM (in response to pushpak1981)Is this the correct forum for posts related to JBoss7.1 ?
-
2. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
jaikiran Dec 27, 2011 2:28 AM (in response to pushpak1981)Tony D wrote:
Is this the correct forum for posts related to JBoss7.1 ?
Yes, it is. But please be patient, it's holiday week(s) and most of the developers (and even community members) aren't around.
-
3. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
jaikiran Dec 27, 2011 2:29 AM (in response to pushpak1981)Tony D wrote:
We are having an ear application in which we are having our custom configuration files inside abc.ear/config/ folder. Our seam components use Thread.currentThread().getContextClassLoader().getResource to read the configuration files from the config folder mentioned above.
Does that call happen during application deployment or some other time? What exactly does the code look like?
-
4. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
pushpak1981 Dec 27, 2011 3:24 AM (in response to jaikiran)Thanks for the reply. Yes the code is called during the application deployment.
We have a seam component which is loaded during seam startup and reads those configuration files which are located in abc.ear/config folder. Our ear is an exploded ear.
The code is
Thread.currentThread().getContextClassLoader().getResource("config/test.xml") which returns a URL object. The URL object is null in case of JBoss7.1.
This code is working in JBoss5.1 but failing in Jboss7.1.
-
5. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
michael-s Sep 27, 2012 4:58 AM (in response to pushpak1981)We had the same problem with jboss-as-7.1.1.Final. During the deployment of our ear this ContextClassLoader is used by JBoss:
ModuleClassLoader for Module "org.jboss.as.pojo:main" from local module loader
This class loader does not have access to the files in the ear. See https://community.jboss.org/wiki/ModuleCompatibleClassloadingGuide for workarounds.
@jaikiran pai: Is this considered a bug or a feature?
-
6. Re: Thread.currentThread().getContextClassLoader().getResource("") returns null
jaikiran Sep 27, 2012 5:08 AM (in response to michael-s)michael-s wrote:
We had the same problem with jboss-as-7.1.1.Final. During the deployment of our ear this ContextClassLoader is used by JBoss:
ModuleClassLoader for Module "org.jboss.as.pojo:main" from local module loader
This class loader does not have access to the files in the ear. See https://community.jboss.org/wiki/ModuleCompatibleClassloadingGuide for workarounds.
@jaikiran pai: Is this considered a bug or a feature?
If you are seeing that your application's classes (in the ear) have a TCCL pointing to something other than the deployment's module, then it's a bug. But before filing a JIRA, I would like you to explain a bit more about your issue. I'm curious to see what kind of classes you have especially since it seems that you are using the pojo subsystem. Also, could you try this against the latest nightly builds https://community.jboss.org/thread/167590 and see if it's fixed there?