Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10808

Default Value of local-receiver-pass-by-value in jboss-ejb-client Descriptor is Not Respected

    Details

    • Steps to Reproduce:
      Hide
      • Download the "Java EE7 Full & Web Distribution" of Wildfly 13 and extract it on your system
      • Download the attached TestWAR.war and create an exploded deployment in the standalone/deployments folder of the Wildfly 13 download – make sure the exploded deployment is called TestWAR.war
      • Alongside the exploded deployment, create a TestWAR.war.dodeploy file
      • Start Wildfly 13:
        # Default config works fine
        cd $WFLY_INSTALL_DIR/bin
        ./standalone.sh
        
      • You should see that the TestWAR gets deployed and a single EJB is bound
      • In the current deployment, there is a jboss-ejb-client.xml with the following contents:
        <?xml version="1.0" encoding="UTF-8"?>
        <jboss-ejb-client xmlns="urn:jboss:ejb-client:1.2">
            <client-context>
                <ejb-receivers></ejb-receivers>
            </client-context>
        </jboss-ejb-client>
        

        One would expect that the local ejb receiver should use pass-by-value semantics since the attribute is not explicitly configured and the default is true

      • In your browser, navigate to http://localhost:8080/TestWAR/
      • You will see the results of printing an EJB parameter's object reference from both outside and inside the EJB invocation. The object reference is the same, which is not expected.
      • Inside the exploded TestWAR deployment, delete the jboss-ejb-client.xml deployment descriptor located in the META-INF folder
      • Restart Wildfly and again navigate to http://localhost:8080/TestWAR/
      • With the complete absence of the deployment descriptor, pass-by-value semantics are correctly used.

      Source code for TestWAR.war is included inside the archive.

      Show
      Download the "Java EE7 Full & Web Distribution" of Wildfly 13 and extract it on your system Download the attached TestWAR.war and create an exploded deployment in the standalone/deployments folder of the Wildfly 13 download – make sure the exploded deployment is called TestWAR.war Alongside the exploded deployment, create a TestWAR.war.dodeploy file Start Wildfly 13: # Default config works fine cd $WFLY_INSTALL_DIR/bin ./standalone.sh You should see that the TestWAR gets deployed and a single EJB is bound In the current deployment, there is a jboss-ejb-client.xml with the following contents: <?xml version="1.0" encoding="UTF-8"?> <jboss-ejb-client xmlns="urn:jboss:ejb-client:1.2"> <client-context> <ejb-receivers></ejb-receivers> </client-context> </jboss-ejb-client> One would expect that the local ejb receiver should use pass-by-value semantics since the attribute is not explicitly configured and the default is true In your browser, navigate to http://localhost:8080/TestWAR/ You will see the results of printing an EJB parameter's object reference from both outside and inside the EJB invocation. The object reference is the same, which is not expected. Inside the exploded TestWAR deployment, delete the jboss-ejb-client.xml deployment descriptor located in the META-INF folder Restart Wildfly and again navigate to http://localhost:8080/TestWAR/ With the complete absence of the deployment descriptor, pass-by-value semantics are correctly used. Source code for TestWAR.war is included inside the archive.

      Description

      The jboss-ejb-client.xml deployment descriptor file can be used to configure the pass semantics of the local EJB receiver using the local-receiver-pass-by-value attribute.

      As per the EJB spec, the default behaviour should be to pass by value, and this is appropriately reflected in the jboss-ejb-client XSD. As of Wildfly 11, the omission of the local-receiver-pass-by-value attribute in a jboss-ejb-client deployment descriptor actually results in remote EJB parameters and the return value being passed by reference as opposed to the documented default of being passed by value.

      It appears that this bug is a result of changes made for WFLY-5403. The root cause is that the EJBClientDescriptorMetaDataProcessor.java class only uses the pass-by-value receiver if the local-receiver-pass-by-value attribute is Boolean.TRUE (line 177 in 13.0.0.Final), but EJBClientDescriptor10Parser.java defaults the value to null if it is not included in the jboss-ejb-client.xml (line 132 in 13.0.0.Final). The old and working behaviour was to fallback to the value configured at the ejb subsystem level if the jboss-ejb-client.xml excluded the attribute.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  baranowb Bartosz Baranowski
                  Reporter:
                  jswett33 Joshua Swett
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: