Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] API incompatibility when running my maven plugin with Tycho

Hello,

I'm developing a maven plugin that is using my fork of PojoSr (with both OSGi v5 and v6).

When I included my plugin in projects using a normal (pom-first) maven build it works without problems. But when I included it in a tycho based building I'm getting the error below:

[ERROR] Failed to execute goal org.lunifera.tools.maven.repoindex:org.lunifera.tools.maven.repoindex.plugin:0.2.1-SNAPSHOT:generateIndex (generateIndex) on project tycho.demo.itp01: Execution generateIndex of goal org.lunifera.tools.maven.repoindex:org.lunifera.tools.maven.repoindex.plugin:0.2.1-SNAPSHOT:generateIndex failed: An API incompatibility was encountered while executing org.lunifera.tools.maven.repoindex:org.lunifera.tools.maven.repoindex.plugin:0.2.1-SNAPSHOT:generateIndex: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "de.kalpatec.pojosr.framework.felix.framework.ServiceRegistrationImpl$ServiceReferenceImpl.getResource()Lorg/osgi/resource/Resource;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, de/kalpatec/pojosr/framework/felix/framework/ServiceRegistrationImpl$ServiceReferenceImpl, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for interface org/osgi/resource/Capability have different Class objects for the type sr.framework.felix.framework.ServiceRegistrationImpl$ServiceReferenceImpl.getResource()Lorg/osgi/resource/Resource; used in the signature
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.lunifera.tools.maven.repoindex:org.lunifera.tools.maven.repoindex.plugin:0.2.1-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/cvgaviao/.m2/repository/org/lunifera/tools/maven/repoindex/org.lunifera.tools.maven.repoindex.plugin/0.2.1-SNAPSHOT/org.lunifera.tools.maven.repoindex.plugin-0.2.1-SNAPSHOT.jar
[ERROR] urls[1] = file:/home/cvgaviao/.m2/repository/org/lunifera/tools/maven/subsystem/org.lunifera.tools.maven.subsystem.lib.repoindex/0.2.1-SNAPSHOT/org.lunifera.tools.maven.subsystem.lib.repoindex-0.2.1-SNAPSHOT.jar
[ERROR] urls[2] = file:/home/cvgaviao/.m2/repository/org/osgi/org.osgi.core/6.0.0/org.osgi.core-6.0.0.jar
[ERROR] urls[3] = file:/home/cvgaviao/.m2/repository/org/lunifera/releng/maven/lunifera-releng-maven-fpom-mplugin/0.12.5-SNAPSHOT/lunifera-releng-maven-fpom-mplugin-0.12.5-SNAPSHOT.pom
[ERROR] urls[4] = file:/home/cvgaviao/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[5] = file:/home/cvgaviao/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[6] = file:/home/cvgaviao/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[ERROR] urls[7] = file:/home/cvgaviao/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar
[ERROR] urls[8] = file:/home/cvgaviao/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
[ERROR] urls[9] = file:/home/cvgaviao/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[10] = file:/home/cvgaviao/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar
[ERROR] urls[11] = file:/home/cvgaviao/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[12] = file:/home/cvgaviao/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[13] = file:/home/cvgaviao/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[14] = file:/home/cvgaviao/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[15] = file:/home/cvgaviao/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.17/plexus-utils-3.0.17.jar
[ERROR] urls[16] = file:/home/cvgaviao/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.19/plexus-interpolation-1.19.jar
[ERROR] urls[17] = file:/home/cvgaviao/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[18] = file:/home/cvgaviao/.m2/repository/jaxen/jaxen/1.1.6/jaxen-1.1.6.jar
[ERROR] urls[19] = file:/home/cvgaviao/.m2/repository/org/jdom/jdom2/2.0.5/jdom2-2.0.5.jar
[ERROR] urls[20] = file:/home/cvgaviao/.m2/repository/org/lunifera/tools/maven/repoindex/org.lunifera.tools.maven.repoindex.lib/0.2.1-SNAPSHOT/org.lunifera.tools.maven.repoindex.lib-0.2.1-SNAPSHOT.jar
[ERROR] urls[21] = file:/home/cvgaviao/.m2/repository/com/googlecode/pojosr/de.kalpatec.pojosr.framework/0.4.0-SNAPSHOT/de.kalpatec.pojosr.framework-0.4.0-SNAPSHOT.jar
[ERROR] urls[22] = file:/home/cvgaviao/.m2/repository/org/apache/felix/org.apache.felix.scr/1.8.2/org.apache.felix.scr-1.8.2.jar
[ERROR] urls[23] = file:/home/cvgaviao/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.9/animal-sniffer-annotations-1.9.jar
[ERROR] urls[24] = file:/home/cvgaviao/.m2/repository/org/apache/felix/org.apache.felix.log/1.0.1/org.apache.felix.log-1.0.1.jar
[ERROR] urls[25] = file:/home/cvgaviao/.m2/repository/org/apache/felix/org.apache.felix.configadmin/1.8.0/org.apache.felix.configadmin-1.8.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>tycho.demo.itp01:parent:1.0.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]


Btw, in order to run it with pom-first projects I need to include this into the plugin dependencies tag:

                    <dependency>
                        <groupId>org.osgi</groupId>
                        <artifactId>org.osgi.core</artifactId>
                        <version>6.0.0</version>
                    </dependency>

I tried to remove that in a tycho based project but then I got this exception:

Caused by: java.lang.NoClassDefFoundError: org/osgi/service/url/URLStreamHandlerService

I couldn't find which bundle is triggering that api incompatibility and I couldn't understand why that bundle doesn't provides URLStreamHandlerService type... :/

could someone help me with that, please?

many thanks,

Cristiano

Back to the top