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

Yeray Borges Santana (Jira) issues at jboss.org
Thu Aug 6 05:36:00 EDT 2020


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

Yeray Borges Santana commented on WFLY-13674:
---------------------------------------------

I think there could be two points to take care:
 # How to be able to log a useful message; I would expect to see in the log the descriptor name being parsed and the value of the XML element that is using a variable expression ${...} when the descriptor replacement is disabled. However, when *property-replacement=false, we are using the no-op replacer, which is initialized in the PropertyReplacers itself, that means, the property replacer has no knowledge about which file is being parsed. So, we should find out how to do it to avoid a massive modification in all the parsers. Passing this specific no-op replacer to WildFly core to handle the specific spec descriptors parsed by WildFly core should not be complex, indeed we are already passing it.
 # We should verify each descriptor. As far as I remember, one of the complexity with the descriptors is we are not using a standard consistent way to replace those properties. So, each descriptor could be using a different approach, I hope all of them are using the PropertyReplacers.NO_OP_REPLACER if the *property-replacement=false

 

Is this change limited only to the spec descriptors or is it for all the descriptors handled by the server?

> 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