首页 > 解决方案 > OpenGrok 索引器无法执行

问题描述

我从他们的下载页面[1] 获取 OpenGrok 1.3.4 并按照安装说明 [2] 在我的系统上设置软件(FreeBSD 12.1-RELEASE)。

我安装了tomcat8.5,默认欢迎页面显示没有任何问题。我使用 Universal Ctags,并且我认为 OpenGrok 网站中列出的其他依赖项已经安装。

pkg install openjdk8 universal-ctags tomcat85 python36 py36-pip ctags

我可以查看http://localhost:8080/source,它显示错误消息,因为在此阶段未运行索引器(这是预期的,如安装说明中所示)。

当我尝试运行索引器时,我收到以下错误,我认为这与我的 Tomcat 或 OpenGrok 设置有关,而不是我尝试安装软件的系统。我在 Java servlet 或服务器页面方面的经验非常有限,因此我将不胜感激。

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

标签: tomcatservletsinstallationopengrok

解决方案


推荐阅读