java.lang.NoClassDefFoundError: org/osgi/framework/Bundle

Spring JIRA | Leigh Perry | 8 years ago
  1. 0

    I have an SWT and JFace desktop application working with Spring Framework 2.5.2. JFace depends on classes from org.eclipse.equinox.common_*.jar and the application includes this JAR file in the class path. In Spring Framework 2.5.3, org.springframework.core.io.support.PathMatchingResourcePatternResolver detects Equinox OSGi by loading the class org.eclipse.core.runtime.FileLocator which is found in this JAR file. When it attempts to get the "resolve" method by reflection, the following Error is thrown because the application does not include any OSGi classes in the class path: Exception in thread "main" java.lang.NoClassDefFoundError: org/osgi/framework/Bundle at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.<clinit>(PathMatchingResourcePatternResolver.java:174) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.<init>(AbstractBeanDefinitionReader.java:78) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.<init>(XmlBeanDefinitionReader.java:137) at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(SingletonBeanFactoryLocator.java:435) at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:370) The PathMatchingResourcePatternResolver code has a "catch (Exception ex)" statement, but NoClassDefFoundError extends java.lang.Error not java.lang.Exception.

    Spring JIRA | 8 years ago | Leigh Perry
    java.lang.NoClassDefFoundError: org/osgi/framework/Bundle
  2. 0

    I have an SWT and JFace desktop application working with Spring Framework 2.5.2. JFace depends on classes from org.eclipse.equinox.common_*.jar and the application includes this JAR file in the class path. In Spring Framework 2.5.3, org.springframework.core.io.support.PathMatchingResourcePatternResolver detects Equinox OSGi by loading the class org.eclipse.core.runtime.FileLocator which is found in this JAR file. When it attempts to get the "resolve" method by reflection, the following Error is thrown because the application does not include any OSGi classes in the class path: Exception in thread "main" java.lang.NoClassDefFoundError: org/osgi/framework/Bundle at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.<clinit>(PathMatchingResourcePatternResolver.java:174) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.<init>(AbstractBeanDefinitionReader.java:78) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.<init>(XmlBeanDefinitionReader.java:137) at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(SingletonBeanFactoryLocator.java:435) at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:370) The PathMatchingResourcePatternResolver code has a "catch (Exception ex)" statement, but NoClassDefFoundError extends java.lang.Error not java.lang.Exception.

    Spring JIRA | 8 years ago | Leigh Perry
    java.lang.NoClassDefFoundError: org/osgi/framework/Bundle
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    i just downloaded StdDraw3D.java, i want to try to run it...but it give these error

    Stack Overflow | 3 years ago | mateen rajid
    java.lang.NoClassDefFoundError: javax/media/j3d/Node

  1. serious2monkeys 5 times, last 1 week ago
  2. Luka 4 times, last 2 months ago
  3. davidvanlaatum 14 times, last 6 months ago
29 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NoClassDefFoundError

    org/osgi/framework/Bundle

    at java.lang.Class.getDeclaredMethods0()
  2. Java RT
    Class.getMethod
    1. java.lang.Class.getDeclaredMethods0(Native Method)
    2. java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    3. java.lang.Class.getMethod0(Unknown Source)
    4. java.lang.Class.getMethod(Unknown Source)
    4 frames
  3. Spring Core
    PathMatchingResourcePatternResolver.<clinit>
    1. org.springframework.core.io.support.PathMatchingResourcePatternResolver.<clinit>(PathMatchingResourcePatternResolver.java:174)
    1 frame
  4. Spring Beans
    SingletonBeanFactoryLocator.useBeanFactory
    1. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.<init>(AbstractBeanDefinitionReader.java:78)
    2. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.<init>(XmlBeanDefinitionReader.java:137)
    3. org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(SingletonBeanFactoryLocator.java:435)
    4. org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:370)
    4 frames