You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Paul Carter-Brown (JIRA)" <ji...@apache.org> on 2017/10/10 06:33:00 UTC

[jira] [Created] (TOMEE-2134) @PostConstruct called twice on @javax.inject.Singleton

Paul Carter-Brown created TOMEE-2134:
----------------------------------------

             Summary: @PostConstruct called twice on @javax.inject.Singleton
                 Key: TOMEE-2134
                 URL: https://issues.apache.org/jira/browse/TOMEE-2134
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 7.0.3
         Environment: Linux, JDK 1.8
            Reporter: Paul Carter-Brown


Hi,

Please see GitHub test project at https://github.com/bcluap/double-postconstruct in which a simple singleton is being initialized twice (post construct is called twice). Deploy the ear to TomEE (i'm using 7.0.3) and look at the logs.

I picked up this issue in a large project with an ear containing many wars packaged as "skinny". The injected bean is in one of the shared libraries.

If the pom in the ear project is changed to <skinnyWars>false</skinnyWars> and lines 44-48 are removed then the issue goes away and the init is only called once.

I have verified that there is only once instance of the class as the hashcode remains the same on both init calls.

Any ideas?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)