1

I am trying to combine the above technologies. I have successfully integrated JSF and CDI/weld on google appeninge (thanks to some online tutorials). So, my basic setup should be OK.

However, I cannot combine Google Cloud Endpoints into the mix (for the REST API part of my web app). The controller class annotated with @Api just does not get the @Injects injected. If I don't use CDI in this class everything works fine but with @Inject I only get NullPointerExceptions.

I guess my problem is that in those tutorials they @Inject into a class annotated with @WebServlet. But I want to inject into a @Api class. As far as I understood Weld can only inject into classes instantiated with weld (and not into some "google cloud endpoint"-instantiated classes like the @Api class).

Is someone using Google Cloud Endpoints also using CDI/Weld and can point me to some resources to make this work?

Thank you!! Chris

naeger
  • 410
  • 3
  • 17
  • Just to clarify: I use the latest versions of each technology. – naeger Jul 08 '13 at 20:30
  • Chris, you can try to get programmatically the CDI bean you're looking for using BeanManager. Where's an utility class that does it: http://svn.codehaus.org/activiti/activiti/trunk/modules/activiti-cdi/src/main/java/org/activiti/cdi/impl/util/ProgrammaticBeanLookup.java . – marciopd Sep 14 '13 at 14:24

0 Answers0