From issues-return-30462-apmail-struts-issues-archive=struts.apache.org@struts.apache.org Mon Jul 31 20:44:07 2017 Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B1461AB4C for ; Mon, 31 Jul 2017 20:44:07 +0000 (UTC) Received: (qmail 71334 invoked by uid 500); 31 Jul 2017 20:44:07 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 71299 invoked by uid 500); 31 Jul 2017 20:44:07 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 71163 invoked by uid 99); 31 Jul 2017 20:44:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jul 2017 20:44:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7379E180314 for ; Mon, 31 Jul 2017 20:44:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id M0dPPkBQkrIM for ; Mon, 31 Jul 2017 20:44:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 48F235F242 for ; Mon, 31 Jul 2017 20:44:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C553DE00A3 for ; Mon, 31 Jul 2017 20:44:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 11DC82464E for ; Mon, 31 Jul 2017 20:44:03 +0000 (UTC) Date: Mon, 31 Jul 2017 20:44:03 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4827) Not fully initialized ObjectFactory tries to create beans MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16107927#comment-16107927 ] ASF GitHub Bot commented on WW-4827: ------------------------------------ GitHub user aleksandr-m opened a pull request: https://github.com/apache/struts/pull/153 WW-4827 Not fully initialized ObjectFactory tries to create beans Inject `Container` in constructor of the `ObjectFactory`. Can someone test `cdi`, `osgi` and `plexus` plugins. Better ideas how to fix the issue are welcome. :) You can merge this pull request into a Git repository by running: $ git pull https://github.com/aleksandr-m/struts feature/container_injection Alternatively you can review and apply these changes as the patch at: https://github.com/apache/struts/pull/153.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #153 ---- commit 6f91d0776a545c911ca4f2875ed9976614711ef9 Author: Aleksandr Mashchenko Date: 2017-07-27T19:22:33Z Inject Container in constructor of the ObjectFactory ---- > Not fully initialized ObjectFactory tries to create beans > --------------------------------------------------------- > > Key: WW-4827 > URL: https://issues.apache.org/jira/browse/WW-4827 > Project: Struts 2 > Issue Type: Bug > Affects Versions: 2.5.12 > Reporter: Aleksandr Mashchenko > Priority: Critical > Fix For: 2.5.13 > > > This leads to issues when properties aren't injected in some cases, for example in custom type converters. > The problem happens when {{ObjectFactory}} tries to create a bean in the same time not being fully initialized itself (e.g. {{ConverterFactory}} injected before {{Container}}). > The issue happens more often under linux (all the time basically) than under windows, so it cannot be reproduced 100%. This behavior boils down to the fact that {{clazz.getDeclaredMethods()}} is used to get methods which needs to be injected and {{clazz.getDeclaredMethods()}} returned elements are - _The elements in the array returned are not sorted and are not in any particular order._ > Proposed solution moves Container injection from method to constructor in ObjectFactory - https://github.com/aleksandr-m/struts/commit/6f91d0776a545c911ca4f2875ed9976614711ef9. > The downside is it isn't backward-compatible, custom object factories must be updated. -- This message was sent by Atlassian JIRA (v6.4.14#64029)