[jboss-jira] [JBoss JIRA] (WFLY-13674) WARN if deployment descriptor has ${...} but *property-replacement=false

Brian Stansberry (Jira) issues at jboss.org
Tue Aug 4 15:40:00 EDT 2020


    [ https://issues.redhat.com/browse/WFLY-13674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14353921#comment-14353921 ] 

Brian Stansberry commented on WFLY-13674:
-----------------------------------------

I think we'd have to add a config attribute to let people turn this off.  Both because in theory there may be things where something that looks like an expression isn't meant to be handled but also because it will add overhead as for every value we will have to check for expression syntax.

[~yersan] Do you see any issue with passing the necessary config values to parsing done by WF Core code and having their "no-op" property replacement logic check for expressions and log a WARN?

> WARN if deployment descriptor has ${...} but *property-replacement=false
> ------------------------------------------------------------------------
>
>                 Key: WFLY-13674
>                 URL: https://issues.redhat.com/browse/WFLY-13674
>             Project: WildFly
>          Issue Type: Enhancement
>          Components: EE
>    Affects Versions: 20.0.0.Final
>            Reporter: Brad Maxwell
>            Assignee: Brian Stansberry
>            Priority: Major
>
> WARN if deployment descriptor has ${...} but *property-replacement=false
> By default the property replacement defaults to true for jboss deployment descriptors and false for annotations and spec deployment descriptors:
>  
> {code:java}
>         "annotation-property-replacement" => false,
>         "jboss-descriptor-property-replacement" => true,
>         "spec-descriptor-property-replacement" => false, {code}
>  
> In the persistence.xml for example, there is a freeform <properties> with properties that can change over time and default values.  If *property-replacement is false , then ${...} is passed to the DUP to configure and can cause problems such as in this hibernate property which changed from default value of false to true and the user was unaware that system property substitution was not occurring because they had not enabled it.
>  
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.1"
>     xmlns="http://xmlns.jcp.org/xml/ns/persistence"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
>   <persistence-unit name=“example” transaction-type="JTA">
>     <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
>     <properties>
>       <property name="hibernate.cache.use_second_level_cache" value="${hibernate_cache.enabled:false}" />
>     </properties>
>   </persistence-unit>
> </persistence> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list