You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pawel Zmarlicki <pz...@hotmail.com> on 2009/06/02 20:58:51 UTC

Custom annotations in a backing bean

I use some custom annotations in backing beans in my application.  They works fine as long as the attribute metadata-complete in web.xml is set to false.  However, when I set it to true, I get the following exception when JSF is trying to create an instance of the backing bean:
 
java.lang.NullPointerException
 at com.sun.faces.vendor.Tomcat6InjectionProvider.inject(Tomcat6InjectionProvider.java:82)
 at com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:203)
 at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:107)
 at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368)
 ....
 
The exception occurs because the statement servletContext.getAttribute(AnnotationProcessor.class.getName()) in Tomcat6InjectionProvider returns null.  
 
It looks like turning off the standard JEE annotations makes it impossible to use custom annotations.  Has anyone else encountered this problem?  Is there a workaround?
 
Here are components of my applications:
Java 6, Tomcat 6.0.18, JSF 1.2 Mojarra, Spring 2.5.6, Facelets 1.1.14.
_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org