Bug 194177 - devel/opengrok: not runnable
Summary: devel/opengrok: not runnable
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Marino
URL:
Keywords:
: 181321 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-06 05:11 UTC by Yanhui Shen
Modified: 2014-10-11 09:51 UTC (History)
1 user (show)

See Also:


Attachments
opengrok patch (1.51 KB, patch)
2014-10-06 06:52 UTC, John Marino
no flags Details | Diff
shen.elf's patch(1/2) (601 bytes, patch)
2014-10-11 01:00 UTC, Yanhui Shen
no flags Details | Diff
shen.elf's patch(2/2) (336 bytes, patch)
2014-10-11 01:00 UTC, Yanhui Shen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yanhui Shen 2014-10-06 05:11:38 UTC
#### How to repeat ####
(Assume you already know how to use opengrok)

opengrok -v -d ./data -s ./refs -W ./config.xml

SEVERE: Unexpected Exception
java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
        at org.opensolaris.opengrok.index.Indexer.doIndexerExecution(Indexer.java:769)
        at org.opensolaris.opengrok.index.Indexer.main(Indexer.java:560)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.standard.StandardAnalyzer
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 2 more


#### Quick & Dirty Fix ####
1.install lucene-analyzers-common
cd /usr/ports/devel/opengrok
make patch
cd `make -V WRKSRC`
cp ./lib/lib/lucene-analyzers-common-4.7.1.jar /usr/local/share/opengrok/lib/

2.fix script /usr/local/bin/opengrok like this:
set LIBFILES = "/usr/local/share/opengrok/lib/ant.jar /usr/local/share/opengrok/lib/bcel-5.2.jar /usr/local/share/opengrok/lib/jrcs.jar /usr/local/share/opengrok/lib/lucene-core-4.7.1.jar /usr/local/share/opengrok/lib/lucene-analyzers-common-4.7.1.jar /usr/local/share/opengrok/lib/lucene-queryparser-4.7.1.jar /usr/local/share/opengrok/lib/lucene-suggest-4.7.1.jar /usr/local/share/opengrok/lib/swing-layout-0.9.jar"

#### Fix 404 issue ####
see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=181321
Comment 1 John Marino freebsd_committer freebsd_triage 2014-10-06 06:39:16 UTC
(In reply to shen.elf from comment #0)
> #### Quick & Dirty Fix ####
> 1.install lucene-analyzers-common
> cd /usr/ports/devel/opengrok
> make patch
> cd `make -V WRKSRC`
> cp ./lib/lib/lucene-analyzers-common-4.7.1.jar /usr/local/share/opengrok/lib/

This is another way of saying to add lucene-analyzers-common-4.7.1.jar to LIBFILES in the port makefile, I think.


> 2.fix script /usr/local/bin/opengrok like this:
> set LIBFILES = "/usr/local/share/opengrok/lib/ant.jar
> /usr/local/share/opengrok/lib/bcel-5.2.jar
> /usr/local/share/opengrok/lib/jrcs.jar
> /usr/local/share/opengrok/lib/lucene-core-4.7.1.jar
> /usr/local/share/opengrok/lib/lucene-analyzers-common-4.7.1.jar
> /usr/local/share/opengrok/lib/lucene-queryparser-4.7.1.jar
> /usr/local/share/opengrok/lib/lucene-suggest-4.7.1.jar
> /usr/local/share/opengrok/lib/swing-layout-0.9.jar"

This is unnecessary after doing the step above, it will adjust opengrok during installation to include the missing file.

I was going to ask for a patch but it seems in the end it's a one-line change plus a revbump.
Comment 2 John Marino freebsd_committer freebsd_triage 2014-10-06 06:41:14 UTC
*** Bug 181321 has been marked as a duplicate of this bug. ***
Comment 3 John Marino freebsd_committer freebsd_triage 2014-10-06 06:52:18 UTC
Created attachment 148023 [details]
opengrok patch

Can you apply this patch and tell me if it fixes opengrok to work out of the box?
Comment 4 John Marino freebsd_committer freebsd_triage 2014-10-07 14:54:10 UTC
(In reply to John Marino from comment #3)
> Created attachment 148023 [details]
> opengrok patch
> 
> Can you apply this patch and tell me if it fixes opengrok to work out of the
> box?

As soon as I get a confirmation that the patch is the correct fix, I'll commit it.  You got lucky that somebody picked up this PR so quickly with 150 PRs in triage right now.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-10-10 09:18:36 UTC
shen.elf, why are you not responding?  Are you unable to test this patch?
Comment 6 Yanhui Shen 2014-10-11 01:00:02 UTC
Created attachment 148182 [details]
shen.elf's patch(1/2)
Comment 7 Yanhui Shen 2014-10-11 01:00:29 UTC
Created attachment 148183 [details]
shen.elf's patch(2/2)
Comment 8 Yanhui Shen 2014-10-11 01:02:57 UTC
(In reply to John Marino from comment #5)
> shen.elf, why are you not responding?  Are you unable to test this patch?

Sorry for that...

I submitted my patches, check about them please.
Comment 9 John Marino freebsd_committer freebsd_triage 2014-10-11 07:10:35 UTC
But I asked you to test the patch that *I* submitted!
What is wrong with attachment 148023 [details]?

It contains fixes that your two patches do not.

Did you understand what I wanted?  I have a patch already waiting, I just wanted confirmation that it was a good patch before committing it.  You didn't discuss my patch at all.
Comment 10 John Marino freebsd_committer freebsd_triage 2014-10-11 07:13:44 UTC
Each of your two patches contains something the first patch doesn't, but you completely skipped pkg-plist. 

Also, in the future, just put patches together into 1 attachment as I did.
Comment 11 commit-hook freebsd_committer freebsd_triage 2014-10-11 07:29:39 UTC
A commit references this bug:

Author: marino
Date: Sat Oct 11 07:28:58 UTC 2014
New revision: 370625
URL: https://svnweb.freebsd.org/changeset/ports/370625

Log:
  devel/opengrok: Make the installed version runnable (and usable)

  PR:		194177
  Reported by:	shen.elf (gmail)
  Fixed by:	marino and shen.elf

Changes:
  head/devel/opengrok/Makefile
  head/devel/opengrok/files/opengrok.in
  head/devel/opengrok/pkg-plist
Comment 12 John Marino freebsd_committer freebsd_triage 2014-10-11 07:31:11 UTC
I committed a composite of the original patch and your two new patches.  I trust this was the correct thing to do.

Thanks for reporting the issue and helping with the solution.
Comment 13 Yanhui Shen 2014-10-11 09:51:11 UTC
(In reply to John Marino from comment #12)
> I committed a composite of the original patch and your two new patches.  I
> trust this was the correct thing to do.
> 
> Thanks for reporting the issue and helping with the solution.

Thanks for your work and patient.