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

Subsystem property injections ignored while using local/alfresco-global.properties #360

Closed
bhagyas opened this Issue Feb 19, 2016 · 21 comments

Comments

Projects
None yet
4 participants
@bhagyas
Contributor

bhagyas commented Feb 19, 2016

No description provided.

@ohej

This comment has been minimized.

Collaborator

ohej commented Feb 19, 2016

Any chance you could explain a bit more about what the issue exactly is?

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Feb 19, 2016

Created a subsystem within the repo-amp and wanted to inject properties using ${} notation.

The properties were defined in repo-amp/src/test/properties/local/alfresco-global.properties.

The instantiated beans don't seem to be picking up the properties.

The project was run using the runner project. (SDK 2.1.0)

@ohej

This comment has been minimized.

Collaborator

ohej commented Feb 19, 2016

Have you tried defining the properties in repo/src/main/properties/local/alfresco-global.properties?

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Feb 19, 2016

No.

@ohej

This comment has been minimized.

Collaborator

ohej commented Feb 19, 2016

Would you like to try it and report back?

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Feb 19, 2016

Sure.

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Feb 26, 2016

The suggested approach did not work.

@rgauss

This comment has been minimized.

Member

rgauss commented Feb 26, 2016

@bhagyas, do you have default values defined in a subsystem properties file?

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Feb 26, 2016

Yes.

@gravitonian

This comment has been minimized.

Contributor

gravitonian commented Feb 29, 2016

Subsystem properties override alfresco-global.properties so closing as not a bug

@gravitonian

This comment has been minimized.

Contributor

gravitonian commented Mar 1, 2016

Just clarifying exactly what subsystem files override what to avoid confusion.

For example, if you have the following subsystem properties config file in a Repo AMP:

repo-amp/src/main/amp/config/alfresco/extension/subsystems/<category>/<type>/<id>
such as:
repo-amp/src/main/amp/config/alfresco/extension/subsystems/email/OutboundSMTP/outbound/outboundSMTP.properties
Then it will take precedence over default subsystem configuration in a Repo AMP:

/alfresco/extension/subsystems/<category>/default/default

Which takes precedence over:

alfresco-global.properties

Which takes precedence over default property values set in:

webapps/alfresco/WEB-INF/classes/alfresco/subsystems/<category>/<type>/<id>

Note also, any setting via JMX goes into the database and takes precedence over everything else above.

@gravitonian gravitonian reopened this Mar 1, 2016

@gravitonian gravitonian closed this Mar 1, 2016

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Mar 1, 2016

This issue needs to be reopened.

Please understand and go through the history of an issue before closing.

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Mar 1, 2016

The issue is specific to the SDK, most probably due to the classpaths for subsystems being isolated and set by code instead of configuration.

@ohej

This comment has been minimized.

Collaborator

ohej commented Mar 1, 2016

Reopening. Can you please explain EXACTLY what you are trying to do? Provide an example. Even after re-reading the issue I still don't understand what the issue is.

@ohej ohej reopened this Mar 1, 2016

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Mar 1, 2016

I wanted to inject a property to a spring configuration file within a subsystem being developed with SDK.

The defined properties for subsystem spring files doesn't get injected during bean initialisation.

@gravitonian

This comment has been minimized.

Contributor

gravitonian commented Mar 1, 2016

Hi,

Can you have a look at the subsystem dev docs, which include a custom subsystem implementation with sample code, and see if they give you any clues to what is going wrong: http://docs.alfresco.com/5.1/references/dev-extension-points-custom-subsystem.html

@rgauss

This comment has been minimized.

Member

rgauss commented Mar 1, 2016

I can confirm that things work as expected in the SDK.

See this forthcoming SDK sample.

You can override the subsystem values in repo/src/main/properties/local/alfresco-global.properties as mentioned above.

Make sure you have defaults defined in a subsystem properties file, also mentioned above.

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Mar 1, 2016

Thanks. In this case it has been a custom authentication module within the Authentication subsystem.

Are there any naming conventions for property naming for such submodules within a subsystem?

In comparison with the SDK samples which only consist of a repo-amp module, this instance was run using all-in-one runner module.

@rgauss

This comment has been minimized.

Member

rgauss commented Mar 1, 2016

Are there any naming conventions for property naming for such submodules within a subsystem?

You could follow precedence of the existing Authentication subsystems.

this instance was run using all-in-one

That's what I've used as well.

@bhagyas

This comment has been minimized.

Contributor

bhagyas commented Mar 1, 2016

Is the naming convention tied to property injection mechanism? If not, I guess we can be pretty sure that's not the reason.

@rgauss

This comment has been minimized.

Member

rgauss commented Mar 1, 2016

Is the naming convention tied to property injection mechanism?

It should not be. Just be sure your property names are exactly the same in your spring beans, subsystem property files, and alfresco-global.properties, and that they don't conflict with existing property names.

@ohej ohej closed this Mar 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment