org.springframework.beans.factory.CannotLoadBeanClassException

Cannot find class [C:\launchCodeFiles\src\main\java\RunMario.java] for bean with name 'obstacle1' defined in class path resource [ApplicationContext.xml]; nested exception is java.lang.ClassNotFoundException: C:\launchCodeFiles\src\main\java\RunMario.java

Samebug tips2

jsp-api and servlet-api jars must NOT be deployed by your web app. They should be marked as provided but not deployed by your app.

The server rejects all jars that already belong to the server runtime (such as tomcat-.jar, servlet.jar). Consider substituting the CORS filter you're using for this one: https://goo.gl/ctQ7Fs

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web581

  • Cannot find class [C:\launchCodeFiles\src\main\java\RunMario.java] for bean with name 'obstacle1' defined in class path resource [ApplicationContext.xml]; nested exception is java.lang.ClassNotFoundException: C:\launchCodeFiles\src\main\java\RunMario.java
  • Cannot find class [net.arturik.testosgispring.controllers.q.C1] for bean with name '/helloWorld.htm' defined in file [k:\myhostingpanel\myhostingpanel\Tests\TestOSGIBundle\src\main\resources\dispatcher-context.xml]; nested exception is java.lang.ClassNotFoundException: net.arturik.testosgispring.controllers.q.C1
  • via Google Groups by cathal coffey, 1 month ago
    Cannot find class [org.opentripplanner.graph_builder.impl.OptimizeTransitGraphBuilderImpl] for bean with name 'optimizeTransit' defined in file [/home/cathal/OpenTripPlanner/opentripplanner-integration/src/main/resources/graph-builder.xml]; nested exception is java.lang.ClassNotFoundException: org.opentripplanner.graph_builder.impl.OptimizeTransitGraphBuilderImpl
  • Stack trace

    • org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [C:\launchCodeFiles\src\main\java\RunMario.java] for bean with name 'obstacle1' defined in class path resource [ApplicationContext.xml]; nested exception is java.lang.ClassNotFoundException: C:\launchCodeFiles\src\main\java\RunMario.java at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1397) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1397) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:735) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at RunMario.main(RunMario.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at RunMario.main(RunMario.java:17) at java.lang.reflect.Method.invoke(Method.java:497) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) Caused by: java.lang.ClassNotFoundException: C:\launchCodeFiles\src\main\java\RunMario.java at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.reflect.Method.invoke(Method.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) Caused by: java.lang.ClassNotFoundException: C:\launchCodeFiles\src\main\java\RunMario.java at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at org.springframework.util.ClassUtils.forName(ClassUtils.java:249) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320) at org.springframework.util.ClassUtils.forName(ClassUtils.java:249) ... 6 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 2 months ago
    Unknown user
    Once, 3 months ago
    Unknown user
    Once, 4 months ago
    Once, 6 months ago
    Unknown user
    Once, 6 months ago
    92 more bugmates