Announcement Announcement Module
Collapse
No announcement yet.
Uses Violation when Importing the same package (same version) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uses Violation when Importing the same package (same version)

    Is the Resolver Report below indicating that two bundles which use/export the same package with the same version are in conflict with each other?

    Code:
        Resolver report:
            Uses violation: <Import-Package: org.springframework.transaction.aspectj; version="[3.0.0,3.1.0)"> in bundle <vehicle-1-com.apress.prodmserver.vehicle.repository.jpa_1.0.0>
                Found conflicts:
                    package        'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
                    conflicts with 'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' used by 'org.aspectj.lang.reflect_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE'
                    package        'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
                    conflicts with 'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' used by 'org.aspectj.runtime.internal_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE'
                    package        'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
                    conflicts with 'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' used by 'org.aspectj.runtime.reflect_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE'
                    package        'org.aspectj.lang.annotation_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
                    conflicts with 'org.aspectj.lang.annotation_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' imported by bundle 'vehicle-1-com.apress.prodmserver.vehicle.repository.jpa_1.0.0'
                    package        'org.aspectj.lang.reflect_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
                    conflicts with 'org.aspectj.lang.reflect_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' used by 'org.aspectj.internal.lang.reflect_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE'
    ...

  • #2
    The resolver report contains very dense information. It says why a series of candidate wirings fail to satisfy various uses constraints. The phrase "used by" is shorthand for either a direct uses constraint or a transitive uses constraint. For instance if p uses q and q uses r, then the resolver report could refer to "r ... used by p ...".

    I find it best to draw a picture for at least one of the candidate wirings to get my head round the problem. Taking the candidate:
    Code:
    package        'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.region.user_0.0.0' used by 'org.springframework.transaction.aspectj_3.0.0.RELEASE' in bundle 'org.springframework.aspects_3.0.0.RELEASE'
    conflicts with 'org.aspectj.lang_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE' used by 'org.aspectj.lang.reflect_1.6.6.RELEASE' in bundle 'com.springsource.org.aspectj.weaver_1.6.6.RELEASE'
    gives a wiring along the lines shown in the attached diagram.

    The other line of attack is to analyse the state dump using the admin console to explore the potential wirings.

    This particular problem has a similar feel to DMS-2260, so I wonder if some bundle is importing aspectj packages in such a way as to prevent them being obtained from the user region bundle 1.

    Comment


    • #3
      Thanks Glyn.

      I need to study the dm server code to thoroughly grasp the explanation provided in DMS-2260.

      Comment


      • #4
        The gist of DMS-2260 is that the AspectJ weaver bundle in present in the kernel region and dm Server shares its exported packages with the user region.

        The critical point is that dm Server is using the current Equinox support for nested frameworks to construct the user region and this support does not allow bundles, or bundle symbolic names, in the kernel region to be seen in the user region.

        So if you use import-bundle to obtain AspectJ packages, dm Server will expand the import into import-package statements tied to the bundle that exports the packages. Since this bundle is not visible in the user region, dm Server auto-provisions the bundle into the user region and then there are two sources of certain AspectJ packages which tend to lead to the uses constraint violations.

        If import-package is used instead, without specifying the AspectJ bundle, then these imports will be satisfied by the user region bundle (bundle id 1) which shares the packages from the kernel region.

        Another thing to check is that all the AspectJ packages you are importing really are available from the kernel region. There may be differences between AspectJ weaver and AspectJ runtime which are causing the problem.

        Comment

        Working...
        X