felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Faber (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FELIX-4102) Missing dependencies in
Date Tue, 04 Jun 2013 07:14:22 GMT
Daniel Faber created FELIX-4102:

             Summary: Missing dependencies in 
                 Key: FELIX-4102
                 URL: https://issues.apache.org/jira/browse/FELIX-4102
             Project: Felix
          Issue Type: Bug
          Components: Maven SCR Plugin
    Affects Versions: scr ant task 1.6.0
            Reporter: Daniel Faber

The SCR ant task throws a NoClassDefFoundError:

[...]/build.xml:13: java.lang.NoClassDefFoundError: org/osgi/service/component/annotations/Component
	at org.apache.felix.scrplugin.ds.DSAnnotationProcessor.process(DSAnnotationProcessor.java:69)
	at [...]

This even happens with a minimal project consisting of a single empty component class:

import org.apache.felix.scr.annotations.Component;
public class C { }

The easiest workaround is to add org.osgi.compendium-4.3.1.jar to the taskdef classpath:

<taskdef resource="scrtask.properties" classpath="org.apache.felix.scr.ant-1.6.0.jar;${user.home}/.m2/repository/org/osgi/org.osgi.compendium/4.3.1/org.osgi.compendium-4.3.1.jar"

If it's supposed to work like this please update the docs at https://cwiki.apache.org/FELIX/apache-felix-scr-ant-task-use.html

If not please embed missing dependencies into the ant task jar file. For the above minimal
project it's enough to add org/osgi/service/component/annotations/Component.class and org/osgi/service/component/ComponentContext.class
from org.osgi.compendium-4.3.1.jar, but I don't know if this is sufficient in all cases.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message