Announcement Announcement Module
Collapse
No announcement yet.
Bundle Context from org.osgi.framework Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bundle Context from org.osgi.framework

    hi

    I am trying to get the Bundle Context using follwoing code
    BundleContext bundleContext = (BundleContext) servletContext.getAttribute("osgi-bundlecontext");

    For this I am using org.osgi.framework 1.6.0 , I am getting the following exception ,

    java.lang.ClassCastException: org.eclipse.osgi.framework.internal.core.BundleCon textImpl cannot be cast to org.osgi.framework.BundleContext


    but when I am using 1.5.0/1.5.4 I am not getting any exception, but my STS is giving compilation errors.

    Things that I have used are
    SpringDmServer 2.0M3
    STS 2.1.0 RC1
    Spring Framework 3.0 M3

  • #2
    The package version of org.osgi.framework for dm Server 2.0.0.M3 is 1.5, so you should check where your bundle is obtaining the package org.osgi.framework from as I don't recognized package version 1.6.

    Comment

    Working...
    X