glassfish
  1. glassfish
  2. GLASSFISH-2590

Dynamic weaving can't find classes from other classloaders

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.0pe
    • Fix Version/s: not determined
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      2,590

      Description

      I'm not sure if this is a limitation of the JVM; there may be no solution if
      that is the case.

      For a simple test case, consider any non-EE servlet container (like Tomcat,
      Resin, etc) attempting to run with dynamic weaving by adding -javaagent to the
      JVM classpath. The agent starts up in the system classloader, but the classes
      that need to be woven are loaded by classloaders specified by the container.
      Thus, the first time any web application running in the J2SE container
      references an @Entity class, a ClassNotFound exception is thrown.

      One probable workaround would be to use static weaving. Alternatively, one
      could also switch to using a full-blown J2EE container, but this isn't always
      desirable.

      It would be nice if the agent could determine which classloader was asking for
      the class in question and fetch it from/for that classloader. I don't
      understand the gory details of JVM class loading well enough to know whether
      this is practical or even possible, however.

        Activity

        Hide
        pkrogh added a comment -

        Static weaving was implemented for this case. It may be difficult to figure
        out everything required dynamically.

        I am making this an enhancement request as there is really not a bug here.

        Show
        pkrogh added a comment - Static weaving was implemented for this case. It may be difficult to figure out everything required dynamically. I am making this an enhancement request as there is really not a bug here.
        Hide
        Tom Mueller added a comment -

        Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

        Show
        Tom Mueller added a comment - Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.

          People

          • Assignee:
            tware
            Reporter:
            spatula
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: