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.

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

报告相同问题?

悬赏问题

  • ¥15 武汉岩海低应变分析软件,导数据库里不显示波形图
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥30 CanMv K210开发板实现功能
  • ¥15 C# datagridview 栏位进度
  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile
  • ¥15 写uniapp时遇到的问题
  • ¥15 vs 2008 安装遇到问题