Code Monkey home page Code Monkey logo

spring-boot-osgi-demo's Introduction

Spring Boot OSGi Demo

This is demo application that shows how to use OSGi with Spring Boot.

Build Application

Execute below maven command, which will create a bundle in target/deploy directory and can be deployed in Apache Karaf Container.

mvn clean install

calc-core

Here, calc-core bundle is providing service of Calculator and itself implementing Addition Service.

After deploying only calc-core bundle if we call below Rest API.

http://localhost:8013/calculator

Then, its response would be like

["Addition"]

calc-plugin

Here, calc-plugin is implementing Calculator Service and providing support for Subtraction also. This plugin is dependent on calc-core plugin.

After deploying calc-core, if we again call same Rest API.

http://localhost:8013/calculator

Then, its response would be like

["Addition","Subtraction"]

To perform calculator operation, call below RestAPI.

http://localhost:8013/calculator/{operation}?n1={n1}&n2={n2}

For Example,

http://localhost:8013/calculator/addition?n1=12&n2=12

spring-boot-osgi-demo's People

Contributors

amitbhoraniya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-boot-osgi-demo's Issues

How to deal with transitive dependencies

Hi,
I have a issue with transitive dependencies. can you please help?

So I have a project A that depends on project B that depends on ch.qos.logback.core

in project A I have a pom.xml as follows

<instructions>
                        <Bundle-SymbolicName>
                            ${pom.groupId}.${pom.artifactId}
                        </Bundle-SymbolicName>
                        <Bundle-Name>${pom.name}</Bundle-Name>
                        <Bundle-Version>${pom.version}</Bundle-Version>
                        <Bundle-Activator>
                           xxx.BundleActivatorIpml
                        </Bundle-Activator>
                        <Export-Package>
                            de.markant.pam.parser
                        </Export-Package>
                        <Private-Package>xxx.*</Private-Package>
                        <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
                        <Embed-Tansitive>true</Embed-Tansitive>
                        <Import-Package>*</Import-Package>
                    </instructions>

when I start the bundle in kafka, i get the following error


karaf@root()> bundle:start 83
Error executing command: Error executing command on bundles:
        Error starting bundle 83: Unable to resolve xxx-playground [83](R 83.0): missing requirement [xxx-playground [83](R 83.0)] osgi.wiring.package; (&(osgi.wiring.package=ch.qos.logback.core)(version>=1.2.0)(!(version>=2.0.0))) Unresolved requirements: [[xxx-playground [83](R 83.0)] osgi.wiring.package; (&(osgi.wiring.package=ch.qos.logback.core)(version>=1.2.0)(!(version>=2.0.0)))]

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.