Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reopening] Ability to specify default-lazy-init behavior for imported bean definitions [SPR-5146] #22772

Closed
Avinm opened this issue Apr 9, 2019 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@Avinm
Copy link

Avinm commented Apr 9, 2019

I would like to reopen the issue SPR-5146 (#9819) as this seems to be bulk-closed and not yet fixed in 4.3:

There doesn't seem to be a way to configure Spring so that imported bean definition files inherit the default-lazy-init behavior from the parent.

For example:

<beans ...
default-lazy-init="true">

<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

The CXF beans are "eagerly" instantiated even though the parent bean XML speficies "default-lazy-init=true". Is there a way to get the CXF beans to obey the lazy-init behavior that I want (aside from editing the META-INF/cxf/cxf.xml files myself and re-jarring CXF?). (the CXF beans take a few seconds to initialize and this is a problem with client apps in short-running JVMs that may not hit CXF on all code paths)

It seems like either:

  1. 'default-lazy-init' should be inherited from the parent bean definition reader
  2. There should be an attribute on the import element that allows for specifying the desired default-lazy-init behavior for the imported bean defs.

Affects: 2.5.5 - 4.3

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 9, 2019
@rstoyanchev
Copy link
Contributor

I've re-opened the original ticket (sorry for the badly phrased bulk closing comment). Please copy and paste your comment above there, so we have a single ticket and history.

@rstoyanchev rstoyanchev added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants