2009/10/15 oakridge <[email protected]> > > Stuart, > > I tried the jar at > http://peaberry.googlecode.com/svn/trunk/lib/build/guice-2.0-customloader.jar > , > which appears to have fixed the issue. I am wondering however if the > problem is more an indication of the misuse of Guice within my code > base.
Hi Julian, I can't say with only a small fragment to go on - but you might want to look at the new features in Guice 2: http://code.google.com/p/google-guice/wiki/Guice20 such as being able to override bindings (see Modules.override), private modules (see PrivateModules) and the ability to create child injectors that inherit bindings from their parent (see Injector.createChildInjector). > Do my examples above indicate bad practice or an anti-pattern of some sort? well if your aim is to hide bindings then you might find you can remove a lot of your own code by using the built-in child injectors and private modules support - however, because the patched jar solved your problem that suggests you have a binding somewhere to a system type (such as Runnable / Random) which is the trigger for the problem described in 343 this means you'd get this exception even without your module wrapping - unless you removed bindings with system type keys, or you were able to use a different (non-system) class for their binding keys :( (the full stack trace hopefully directs you to the relevant binding, or at least the module containing it) Unfortunately, I cannot use anything but a GA release > of Guice so this will block my upgrade. > I understand, my hope is this patch will be in the 2.1 maintenance release (ETA end of 2009 I believe?) > Thanks > > -- Cheers, Stuart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
