Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-758

OpenJPA doesn't find ValueHandlers with an applicable class loader



    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.2.2, 2.0.0, 2.1.1, 2.2.0
    • Fix Version/s: 1.2.3, 2.0.2, 2.1.2, 2.2.0
    • Component/s: None
    • Labels:
    • Environment:
      WebSphere 6.1, any other, 1.0.3 and probably all existing others


      We are working with ValueHandlers for enterprise applications that
      will be deployed on WebSphere, currently We believe that the
      current OpenJPA implementation has made a less than stellar choice in
      how to load value handlers, and suggest a change

      ValueHandlers are naturally (or so we find) specific for certain value
      types, that are often dependent on the semantics of your business, and
      thus are part of the application, in some way bundled in the ear you
      are deploying. We do unit testing out of the container with OpenJPA
      1.0.3, and everything works like a charm.

      When we deploy on WebSphere however, nothing works. OpenJPA does not
      find our value handlers.
      Luckily OpenJPA is open source , so we found with certainty that
      the reason is that OpenJPA tries to load the value handler with the
      class loader that loaded the meta information for the property. The
      class of that object is part of OpenJPA, and inside WebSphere, OpenJPA
      is loaded with a class loader that has no access to the application
      code, the code in the ear. So, ClassNotFoundException. Bummer.

      The long term solution, we believe, is not to use the classloader
      associated with the meta information for the property (i.e., the
      OpenJPA class loader), but instead the class loader of the entity for
      which we are working (which is also reachable via the parameters of
      the method that does the loading). Using the class loader of the
      actual value we want to handle is not an option, since the value can
      be null. The entity however is normally also part of the application,
      the ear, and cannot be null.


        1. OPENJPA-758-1.2.x.patch
          4 kB
          Heath Thomann

          Issue Links



              • Assignee:
                jpaheath Heath Thomann
                jandockx Jan Dockx
              • Votes:
                1 Vote for this issue
                6 Start watching this issue


                • Created:

                  Time Tracking

                  Original Estimate - 72h
                  Remaining Estimate - 72h
                  Time Spent - Not Specified
                  Not Specified