[ 
https://issues.apache.org/jira/browse/MYFACES-3035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996576#comment-12996576
 ] 

Leonardo Uribe commented on MYFACES-3035:
-----------------------------------------

I checke it and the problem is caused by the place used to call 
InstanceManager.newInstance. In tomcat 6 there is an interface called 
AnnotationProcessor:

public interface AnnotationProcessor {
    public void postConstruct(Object instance)
        throws IllegalAccessException, InvocationTargetException;
    public void preDestroy(Object instance)
        throws IllegalAccessException, InvocationTargetException;
    public void processAnnotations(Object instance)
        throws IllegalAccessException, InvocationTargetException, 
NamingException;
}

In tomcat 7.0 it was replaced by this interface:

public interface InstanceManager {

    public Object newInstance(String className)
        throws IllegalAccessException, InvocationTargetException, 
NamingException, 
            InstantiationException, ClassNotFoundException;

    public Object newInstance(String fqcn, ClassLoader classLoader) 
        throws IllegalAccessException, InvocationTargetException, 
NamingException, 
            InstantiationException, ClassNotFoundException;

    public void newInstance(Object o) 
        throws IllegalAccessException, InvocationTargetException, 
NamingException;

    public void destroyInstance(Object o)
        throws IllegalAccessException, InvocationTargetException;
}

Now, the old processAnnotations() and postConstruct() code was merged in 
newInstance(Object o).

The solution is just call this code from LifecycleProvider2.postConstruct, so 
managed properties are injected before postConstruct. In theory, the shouldn't 
be any problem, because we don't have a case were managed properties needs to 
be injected before processAnnotations code occur.

> PostConstruct method is called before properties are injected on Tomcat 7 
> --------------------------------------------------------------------------
>
>                 Key: MYFACES-3035
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3035
>             Project: MyFaces Core
>          Issue Type: Bug
>         Environment: Tomcat 7.0.8, MyFaces 2.0.3
>            Reporter: Nick Belaevski
>         Attachments: myfaces-3035.zip
>
>
> Deploy attached project (use 'myfaces' profile only) under Tomcat 7 and open 
> index.jsf. Inspect console output, Bean.init() should print injected list 
> contents, however on Tomcat 7 it prints null. Tomcat 6 works as expected

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to