Daniel Estermann created FELIX-5343:
---------------------------------------

             Summary: JPA analyzer forces usage of imported packages without 
version.
                 Key: FELIX-5343
                 URL: https://issues.apache.org/jira/browse/FELIX-5343
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-3.2.0
         Environment: An OSGi contanier (JBoss, Karaf) with 2 different 
Javassists deployed.
            Reporter: Daniel Estermann


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:
{code:none}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{code}
To fix it I add version parameter on javassist import in my bundle plugin 
configuration:
{code:xml|title=pom.xml|borderStyle=solid}
<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>{code}
But since bundle-plugin 3.2.0 (which includes 
[FELIX-5322|https://issues.apache.org/jira/browse/FELIX-5233]) having the 
Meta-Persistence instruction results in additional imported packages. So the 
resulting manifest includes two imports of javassist.util.proxy:
{code:none}
Import-Package: 
 javassist.util.proxy;version="3.18",
 javassist.util.proxy;resolution:=optional
{code}
...which results in
{code:none}
org.osgi.framework.BundleException: Duplicate import of package javassist.util 
for com.seeburger.estermann.testwab:0.0.1.SNAPSHOT
{code}
I would expect that two import declarations to get merged by the plugin.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to