You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2014/05/14 14:49:15 UTC
[jira] [Commented] (MYFACES-3889) Handling PostConstruct
annotations - wrong order : under wildfly-8.0.0.Final
[ https://issues.apache.org/jira/browse/MYFACES-3889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13997514#comment-13997514 ]
Leonardo Uribe commented on MYFACES-3889:
-----------------------------------------
After taking a look about it, it looks like something to be fixed on the integration code between Wildfly and MyFaces.
In Myfaces there is a class called org.apache.myfaces.config.ManagedBeanBuilder, which a method called buildManagedBean(...). That method uses LifecycleProvider2 interface to inject managed beans. But with wildfly there is an integration module that override that part, so maybe the problem is there, I don't know the details, but maybe it is something simple. MyFaces uses a SPI interface in LifecycleProvider / LifecycleProviderFactory, so it is easy to write an custom implementation and replace the one provided by wildfly to fix the lines.
I'll close this issue as invalid, because the code in MyFaces area is correct, and it should be a bug in Wildfly.
> Handling PostConstruct annotations - wrong order : under wildfly-8.0.0.Final
> ----------------------------------------------------------------------------
>
> Key: MYFACES-3889
> URL: https://issues.apache.org/jira/browse/MYFACES-3889
> Project: MyFaces Core
> Issue Type: Bug
> Environment: wildfly-8.0.0.Final, Spring 3.1.0, myfaces 2.1.12
> Reporter: hamid AGHAZZAF
> Priority: Blocker
>
> The specification states that managed bean methods annotated with @PostConstruct have to be called after the object is initialized and after dependency injection is performed. However, MyFaces calls those methods after the bean instance is created but before dependency injection is performed.
> This issue was resolved for tomcat7 server (https://issues.apache.org/jira/browse/MYFACES-1761). But remain with WildFly 8.0.Final .
> Bellow the list of third party artifacts used with their versions :
> activation-1.1.jar joda-time-2.3.jar velocity-1.6.2.jar
> aopalliance-1.0.jar jrobin-1.5.9.jar xml-apis-1.0.b2.jar
> aspectjrt-1.6.12.jar jsr305-1.3.9.jar xmlbeans-2.3.0.jar
> aspectjtools-1.6.2.jar jstl-1.2.jar
> aspectjweaver-1.6.11.jar junit-3.8.1.jar
> atmosphere-runtime-2.0.1.jar log4j-1.2.12.jar
> avalon-framework-4.1.3.jar logback-classic-0.9.30.jar
> bcmail-jdk14-1.38.jar logback-core-0.9.30.jar
> bcmail-jdk14-138.jar logkit-1.0.1.jar
> bcprov-jdk14-1.38.jar mail-1.4.jar
> bcprov-jdk14-138.jar myfaces-api-2.1.12.jar
> bctsp-jdk14-1.38.jar myfaces-impl-2.1.12.jar
> bsh-2.0b4.jar oro-2.0.8.jar
> castor-1.2.jar poi-3.7.jar
> cglib-3.0.jar poi-ooxml-3.7.jar
> commons-beanutils-1.8.2.jar poi-ooxml-schemas-3.7.jar
> commons-codec-1.3.jar primefaces-4.0.jar
> commons-collections-3.2.jar primefaces-extensions-0.7.1.jar
> commons-dbcp-1.2.2.jar servlet-api-2.3.jar
> commons-digester-1.8.jar slf4j-api-1.6.2.jar
> commons-fileupload-1.3.1.jar slf4j-log4j12-1.6.1.jar
> commons-io-2.4.jar smoothness-1.0.10.jar
> commons-lang-2.2.jar snakeyaml-1.6.jar
> commons-lang3-3.1.jar spring-aop-3.1.0.RELEASE.jar
> commons-logging-1.1.jar spring-asm-3.1.0.RELEASE.jar
> commons-pool-1.3.jar spring-aspects-3.1.0.RELEASE.jar
> dom4j-1.6.1.jar spring-beans-3.1.0.RELEASE.jar
> geronimo-stax-api_1.0_spec-1.0.jar spring-binding-2.3.2.RELEASE.jar
> groovy-all-2.0.1.jar spring-context-3.1.0.RELEASE.jar
> gsfar-base-0.0.8-SNAPSHOT.jar spring-context-support-3.1.0.RELEASE.jar
> gsfar-core-0.0.8-SNAPSHOT.jar spring-core-3.1.0.RELEASE.jar
> gsfar-domain-0.0.8-SNAPSHOT.jar spring-data-commons-1.5.2.RELEASE.jar
> gson-2.2.2.jar spring-data-commons-core-1.4.0.RELEASE.jar
> guava-12.0.jar spring-data-envers-0.1.0.RELEASE.jar
> hibernate-commons-annotations-4.0.1.Final.jar spring-data-jpa-1.3.4.RELEASE.jar
> hibernate-core-4.1.7.Final.jar spring-expression-3.2.1.RELEASE.jar
> hibernate-entitymanager-4.1.7.Final.jar spring-faces-2.3.2.RELEASE.jar
> hibernate-envers-4.1.7.Final.jar spring-integration-core-2.2.2.RELEASE.jar
> hibernate-jpa-2.0-api-1.0.1.Final.jar spring-integration-jdbc-2.2.2.RELEASE.jar
> hsqldb-1.8.0.7.jar spring-jdbc-3.1.0.RELEASE.jar
> itext-2.1.7.jar spring-js-2.3.2.RELEASE.jar
> jackson-annotations-2.1.4.jar spring-js-resources-2.3.2.RELEASE.jar
> jackson-core-2.1.4.jar spring-orm-3.1.0.RELEASE.jar
> jackson-databind-2.1.4.jar spring-retry-1.0.2.RELEASE.jar
> jasperreports-5.5.1.jar spring-security-config-3.1.4.RELEASE.jar
> javamelody-core-1.49.0.jar spring-security-core-3.1.4.RELEASE.jar
> javassist-3.15.0-GA.jar spring-security-web-3.1.4.RELEASE.jar
> jboss-logging-3.1.0.GA.jar spring-test-3.1.0.RELEASE.jar
> jboss-transaction-api_1.1_spec-1.0.0.Final.jar spring-tx-3.1.0.RELEASE.jar
> jcl-over-slf4j-1.7.1.jar spring-web-3.1.0.RELEASE.jar
> jcommander-1.12.jar spring-webflow-2.3.2.RELEASE.jar
> jcommon-1.0.15.jar spring-webmvc-3.2.1.RELEASE.jar
> jdtcore-3.1.0.jar stax-api-1.0.1.jar
> jfreechart-1.0.12.jar testng-6.4.jar
> I use spring profiles rather than maven profiles, this way, the same build (war file) is deploy-able in tomcat7 server as well as in Wildfly-8.0.0.Final.
> I have toggled two types of breakpoints in one of my managed bean :
> - The first type is for the initialization method ( annotated with @PostConstruct )
> - The second type is for setters of all properties aware of injection ( annotated with @ManagedProperty("#{xxx}") ).
> When deploying to Tomcat7, every thing is well, all injections methods are invoked before the initialization method is called.
> But, when running under Wildfly-8.0.0.Final, the initialization method is called before, and this causes NullPointerException for properties not yet injected. This behavior is the same regardless the deployment is done from the administration console or from my eclipse workbench.
> We don’t have a lot of choices regarding the version of myfaces to use, as the only installer provided for adding support of myfaces to wildFly contains the version 2.1.12. And it's not a problem for continue with this version of myfaces. The installer is down-loadable from nexus : https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.wildfly~wildfly-jsf-installer~~~
> Thanks a lot in advance for your response.
--
This message was sent by Atlassian JIRA
(v6.2#6252)