I tried several solutions and now I always got this error:
com.google.inject.internal.ComputationException:
com.google.inject.internal.ComputationException:
com.google.inject.internal.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->null
at com.google.inject.internal.MapMaker$StrategyImpl.compute
(MapMaker.java:553)
...
Then I begin to understand why I end up with this problem: I use
Executable in ParseCommandServlet to get user input and the module
ServletModule to bind Exectuble to SimpleCommand/PipelinedCommand, but
I am getting instance of SimpleCommand through a seperate module
CommandModule, because I need to pass in parameter to CommandModule in
order to bind SimpleCommand. The reason I separate these two modules
is simply because the ServletModule is referenced in the
GuiceServletContextListener to bootstrap Guice, and I'm not able to
know the user input at that time. I guess the error is because Guice
don't know how to create SimpleCommand by the time it bind Executable
with SimpleCommand, because Guice don't have the parameter used to
create instance of SimpleCommand. I am right? if it is like what i
supposed, Is there anyway to resolve this other than refactoring the
existing code?
On Oct 22, 12:09 am, "[email protected]" <[email protected]> wrote:
> On Oct 21, 2:46 am, eric <[email protected]> wrote:
>
> > It seems the bind().toConstructor() is not documented, could you
> > please tell me more about it?
>
> See also, the toConstructor documentation:
> http://code.google.com/p/google-guice/wiki/ToConstructorBindings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---