Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Daniel Watrous
Here's a post that helped me understand this better: http://stackoverflow.com/questions/16047829/proxy-cannot-be-cast-to-class On Tue, Jul 23, 2013 at 2:15 PM, Daniel Watrous wrote: > Dan, > > Good point. After considering I decided to modify my interface to expose > the function I need and let

Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Daniel Watrous
Dan, Good point. After considering I decided to modify my interface to expose the function I need and let the implementation worry about casting where necessary. Thanks, Daniel On Tue, Jul 23, 2013 at 9:58 AM, Dan Retzlaff wrote: > @Inject the implementation, not the interface. @Inject'd impl

Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Dan Retzlaff
@Inject the implementation, not the interface. @Inject'd implementations have some code smell, but no more than downcasting. On Tue, Jul 23, 2013 at 8:40 AM, Daniel Watrous wrote: > That being the case, is there any way to get an instance that I can cast to > a concrete type? > > > On Tue, Jul 2

Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Daniel Watrous
That being the case, is there any way to get an instance that I can cast to a concrete type? On Tue, Jul 23, 2013 at 9:27 AM, Martin Grigorov wrote: > Hi, > > > On Tue, Jul 23, 2013 at 6:20 PM, Daniel Watrous >wrote: > > > Hi, > > > > I'm having an issue that I suspect is related to the wicket

Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Martin Grigorov
Hi, On Tue, Jul 23, 2013 at 6:20 PM, Daniel Watrous wrote: > Hi, > > I'm having an issue that I suspect is related to the wicket integration > with Guice. Any help is appreciated. > > I have a Page class that uses field injection to inject a DAO. I then want > to cast my DAO to a more specific t

Re: Wicket, Guice and the $Proxy object

2013-07-23 Thread Daniel Watrous
Here's a little more detail when I debug and attempt to do just the cast: Cannot cast an instance of "class $Proxy23 (loaded by instance of org.eclipse.jetty.webapp.WebAppClassLoader(id=3511))" to an instance of "class com.hp.honeybadger.persistence.dao.morphia.MorphiaCnavUrlDAO (loaded by instanc

Wicket, Guice and the $Proxy object

2013-07-23 Thread Daniel Watrous
Hi, I'm having an issue that I suspect is related to the wicket integration with Guice. Any help is appreciated. I have a Page class that uses field injection to inject a DAO. I then want to cast my DAO to a more specific type (what I inject is the interface). Here's what that looks like public