glassfish
  1. glassfish
  2. GLASSFISH-15769

Regression: Weaving attempted in Glassfish embedded even though supposedly disabled

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1_b39
    • Fix Version/s: 3.1_ms08
    • Component/s: entity-persistence
    • Labels:
      None

      Description

      Weaving is apparently disabled-or at least that's the intent-in Glassfish embedded.

      However, when I use the embeddable Glassfish APIs, documented at http://embedded-glassfish.java.net/nonav/apidocs/, it appears that weaving is attempted.

      I have an EJB project set up with a persistence unit in it. So, some classes are EJB interfaces, others are EJB implementations, and others are entity classes. There is a META-INF/persistence.xml file in there. javax.ejb.embeddable.EJBContainer deploys this "archive" fine.

      I've recently switched over to using the Glassfish embeddable APIs instead, since they are more robust (they support remote EJBs among other things). I've made no other changes.

      At test time, I get the exception message detailed by this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=323403

      That is, EclipseLink 2.2.0 is attempting to invoke a weaving-supplied method, even though weaving is disabled.

      I suspect that something about the way weaving is "disabled" is not in fact fully disabling it.

      In point of fact, I would like weaving to be ON. But I understand that this is an issue with an embedded API.

      I can work around this issue if I explicitly set weaving to be off in my persistence.xml file:

      <property name="eclipselink.weaving" value="false"/>

      ...but I'd rather not do that.

        Activity

        Hide
        ljnelson added a comment -
        Show
        ljnelson added a comment - Please also see http://java.net/jira/browse/GLASSFISH-13688
        Hide
        Sanjeeb Sahoo added a comment -

        Replying to Mitesh's response:

        > What do you mean by weaving disabled outside embedded mode?
        What this means is for whatever reason, someone may like to disable weaving in regular glassfish - e.g., someone wants to measure benefits of weaving, but they don't want to change their persistence.xmls to set the property. In such a case, the new system property can be very handy.

        >> what happens when weaving has not disabled in embedded mode using this system property, but it has been explicitly disabled using persistence.xml?
        > It will be disabled.
        That's the desired behavior.

        >> Are we loosing out any functionality by not using EmbeddedProviderContractInfo? Or, is it just a matter of name here?
        > No. It is just matter of name. EmbeddedProviderContractInfo currently just provides isWeavingDisabled(). Once the trunk opens up, > I am inclined towards removing the class with some refactoring.

        I look forward to this improvement to improve clarity in the code.

        Thanks.

        Show
        Sanjeeb Sahoo added a comment - Replying to Mitesh's response: > What do you mean by weaving disabled outside embedded mode? What this means is for whatever reason, someone may like to disable weaving in regular glassfish - e.g., someone wants to measure benefits of weaving, but they don't want to change their persistence.xmls to set the property. In such a case, the new system property can be very handy. >> what happens when weaving has not disabled in embedded mode using this system property, but it has been explicitly disabled using persistence.xml? > It will be disabled. That's the desired behavior. >> Are we loosing out any functionality by not using EmbeddedProviderContractInfo? Or, is it just a matter of name here? > No. It is just matter of name. EmbeddedProviderContractInfo currently just provides isWeavingDisabled(). Once the trunk opens up, > I am inclined towards removing the class with some refactoring. I look forward to this improvement to improve clarity in the code. Thanks.
        Hide
        ljnelson added a comment -

        Thanks for your hard work.

        Show
        ljnelson added a comment - Thanks for your hard work.
        Hide
        Mitesh Meswani added a comment -

        Checked in 44918 in trunk and 44919 in branch.
        The check in disables weaving for embedded EJB container case as was before. The status now is:
        -Weaving is enabled by default when GlassFish Emedded API is used. It can be disabled by specifying property "org.glassfish.persistence.embedded.weaving.enabled" as "false"
        -Weaving is disabled for embedded EJB container use case.

        This behavior is not yet stable and can be changed in future versions of GlassFish.

        Show
        Mitesh Meswani added a comment - Checked in 44918 in trunk and 44919 in branch. The check in disables weaving for embedded EJB container case as was before. The status now is: -Weaving is enabled by default when GlassFish Emedded API is used. It can be disabled by specifying property "org.glassfish.persistence.embedded.weaving.enabled" as "false" -Weaving is disabled for embedded EJB container use case. This behavior is not yet stable and can be changed in future versions of GlassFish.
        Hide
        marina vatkina added a comment -

        All JPA tests in embedded ejb devtests failed - see http://hudson-sca.us.oracle.com/job/ejb-devtests-v3/281/

        Show
        marina vatkina added a comment - All JPA tests in embedded ejb devtests failed - see http://hudson-sca.us.oracle.com/job/ejb-devtests-v3/281/

          People

          • Assignee:
            Mitesh Meswani
            Reporter:
            ljnelson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: