ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

Runtime error: Failed to inject app.api.MyApi into app.api.AsyncMyApi #19

Closed kevinresol closed 9 years ago

kevinresol commented 9 years ago

I got this after switch to git version of ufront-mvc (master branch). Not sure if it is related to the new minject? I upgraded because I want the FutureTools.when function.

kevinresol commented 9 years ago

I just found that the controller worked when it is accessed through remoting. But not when the page is directly accessed

the error page contents:

Uncaught error while executing app.controller.HomeController.execute_articleController()

Failed to inject app.api.MyApi into app.api.AsyncMyApi

> app.controller.HomeController.execute:446

Exception Stack:

Called from ufront/api/ApiMacros.hx line 262
Called from a C function
Called from minject/point/MethodInjectionPoint.hx line 47
Called from minject/Injector.hx line 180
Called from minject/Injector.hx line 225
Called from minject/result/InjectClassResult.hx line 39
Called from minject/InjectorRule.hx line 43
Called from minject/InjectorRule.hx line 48
Called from minject/point/PropertyInjectionPoint.hx line 42
Called from minject/Injector.hx line 180
Called from minject/Injector.hx line 225
Called from ufront/web/ControllerMacros.hx line 161
Called from ufront/web/Controller.hx line 90
jasononeil commented 9 years ago

I wasn't able to get much further than this from what we discussed on gitter.

Could you try update minject to the latest v2 version, just in case you haven't got the last round of fixes David made:

haxelib git minject https://github.com/massiveinteractive/minject.git v2 src/

Otherwise, let me know and I can try investigate further. If there's a reproducible project you can send (even privately directly to me) it could also help figure out what is happening.

jasononeil commented 9 years ago

I think you mentioned on Gitter that this was fixed when you updated libraries. Even so I found a similar problem (possibly the same problem) in #20, related to a very recent change in minject.

I've submitted a pull request for the fix here and have update ufront-mvc to work around the problem for now.

@kevinresol is it safe to close this issue, or are you still experiencing this problem?

kevinresol commented 9 years ago

Ok let's close this for now