Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.1, 4.3.0.Beta2
    • Component/s: None
    • Labels:
      None
    • Last commented by a user?:
      true

      Description

      In all other environments, Hibernate uses Jar scanning to find entities, mapping files, resources, etc. This currently does not work in an OSGi environment. At least within Karaf, the persistence unit's root URL uses the "bundle:/" protocol. Although a stream handler is provided in order to locate classes or resources, we need a way to get a handle on the actual jar for scanning. This needs investigated further.

        Activity

        Show
        Brett Meyer added a comment - - edited Discussion on #karaf: https://www.evernote.com/shard/s251/sh/a7996a6b-7dd7-4dd0-bc55-d03d9b976c10/880aa2a324cb1d2205dc0a5f3af3fb33
        Hide
        Brett Meyer added a comment -

        One thing to consider is that, as is, scanning will require bundles containing entities, mappings, etc. to be activated before hibernate-osgi in a container-managed environment.

        This shouldn't be a concern in app-managed. It's assumed that all necessary bundles are already activated prior to the app creating the SF/EMF.

        Show
        Brett Meyer added a comment - One thing to consider is that, as is, scanning will require bundles containing entities, mappings, etc. to be activated before hibernate-osgi in a container-managed environment. This shouldn't be a concern in app-managed. It's assumed that all necessary bundles are already activated prior to the app creating the SF/EMF.
        Hide
        Brett Meyer added a comment - - edited

        Karaf/Aries confirmed that they always explicitly return true for PersistenceUnitInfo#excludeUnlistedClasses (argh). So, for now, PUs must always set "hibernate.archive.autodetection".

        I wrote https://issues.apache.org/jira/browse/ARIES-1045 in the hopes that excludeUnlistedClasses is corrected.

        Show
        Brett Meyer added a comment - - edited Karaf/Aries confirmed that they always explicitly return true for PersistenceUnitInfo#excludeUnlistedClasses (argh). So, for now, PUs must always set "hibernate.archive.autodetection". I wrote https://issues.apache.org/jira/browse/ARIES-1045 in the hopes that excludeUnlistedClasses is corrected.
        Hide
        Brett Meyer added a comment -

        This is finished and tested in 4.2. It's also implemented in 4.3 using the new Scanner contract (HHH-8088). But, as with everything else OSGi in 4.3, is un-tested until a JPA 2.1 container is available.

        Show
        Brett Meyer added a comment - This is finished and tested in 4.2. It's also implemented in 4.3 using the new Scanner contract ( HHH-8088 ). But, as with everything else OSGi in 4.3, is un-tested until a JPA 2.1 container is available.

          People

          • Assignee:
            Brett Meyer
            Reporter:
            Brett Meyer
            Participants:
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development