Open GoogleCodeExporter opened 9 years ago
It should be possible to bind to inner classes. Please give me a code sample
(class
containing inner class, ginjector and ginmodule) and I'll try to find the bug.
Original comment by aragos
on 21 Apr 2010 at 3:23
I've never been able to bind to a (non-static) inner class. Although I never
had any
problem binding to a (static) nested class. I've never really needed an inner
class,
though, and the error was typically due to me forgetting the "static" keyword
on my
nested class. Maybe this is your problem?
Original comment by philippe.beaudoin
on 21 Apr 2010 at 3:43
Yes, that's precisely the problem. But it took a lot of frustrated debugging
to
figure out I'd forgotten add "static", and it seems like a more helpful error
message
should have been possible.
It turns out that I was only looking at the text of the exception that was
thrown,
since the output to stdout was suppressed by my build tools. The suppressed
output
is slightly more helpful:
[ERROR] Rebind result 'my.package.TestingGinModule.MyClassStub' has no default
(zero
argument) constructors.
java.lang.NoSuchMethodException:
my.package.TestingGinModule$MyClassStub.<init>()
But maybe it could still be better? I suppose my main take-home message from
this is
to make sure to always check stdout whenever I get an error asking if I forgot
to
inherit a required module. But I wonder if there's a way to forward the actual
error
text to the exception as well?
Original comment by stephenh...@gmail.com
on 22 Apr 2010 at 5:15
Original comment by aragos
on 4 Apr 2011 at 7:14
Original issue reported on code.google.com by
stephenh...@gmail.com
on 21 Apr 2010 at 12:52