当我启用module.jobs时,Revel无法启动。

huangapple go评论80阅读模式
英文:

Revel doesn't start when i enable module.jobs

问题

当我在app.conf中启用module.jobs时,我遇到以下错误:

尝试重新下载模块包。

在cron包中进行了供应商处理,但没有效果。

INFO 2017/05/01 18:51:12 main.go:32: 运行revel服务器
panic: 反射:对零值的reflect.Value.Type调用

goroutine 1 [running]:
panic(0xbd1b00, 0xc4201e7c20)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:1670 +0x224
github.com/company/project/vendor/github.com/revel/revel.findControllers(0x137d2c0, 0xcaba60, 0xc4202a26e0, 0x4, 0x10)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:329 +0x9f2
github.com/company/projectvendor/github.com/revel/revel.RegisterController(0xca73e0, 0x0, 0xc420028118, 0x1, 0x1)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:414 +0x219
main.main()
/root/git/go/src/github.com/company/project/web/app/tmp/main.go:90 +0xbd0

它甚至没有到达我的应用程序的init部分。
一旦我在app.conf中禁用module.jobs行,revel就正常工作。

编辑第90行

 revel.RegisterController((*controllers0.Jobs)(nil),
    []*revel.MethodType{
        &revel.MethodType{
            Name: "Status",
            Args: []*revel.MethodArg{
            },
            RenderArgNames: map[int][]string{
                28: []string{
                    "entries",
                },
            },
        },

    })
英文:

I get below error when i enable module.jobs in app.conf
Tried redownloading the modules package.

Vendored in the cron package. no avail.

INFO 2017/05/01 18:51:12 main.go:32: Running revel server
panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
panic(0xbd1b00, 0xc4201e7c20)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:1670 +0x224
github.com/company/project/vendor/github.com/revel/revel.findControllers(0x137d2c0, 0xcaba60, 0xc4202a26e0, 0x4, 0x10)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:329 +0x9f2
github.com/company/projectvendor/github.com/revel/revel.RegisterController(0xca73e0, 0x0, 0xc420028118, 0x1, 0x1)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:414 +0x219
main.main()
/root/git/go/src/github.com/company/project/web/app/tmp/main.go:90 +0xbd0

It doesn't even get to my init section of the app.
The second I disable the module.jobs line in app.conf revel works fine.

EDIT Line 90

 revel.RegisterController((*controllers0.Jobs)(nil),
    []*revel.MethodType{
        &revel.MethodType{
            Name: "Status",
            Args: []*revel.MethodArg{
            },
            RenderArgNames: map[int][]string{
                28: []string{
                    "entries",
                },
            },
        },

    })

答案1

得分: 0

显然,这是因为我只有一半的软件包进行了供应。我没有将整个模块存储库供应进来,修复后问题解决了。

尽管如此,工作已经启用,而且没有在配置文件中设置。
我所要做的就是创建一个jobs文件夹和一个包含该作业的go文件。

英文:

Apparently this was because i was vendoring in half of the packages. i didn't have the entire modules repo vendored in, after fixing that it worked.

Jobs got enabled without having it in the config file though.
all i had to do was create a jobs folder and a go file that had the job in it.

huangapple
  • 本文由 发表于 2017年5月2日 03:17:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/43725078.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定