Re: Wicket and Guice / legup / warp persist?
Yes it should work on 1.4.x I believe.. Regarding the method question, I think it has something todo with that the ldm gets serialized and the dao does not get reloaded on deserialization. 2010/4/28 Douglas Ferguson doug...@douglasferguson.us: Does this work on the 1.4.6 version of wicket? D/ On Apr 26, 2010, at 4:30 AM, nino martinez wael wrote: I found out that If I injected in the constructor, when using inmethod grid hibernate would complain about a closed session. So solved it as the pastebin shows.. 2010/4/26 nino martinez wael nino.martinez.w...@gmail.com: I do it like this : http://pastebin.com/wcZ8XANh public class InjectorHolder { private static Injector injector; public InjectorHolder() { } �...@inject public static void setInjector(Injector injector) { InjectorHolder.injector = injector; } public static Injector getInjector() { return injector; } } 2010/4/25 Douglas Ferguson doug...@douglasferguson.us: Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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
Re: Wicket and Guice / legup / warp persist?
The solution is using injection on the method? D/ On Apr 26, 2010, at 4:30 AM, nino martinez wael wrote: I found out that If I injected in the constructor, when using inmethod grid hibernate would complain about a closed session. So solved it as the pastebin shows.. 2010/4/26 nino martinez wael nino.martinez.w...@gmail.com: I do it like this : http://pastebin.com/wcZ8XANh public class InjectorHolder { private static Injector injector; public InjectorHolder() { } @Inject public static void setInjector(Injector injector) { InjectorHolder.injector = injector; } public static Injector getInjector() { return injector; } } 2010/4/25 Douglas Ferguson doug...@douglasferguson.us: Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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
Re: Wicket and Guice / legup / warp persist?
Does this work on the 1.4.6 version of wicket? D/ On Apr 26, 2010, at 4:30 AM, nino martinez wael wrote: I found out that If I injected in the constructor, when using inmethod grid hibernate would complain about a closed session. So solved it as the pastebin shows.. 2010/4/26 nino martinez wael nino.martinez.w...@gmail.com: I do it like this : http://pastebin.com/wcZ8XANh public class InjectorHolder { private static Injector injector; public InjectorHolder() { } @Inject public static void setInjector(Injector injector) { InjectorHolder.injector = injector; } public static Injector getInjector() { return injector; } } 2010/4/25 Douglas Ferguson doug...@douglasferguson.us: Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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
Re: Wicket and Guice / legup / warp persist?
I do it like this : http://pastebin.com/wcZ8XANh public class InjectorHolder { private static Injector injector; public InjectorHolder() { } @Inject public static void setInjector(Injector injector) { InjectorHolder.injector = injector; } public static Injector getInjector() { return injector; } } 2010/4/25 Douglas Ferguson doug...@douglasferguson.us: Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and Guice / legup / warp persist?
I found out that If I injected in the constructor, when using inmethod grid hibernate would complain about a closed session. So solved it as the pastebin shows.. 2010/4/26 nino martinez wael nino.martinez.w...@gmail.com: I do it like this : http://pastebin.com/wcZ8XANh public class InjectorHolder { private static Injector injector; public InjectorHolder() { } �...@inject public static void setInjector(Injector injector) { InjectorHolder.injector = injector; } public static Injector getInjector() { return injector; } } 2010/4/25 Douglas Ferguson doug...@douglasferguson.us: Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and Guice / legup / warp persist?
Anybody have tips on the correct way to do this? On Apr 24, 2010, at 5:42 PM, Douglas Ferguson wrote: I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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
Re: Wicket and Guice / legup / warp persist?
I also updated the exception message in commit 937854. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Apr 8, 2010 at 7:26 AM, Martin Grigorov mcgreg...@e-card.bg wrote: 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
Re: Wicket and Guice / legup / warp persist?
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
Re: Wicket and Guice / legup / warp persist?
Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and Guice / legup / warp persist?
I'm curious about how this would work with serialization/deserialization. For instance, with a data provider where would you actually put this: InjectorHolder.getInjector().inject(this) To make sure it gets called at the appropriate times? Is it ok to put it in the constructor of the data provider? Sounds like this won't be available until 1.4.8, any idea when that might surface? D/ On Apr 24, 2010, at 5:33 PM, Douglas Ferguson wrote: Interesting... I've been curious about how to properly use injection in data provider as this does not subclass component. Any tips on how to get this to work? D/ On Apr 24, 2010, at 12:32 PM, nino martinez wael wrote: 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 - 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
Wicket and Guice / legup / warp persist?
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
Re: Wicket and Guice / legup / warp persist?
Nino, It looks like the message you are getting is misleading; probably the refactoring out of the Wicket IOC module (which both Wicket's Guice and Spring modules sit on top of now) missed changing that exception's text. InjectorHolder has not been assigned is caused by Wicket's Guice integration not setting it the way Spring does. (((Application.get()).getMetaData(GuiceInjectorHolder.INJECTOR_KEY)).getInjector().injectMembers(this); would probably be the right Guice equivalent of your InjectorHolder.getInjector().inject(this); If you have taken copies of the LegUp's [1] make sure you are using the latest version. If one of us finds more time later and you're still having a problem (please let us know), we can debug the Wicket code and submit a patch, or it may be that the Guice integration just isn't supposed to work exactly like the Wicket Spring integration yet t (Igor?) but I haven't had a chance to take a good look through Jira yet, but it may be covered already in a related issue [2]. Then, we should also see how the JEE contrib (and James' stuff for CDI etc) works to keep things consistent across the board for people using IOC with Wicket. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://issues.apache.org/jira/browse/WICKET-1143 On 8 April 2010 10:08, nino martinez wael nino.martinez.w...@gmail.com 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
Re: Wicket and Guice / legup / warp persist?
Thanks for the reply Cemal. Writing inline.. 2010/4/8 Cemal Bayramoglu jweekend_for...@cabouge.com: Nino, It looks like the message you are getting is misleading; probably the refactoring out of the Wicket IOC module (which both Wicket's Guice and Spring modules sit on top of now) missed changing that exception's text. Yeah.. InjectorHolder has not been assigned is caused by Wicket's Guice integration not setting it the way Spring does. Im wondering why this is not the same, I guess following DI principles it should not matter which DI framework you used around your application. So having different implementations for Guice and Spring on the user side is bad. (((Application.get()).getMetaData(GuiceInjectorHolder.INJECTOR_KEY)).getInjector().injectMembers(this); would probably be the right Guice equivalent of your InjectorHolder.getInjector().inject(this); If you have taken copies of the LegUp's [1] make sure you are using the latest version. I believe so, but it was only for educational purposes. So if I have the need again later i'll come back for a new archetype :) If one of us finds more time later and you're still having a problem (please let us know), we can debug the Wicket code and submit a patch, or it may be that the Guice integration just isn't supposed to work exactly like the Wicket Spring integration yet t (Igor?) but I haven't had a chance to take a good look through Jira yet, but it may be covered already in a related issue [2]. Yes indeed it seems to be very related. Then, we should also see how the JEE contrib (and James' stuff for CDI etc) works to keep things consistent across the board for people using IOC with Wicket. Sounds like the right thing. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://issues.apache.org/jira/browse/WICKET-1143 On 8 April 2010 10:08, nino martinez wael nino.martinez.w...@gmail.com 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
Re: Wicket and Guice / legup / warp persist?
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
Re: Wicket and Guice / legup / warp persist?
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