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

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",
                },
            },
        },

    })
dongnue2071
dongnue2071 不好意思,我现在知道您是通过这种方式注册控制器的,请忽略我。
3 年多之前 回复
donglin6109
donglin6109 它适用于其他控制器就好了。
3 年多之前 回复
douju7245
douju7245 不知道我要把任何东西传递给控制器​​。我要做的就是启用模块并重新启动Revel。
3 年多之前 回复
doubi7346
doubi7346 不知道为什么要传入nil作为控制器,但这就是为什么它要中断的原因。反射:在您的情况下,在零值上调用reflect.Value.Type(*controllers0.Jobs)(nil)是零值。
3 年多之前 回复
dongyi7513
dongyi7513 您可以在main.go:90中显示您的代码吗?还是调用revel.RegisterController的那一行。
3 年多之前 回复

1个回答



显然,这是因为我要出售一半的软件包。 修复它正常工作后,我没有供应整个模块的仓库。</ p>

虽然没有在配置文件中将其启用,但启用了工作。
我要做的就是创建一个 作业文件夹和其中包含该作业的go文件。</ p>
</ div>

展开原文

原文

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.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐