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

Ronald A. commented on JCR-4784:
--------------------------------

Yes, it is only a runtime dependency. But it was hard to fix for a avarage java 
user like me:
{code:java}
java -jar jackrabbit-standalone-2.xx.x.jar --cli file:///var/lib/jackrabbit
WARN org.apache.lucene.analysis.de.GermanAnalyzer could not be found
java.lang.ClassNotFoundException: org.apache.lucene.analysis.de.GermanAnalyzer
...
[/] >
{code}
It took me quite a while to figure out which library in which version was 
required. I finally found it and copied it into the current working directory:
{code:java}
wget 
https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers/3.6.0/lucene-analyzers-3.6.0.jar
{code}
Next try, same result. Hm. Java does not automatically take the lib from 
current directory.

Next try with
{code:java}
java -cp lucene-analyzers-3.6.0.jar -jar jackrabbit-standalone-2.xx.x.jar --cli 
file:///var/lib/jackrabbit
{code}
No change, same result. Googling quite a while. Finally a hint. Someone wrote:
{quote}Jar files are 'closed.' When you use the "-jar" option, the CLASSPATH 
(or the -cp switch) is ignored. ... you can use java -cp 
MyJar.jar;pg73jdbc2.jar a.b.c.MyMainClass
{quote}
Fine. Next challange: Getting the MainClass. Googling... Ah, within the jar in 
file META-INF/MANIFEST.MF:
{code:java}
Main-Class: org.apache.jackrabbit.standalone.Main
{code}
Finally a working command:
{code:java}
java -cp jackrabbit-standalone-xx.x.jar:lucene-analyzers-3.6.0.jar 
org.apache.jackrabbit.standalone.Main --cli file:///var/lib/jackrabbit
[/] >
{code}
Uff.

For the tomcat war container I have to remember to copy 
lucene-analyzers-3.6.0.jar to the .../tomcat/webapps/jackrabbit/WEB-INF/lib 
directory after each jackrabbit upgrade.

> Missing lucene analyzer dependency
> ----------------------------------
>
>                 Key: JCR-4784
>                 URL: https://issues.apache.org/jira/browse/JCR-4784
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: indexing
>            Reporter: Ronald A.
>            Priority: Minor
>
> Using the example configuration from 
> [https://jackrabbit.apache.org/archive/wiki/JCR/IndexingConfiguration_115513411.html]
> {code:xml}
> <analyzer class="org.apache.lucene.analysis.Analyzer.GermanAnalyzer">
>   <property>mytext</property>
> </analyzer>
> {code}
> results in the following error:
> {{java.lang.ClassNotFoundException: 
> org.apache.lucene.analysis.de.GermanAnalyzer}}
> This problem exists in all jackrabbit versions.
> Possible fix:
> {code:java}
> diff -urN jackrabbit-2.18.0.orig/jackrabbit-core/pom.xml 
> jackrabbit-2.18.0/jackrabbit-core/pom.xml
> --- jackrabbit-2.18.0.orig/jackrabbit-core/pom.xml<---->2018-11-30 
> 11:11:22.000000000 +0100
> +++ jackrabbit-2.18.0/jackrabbit-core/pom.xml<->2020-08-25 10:27:51.509017603 
> +0200
> @@ -294,6 +294,10 @@
>        <artifactId>lucene-core</artifactId>
>      </dependency>
>      <dependency>
> +      <groupId>org.apache.lucene</groupId>
> +      <artifactId>lucene-analyzers</artifactId>
> +    </dependency>
> +    <dependency>
>        <groupId>org.apache.derby</groupId>
>        <artifactId>derby</artifactId>
>      </dependency>
> diff -urN jackrabbit-2.18.0.orig/jackrabbit-parent/pom.xml 
> jackrabbit-2.18.0/jackrabbit-parent/pom.xml
> --- jackrabbit-2.18.0.orig/jackrabbit-parent/pom.xml<-->2018-11-30 
> 11:11:38.000000000 +0100
> +++ jackrabbit-2.18.0/jackrabbit-parent/pom.xml>2020-08-25 10:28:09.008828296 
> +0200
> @@ -448,6 +448,11 @@
>          <version>3.6.0</version>
>        </dependency>
>        <dependency>
> +        <groupId>org.apache.lucene</groupId>
> +        <artifactId>lucene-analyzers</artifactId>
> +        <version>3.6.0</version>
> +      </dependency>
> +      <dependency>
>          <groupId>org.apache.tika</groupId>
>          <artifactId>tika-core</artifactId>
>          <version>${tika.version}</version>
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to