BTW if anyone has trouble with this until 1.4.8 comes out then just write your own injectorholder class and in your guice module call requeststatic injection on that.. Works like a charm..
2010/4/8 nino martinez wael <nino.martinez.w...@gmail.com>: > Ahh typical :) And thanks for the update. > > 2010/4/8 Martin Grigorov <mcgreg...@e-card.bg>: >> The ticket for this is https://issues.apache.org/jira/browse/WICKET-2761 >> The fix is applied to 1.4.x at 13/03 by Juergen. >> 1.4.7 was released at 03/03. >> >> So, it will be included in next release - probably 1.4.8. >> >> On Thu, 2010-04-08 at 11:08 +0200, nino martinez wael wrote: >>> Hi >>> >>> I revived my old wicket talk yesterday and since we are using guice at >>> the company where Im at now the people attending the talk wanted to >>> see my examples in guice / wicket instead of spring / wicket. So I >>> used the legup archetype. Which worked nicely until I did a ldm which >>> I had to inject a dao into. With spring I would add the ldm to the >>> component instantiation listener, but if I do it the "spring" way >>> (InjectorHolder.getInjector().inject(this);) I get this error: >>> >>> WicketMessage: Can't instantiate page using constructor public >>> com.netdesign.blog.ViewPostPage(org.apache.wicket.PageParameters) and >>> argument postid = "[3]" >>> >>> Root cause: >>> >>> java.lang.IllegalStateException: InjectorHolder has not been assigned >>> an injector. Use InjectorHolder.setInjector() to assign an injector. >>> In most cases this should be done once inside SpringWebApplication >>> subclass's init() method. >>> at >>> org.apache.wicket.injection.web.InjectorHolder.getInjector(InjectorHolder.java:70) >>> >>> Now there are several things I wonder about, first of all, why are >>> spring mentioned at all? Does wicket package DI specific classes in a >>> common distribution, and if so should'nt it be called something >>> specific towards the targetet DI framework. And second and more >>> important how can I achieve the same thing with guice? Or this could >>> also be a "bug" with legup or something. But I actually checked the >>> init method and InjectorHolder.setInjector does not take the guice >>> component injector as argument. >>> >>> >>> >>> regards Nino >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org