Hi,

I am using guice with a gae project.
I am not able to the get instiantiated objects

following is my module

public class GGModule extends AbstractModule {

                @Override
                protected void configure() {
                        bind(CrudHelper.class).to(GaeCrudHelper.class);
                bind(PojoMapper.class).to(GaePojoMapper.class);
                bind(PojoConverter.class).to(GaePojoConverter.class);
        }

}

and my guicelistener

public class CustomListner extends GuiceServletContextListener {

        @Override
        protected Injector getInjector() {
                return Guice.createInjector(new GGModule());
        }

}

Following is where I need the injected objects but the objects are not
getting instantiated...

public class GaeServiceImpl extends RemoteServiceServlet implements
                GaeService {
        @Inject private PojoConverter pojoConverter;
        @Inject private PojoMapper pojoMapper;
        @Inject private CrudHelper crudHelper;

        public String greetServer(String query) throws
IllegalArgumentException {
                query = getEntityList(query);
                return "null";
        }

        public String getList(String query) {
                List list= crudHelper.getList(query);
                List convertedList = pojoConverter.getconverted(list);
                String str = "XXX"
               String type = pojoMapper.getType(str);

                if (query != null) {
                        return "got list";
                } else
                        return "error";
        }
}

Is the injector not getting created properly?

Or I am missing something here...

Please guide me as to where I am going wrong....


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