[
https://issues.apache.org/jira/browse/SOLR-13415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16823287#comment-16823287
]
Uwe Schindler commented on SOLR-13415:
--------------------------------------
Hi, the issue comes from SOLR-13322. It has nothing to do with Java 11:
{quote}
This is true even though:
{code}
jar -tvf solr-core-9.0.0-SNAPSHOT.jar | grep CLIO
747 Fri Apr 19 10:40:04 PDT 2019 org/apache/solr/util/CLIO.class
{code}
{quote}
You are looking in the wrong JAR file. {{post.jar}} must be able to run
"isolated". So it won't see any class outside its own JAR file.Unfortunately
when we package post.jar in solr/build.xml, there is a hardcoded list of class
files we add. SOLR-13322 adds CLIO (as a proxy to System.out for
forbidden-apis), but it's not added there. SOLR-13322 was not cherry-picked
into 8.x, so all is fine there.
We don't see this issue in tests as we never test post.jar anywhere. Neither in
smoke tester nor we have a testcase. To actually test it, we have to execute it
in our own JVM, maybe as a separate ANT task like we have it for testing lock
factories in Lucene.
The fix is to extend this hardcoded list in Solr's build.xml:
{code:xml}
<jar destfile="${example}/exampledocs/post.jar">
<fileset dir="${dest}/solr-core/classes/java">
<include name="org/apache/solr/util/SimplePostTool*.class"/>
<include name="org/apache/solr/util/RTimer.class"/>
<include name="org/apache/solr/util/RTimer$*.class"/>
</fileset>
<manifest>
<attribute name="Main-Class"
value="org.apache.solr.util.SimplePostTool"/>
</manifest>
</jar>
{code}
> java -jar post.jar fails under JDK 11 on master
> -----------------------------------------------
>
> Key: SOLR-13415
> URL: https://issues.apache.org/jira/browse/SOLR-13415
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: master (9.0)
> Reporter: Erick Erickson
> Priority: Blocker
>
> Most every attempt to use post.jar fails, but the simplest is:
> {code}
> java -jar post.jar -help
> {code}
>
> This gives the response:
> {code}
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/solr/util/CLIO
> at org.apache.solr.util.SimplePostTool.info(SimplePostTool.java:735)
> at org.apache.solr.util.SimplePostTool.main(SimplePostTool.java:167)
> Caused by: java.lang.ClassNotFoundException: org.apache.solr.util.CLIO
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
> ... 2 more
> {code}
> This is true even though:
> {code}
> jar -tvf solr-core-9.0.0-SNAPSHOT.jar | grep CLIO
> 747 Fri Apr 19 10:40:04 PDT 2019 org/apache/solr/util/CLIO.class
> {code}
> Using
> {code}
> openjdk version "11.0.2" 2019-01-15
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]