arsenal
arsenal

Reputation: 24144

BundleActivator cannot be resolved to a type while using Spring OSGi

I am trying to use OSGi using Spring Dynamic Modules. Below is my pom.xml for that. I have added all the dependency related to OSGi framework I guess but still somehow, I am always getting the below exception-

BundleActivator cannot be resolved to a type

ServiceRegistration cannot be resolved to a type

Below is my pom.xml file-

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.spring.osgi.example</groupId>
    <artifactId>HelloWorldService</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>HelloWorldService</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-core</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-extender</artifactId>
            <version>1.2.1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.2.3.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>3.2.3.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>3.2.3.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.2.3.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-io</artifactId>
            <version>1.2.1</version>
        </dependency>

    </dependencies>
</project>

Is there anything I am missing in my pom.xml file. I am using Eclipse Juno.

Below is the image of my project-

enter image description here

Upvotes: 0

Views: 1719

Answers (1)

Balazs Zsoldos
Balazs Zsoldos

Reputation: 6046

Put the org.osgi:org.osgi.core with scope provided into your pom.xml. Choose a version from here http://search.maven.org/#search|gav|1|g%3A%22org.osgi%22%20AND%20a%3A%22org.osgi.core%22.

Upvotes: 3

Related Questions