You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eduardo Nunes <es...@gmail.com> on 2009/04/22 02:52:50 UTC

wicket-guice problem with injection of a final class

Hello,

  I tried to @Inject a Class<? extends Page> in a home page and I got
an exception about the lazy proxy. As I could see in the stack trace,
wicket-guice is trying to create a proxy to the attribute that I
@Inject and the cglib tries to extend Class<? extends Page> class
without a success. To avoid this problem I @Inject a provider. Who is
in charge of the wicket-guice project? Is there a better way to avoid
this problem?

Below part of the source code:

---- WicketPage.java ----
public class WicketPage extends TypeLiteral<Class<? extends Page>> {
}
---- cut here ----

---- MyOwnGuiceModule.java ----
bind(new WicketPage()).annotatedWith(
	Names.named("SignOutPage.redirectTo").toInstance(
	SignOutPage.class);
---- cut here ----

---- SignOutPage.java ----
@Inject
@Named("SignOutPage.redirectTo")
private Class<? extends Page> redirectTo;
---- cut here ----

Thanks,
Eduardo S. Nunes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org