I have seen many posts on this, but I still do not know or understand
how to fix it. I am getting the following error:

Problem getting itemsGuice configuration errors: 1) Unable to create
binding for ...ItemService. It was already configured on one or more
child injectors or private modules bound at ... bound at ... If it was
in a PrivateModule, did you forget to expose the binding? while
locating ...ItemService 1 error

Code:

Injector injector = Guice.createInjector(getModule1());
injector.createChildInjector(getModule2());


        private static Module getModule1()
        {
                return new PrivateModule()
                {
                        @Override
                        protected void configure()
                        {
                               bind(AppSettingsService.class);
                               expose(AppSettingsService.class);
                        }
                };
        }

        private static Module getModule2()
        {
                return new PrivateModule()
                {
                        @Override
                        protected void configure()
                        {
                               bind(ItemService.class);
                               expose(ItemService.class);
                        }
                };
        }

And there is only one @Inject anotation in this test app at:

        @Inject
        private ItemService itemService;

ItemService and AppSettingsService are empty classes.

What am I missing ?

Thanks,

Warren Bell

-- 
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.

Reply via email to