java.lang.NoClassDefFoundError: javax/ws/rs/Path

SpringSource Issue Tracker | Martin Lippert | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I am using the latest restbucks example app from Oliver and I came across this exception: {noformat} Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter cannot be found by org.springframework.data.core_1.7.0.20140120-CI at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 59 more {noformat} followed by another one: {noformat} java.lang.NoClassDefFoundError: javax/ws/rs/Path at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar$JaxRsEntityControllerBuilderDefinitionBuilder.getBeanDefinition(LinkBuilderBeanDefinitionRegistrar.java:99) at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar.registerBeanDefinitions(LinkBuilderBeanDefinitionRegistrar.java:74) at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions(HypermediaSupportBeanDefinitionRegistrar.java:96) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:319) {noformat} All this happens because of classloader confusion in Spring IDE, where the classloader that is being used for reading the JavaConfig is using a parent classloader from Spring IDE (org.springframework.ide.eclipse.core) that is itself having a DynamicImport-Package: * on its manifest. This opens the door to various issues around loading classes from the IDE instead of the project classpath.

    SpringSource Issue Tracker | 3 years ago | Martin Lippert (c)
    java.lang.NoClassDefFoundError: javax/ws/rs/Path
  2. 0

    I am using the latest restbucks example app from Oliver and I came across this exception: {noformat} Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter cannot be found by org.springframework.data.core_1.7.0.20140120-CI at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 59 more {noformat} followed by another one: {noformat} java.lang.NoClassDefFoundError: javax/ws/rs/Path at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar$JaxRsEntityControllerBuilderDefinitionBuilder.getBeanDefinition(LinkBuilderBeanDefinitionRegistrar.java:99) at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar.registerBeanDefinitions(LinkBuilderBeanDefinitionRegistrar.java:74) at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions(HypermediaSupportBeanDefinitionRegistrar.java:96) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:319) {noformat} All this happens because of classloader confusion in Spring IDE, where the classloader that is being used for reading the JavaConfig is using a parent classloader from Spring IDE (org.springframework.ide.eclipse.core) that is itself having a DynamicImport-Package: * on its manifest. This opens the door to various issues around loading classes from the IDE instead of the project classpath.

    SpringSource Issue Tracker | 3 years ago | Martin Lippert
    java.lang.NoClassDefFoundError: javax/ws/rs/Path
  3. 0

    NoClassDefFoundError if @EnableHypermediaSupport is used without adding spring-plugin dependency

    GitHub | 4 years ago | azagorneanu
    java.lang.NoClassDefFoundError: org/springframework/plugin/core/support/PluginRegistryFactoryBean
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      javax/ws/rs/Path

      at org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar$JaxRsEntityControllerBuilderDefinitionBuilder.getBeanDefinition()
    2. Spring Hateoas
      HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions
      1. org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar$JaxRsEntityControllerBuilderDefinitionBuilder.getBeanDefinition(LinkBuilderBeanDefinitionRegistrar.java:99)
      2. org.springframework.hateoas.config.LinkBuilderBeanDefinitionRegistrar.registerBeanDefinitions(LinkBuilderBeanDefinitionRegistrar.java:74)
      3. org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar.registerBeanDefinitions(HypermediaSupportBeanDefinitionRegistrar.java:96)
      3 frames
    3. Spring Context
      ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars
      1. org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:319)
      1 frame