gerrit集成gitweb:Error injecting constructor, java.io.IOException: Permission denied

使用gerrit账户在centos上安装gerrit,然后集成gitweb,gerrit服务启动失败,查看日志,报错信息如下:

[2015-05-15 05:03:42,671] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.IllegalStateException: Cannot start HTTP daemon
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:139)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:291)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:203)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.io.IOException: Permission denied
  at com.google.gerrit.httpd.gitweb.GitWebServlet.<init>(GitWebServlet.java:99)
  at com.google.gerrit.httpd.gitweb.GitWebServlet.class(GitWebServlet.java:78)
  while locating com.google.gerrit.httpd.gitweb.GitWebServlet

1 error
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1018)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1040)
        at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:110)
        at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:103)
        at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220)
        at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:137)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:831)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:300)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:744)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:357)
        at org.eclipse.jetty.server.Server.doStart(Server.java:324)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:125)
        ... 12 more
Caused by: java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(File.java:2001)
        at com.google.gerrit.httpd.gitweb.GitWebServlet.makeSiteConfig(GitWebServlet.java:149)
        at com.google.gerrit.httpd.gitweb.GitWebServlet.<init>(GitWebServlet.java:126)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:86)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
        ... 29 more

gerrit的安装路径是/home/gerrit/gerrit_site,

查看gerrit_site的权限和属主,可能是之前的误操作,gerrit_site目录的属主不是gerrit:gerrit,而是777:gerrit。

执行命令:chown -R gerrit:gerrit gerrit_site

修改目录权限后,重启gerrit服务,正常运行。

over!

转载于:https://www.cnblogs.com/xiaoerlang/p/4506428.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值