Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
org.springframework.osgi.context does not exists Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.osgi.context does not exists

    spring-osgi-bundle-archetype got problem with org.springframework.osgi.context does not exist

    I create a bundle project with

     mvn archetype:create \
    -DarchetypeGroupId=org.springframework.osgi \
    -DarchetypeArtifactId=spring-osgi-bundle-archetype \
    -DarchetypeVersion=1.1.1  \
    -Dversion=1.0 \
    -DgroupId=test \
    And create a Foo class with BundleContextAware
    import org.osgi.framework.BundleContext;
    import org.springframework.osgi.context.BundleContextAware;
    public class Foo implements BundleContextAware{
    	public void setBundleContext(BundleContext ctx) {
    Add import header in pom.xml
    do mvn package then error occurred
    C:\tmp\foooooo\src\main\java\[2,39] package
    ntext does not exist
    C:\tmp\foooooo\src\main\java\[4,28] cannot find symbol
    symbol: class BundleContextAware
    public class Foo implements BundleContextAware{
    Anybody know how to fix it ?

  • #2
    the bundle creator is aimed at creating spring application that do not depend directly on Spring DM. If you do you just have to import the needed jar in your pom.xml file as dependencies. For your case you would have to import spring-osgi-io and spring-osgi-core.
    And by the way, there is no need to specify the packages in <Import-Package> - using a * means that the tool will identifies the packages by itself.