Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5343

JPA analyzer forces usage of imported packages without version.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • maven-bundle-plugin-3.2.0
    • None
    • Maven Bundle Plugin
    • None
    • An OSGi contanier (JBoss, Karaf) with 2 different Javassists deployed.

    Description

      I deploy 2 different versions of javassist in my OSGi containers: javassist-3.18.1-GA.jar and javassist-3.15.0-GA.jar. Dependent on the wiring situation I get sometimes exceptions caused by incompatibility of the both versions:

      HHH000142: Javassist Enhancement failed: com.estermann.testwab.TestWabEntity: java.lang.NoSuchMethodError: javassist.util.proxy.RuntimeSupport.find2Methods(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/reflect/Method;)V

      To fix it I add version parameter on javassist import in my bundle plugin configuration:

      pom.xml
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>3.2.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
            <Import-Package>javassist.util.proxy;version=3.18, *
            </Import-Package>
          </instructions>
        </configuration>
      </plugin>

      But since bundle-plugin 3.2.0 (which includes FELIX-5233) having the Meta-Persistence instruction results in additional imported packages. So the resulting manifest includes two imports of javassist.util.proxy:

      Import-Package: 
       javassist.util.proxy;version="3.18",
       javassist.util.proxy;resolution:=optional
      

      ...which results in

      org.osgi.framework.BundleException: Duplicate import of package javassist.util for com.estermann.testwab:0.0.1.SNAPSHOT
      

      I would expect that two import declarations to get merged by the plugin.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              soundcracker@gmail.com Daniel Estermann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: