[ 
https://issues.apache.org/jira/browse/SOLR-13392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16819747#comment-16819747
 ] 

Shalin Shekhar Mangar commented on SOLR-13392:
----------------------------------------------

Okay, so it is a little more tricky.

The exporter adds solr core as a dependency in its build and adds lucene's 
analysis jar in the distribution so that it can access the lucene's 
ResourceLoader (transitively from the SolrResourceLoader). This is why ant test 
does not catch the problem. The resource loader calls IOUtils.close (which is 
in lucene-core).

Before SOLR-13234, the loader's close method was never called(?) which is why 
this dependency miss was not spotted. But the rabbit hole goes deeper, after 
SOLR-13234, the exporter uses more of Solr core's dependencies such as guava 
cache so it is not sufficient to just add lucene-core.jar. It is quite a mess, 
I admit. It is easy to just add all of solr runtime dependencies on the class 
path by adding {{server/solr-webapp/webapp/WEB-INF/lib}} to the classpath. 
Other scripts such as zkCli do the same. Are there any objections on doing that?

> Unable to start prometheus-exporter in 7x branch
> ------------------------------------------------
>
>                 Key: SOLR-13392
>                 URL: https://issues.apache.org/jira/browse/SOLR-13392
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: metrics
>    Affects Versions: 7.7.2
>            Reporter: Karl Stoney
>            Assignee: Shalin Shekhar Mangar
>            Priority: Major
>         Attachments: SOLR-13392.patch
>
>
> Hi, 
> prometheus-exporter doesn't start in branch 7x on commit 
> 7dfe1c093b65f77407c2df4c2a1120a213aef166, it does work on 
> 26b498d0a9d25626a15e25b0cf97c8339114263a so something has changed between 
> those two commits causing this.
> I am presuming it is 
> https://github.com/apache/lucene-solr/commit/e1eeafb5dc077976646b06f4cba4d77534963fa9#diff-3f7b27f0f087632739effa2aa508d77eR34
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/lucene/util/IOUtils
>         at 
> org.apache.solr.core.SolrResourceLoader.close(SolrResourceLoader.java:881)
>         at 
> org.apache.solr.prometheus.exporter.SolrExporter.loadMetricsConfiguration(SolrExporter.java:221)
>         at 
> org.apache.solr.prometheus.exporter.SolrExporter.main(SolrExporter.java:205)
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.util.IOUtils
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>         ... 3 more



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to