I'm writing a solr plugin by extending SearchComponent class. My new class is part of a.jar archive. Also my class depends on a jar b.jar. I placed both jars in my core/lib folder and I declared my new component in solrconfig.xml. The component is invoked correctly up to a point where a class ClassFromB from b.jar attempts to load a classpath resource stopwords.txt from classpath.
The piece of code in class ClassFromB looks like this:
...
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource("stopwords.txt"); //with cl.getResource("/stopwords.txt"); I get the same exception
String content = IOUtils.toString(curl.openConnection().getInputStream());
...
The last line above throws a NPE telling me that the resource is not found. So, the class ClassFromB is loaded because it gets to execute the code up to the last line where it fails. Also I double checked b.jar and I can see the stopwords.txt file right in the root.
What should I do to see that resource from class ClassFromB?