dpzlz08480 2017-05-01 19:17
浏览 35
已采纳

当我启用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",
                },
            },
        },

    })
  • 写回答

1条回答 默认 最新

  • dongyang9813 2017-05-23 17:52
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名