You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Uwe Schäfer <sc...@thomas-daily.de> on 2008/02/03 16:07:05 UTC
Context reload & Guice
Hi list, Hi Al,
i´m fooling around with resin/persistent sessions as well as the new
DiskPageStore in order to get persistent Page-State after a context reload.
Everything seems to work fine, until Guice comes into play. Application
as usual:
protected void init() {
Module module = new AbstractModule(){
protected void configure() {
bind(ITest.class).to(TestImpl.class);
}};
addComponentInstantiationListener(new GuiceComponentInjector(this,module));
}
with
public interface ITest { void foo(); }
public class TestImpl implements ITest{ public void foo() {
System.out.println("foo"); } }
public class HomePage extends WebPage {
@Inject ITest test;
public HomePage(final PageParameters parameters) {
add(new Link("l") {
public void onClick() {
test.foo();
}
});
...
Unfortunately, reinjection of TestImpl fails with:
WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = l, page = org.codesmell.HomePage, path
= 11:l.HomePage$1, isVisible = true, isVersioned = true]] threw an exception
Root cause:
java.lang.NullPointerException: type
at com.google.inject.util.Objects.nonNull(Objects.java:35)
at com.google.inject.TypeLiteral.<init>(TypeLiteral.java:69)
at
com.google.inject.TypeLiteral$SimpleTypeLiteral.<init>(TypeLiteral.java:181)
at com.google.inject.TypeLiteral.get(TypeLiteral.java:169)
at
org.apache.wicket.guice.GuiceProxyTargetLocator.locateProxyTarget(GuiceProxyTargetLocator.java:61)
at
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
Is this a known problem, or should i file a bug for that ?
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Context reload & Guice
Posted by Eelco Hillenius <ee...@gmail.com>.
> Is this a known problem, or should i file a bug for that ?
Sounds like a bug to me. Could you file a bug for it please?
Cheers,
Eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Context reload & Guice
Posted by Uwe Schäfer <sc...@thomas-daily.de>.
Uwe Schäfer schrieb:
> Root cause:
>
> java.lang.NullPointerException: type
[...]
> at com.google.inject.TypeLiteral.get(TypeLiteral.java:169)
> at
> org.apache.wicket.guice.GuiceProxyTargetLocator.locateProxyTarget
> (GuiceProxyTargetLocator.java:61)
Anyone? A little diggin shows that the information needed here is not
supposed to be persisted. Why is that?
cu uwe
--
THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T + 49 761 3 85 59 0
F + 49 761 3 85 59 550
E schaefer@thomas-daily.de
www.thomas-daily.de
Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947
Registrieren Sie sich unter http://morningnews.thomas-daily.de für die
kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages
morgens um 9:00 in Ihrer Mailbox.
Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um
8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach
16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer
Redaktion lautet redaktion@thomas-daily.de.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org