I fetched OpenGrok 1.3.4 from their download page[1] and followed the installation instructions [2] to setup the software on my system (FreeBSD 12.1-RELEASE).
I have tomcat8.5 installed and the default welcome page displays without any issues. I use Universal Ctags and I think other dependencies listed in OpenGrok web site have already been installed.
pkg install openjdk8 universal-ctags tomcat85 python36 py36-pip ctags
I can view http://localhost:8080/source
, which displays error messages since the indexer was not run at this stage (this is expected as indicated in the installation instructions).
When I try to run the indexer, I am getting the error below and I think it is related to my Tomcat or OpenGrok settings rather than the system I am trying to install the software on. My experience with Java servlets or server pages is very limited hence I would appreciate any guidance.
root@opengrok-manual:~ # java -Djava.util.logging.config.file=/opengrok/etc/logging.properties -jar /opengrok/dist/lib/opengrok.jar -c /usr/local/bin/uctags -s /opengrok/src -d /opengrok/data -H -P -S -G -W /opengrok/etc/configuration.xml -U http://localhost:8080/source
17:00:39 SEVERE: Couldn't notify the webapp on http://localhost:8080/source.
javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1056)
at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:859)
at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:743)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:741)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:404)
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:300)
at org.opengrok.indexer.index.IndexerUtil.enableProjects(IndexerUtil.java:60)
at org.opengrok.indexer.index.Indexer.main(Indexer.java:316)
Couldn't notify the webapp on http://localhost:8080/source: HTTP 401 Unauthorized.
17:00:43 WARNING: Couldn't notify the webapp that project org.opengrok.indexer.configuration.Project@1becde2d was indexed: InboundJaxrsResponse{context=ClientResponse{method=PUT, uri=http://localhost:8080/source/api/v1/projects/hellogitworld/indexed, status=401, reason=Unauthorized}}
17:00:46 WARNING: Couldn't notify the webapp that project org.opengrok.indexer.configuration.Project@ab468482 was indexed: InboundJaxrsResponse{context=ClientResponse{method=PUT, uri=http://localhost:8080/source/api/v1/projects/WhileyCompiler/indexed, status=401, reason=Unauthorized}}
17:00:46 SEVERE: Failed to send configuration to http://localhost:8080/source (is web application server running with opengrok deployed?)
java.io.IOException: InboundJaxrsResponse{context=ClientResponse{method=PUT, uri=http://localhost:8080/source/api/v1/configuration?reindex=true, status=401, reason=Unauthorized}}
at org.opengrok.indexer.configuration.RuntimeEnvironment.writeConfiguration(RuntimeEnvironment.java:1493)
at org.opengrok.indexer.index.Indexer.sendToConfigHost(Indexer.java:1102)
at org.opengrok.indexer.index.Indexer.main(Indexer.java:347)
root@opengrok-manual:~ #
[1] https://github.com/oracle/opengrok/releases
[2] https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok