java.lang.ClassNotFoundException

tip

This might be an issue with the file location in the Spark submit command. Try it with "spark-submit --master spark://master:7077 hello_world_from_pyspark.py {file location}"

tip

Check if you've set a name in Application -> Run. If you didn't, the generated XML is gonna have missing information and then this exception will be thrown.

tip

You might've forgot to add a dependency or it's written wrong. Also, you might be using incompatible versions of Java and Hibernate. More on this here: https://goo.gl/SjSlRA

tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k

tip

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.

tip

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

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

  • Run j2ee server
    via by 807592,
  • Cloudscape DJBC Driver Error
    via by 843854,
  • Creating this improvement request on behalf of the customer: I have a improvement request for Spring Batch as follows - 【Product & Version】 Spring Batch 3.0.0.M2 【Class】 org.springframework.batch.core.launch.support.CommandLineJobRunner 【Source Code (current)】 {code} int start(String jobPath, String jobIdentifier, String[] parameters, Set<String> opts) { ConfigurableApplicationContext context = null; try { try { context = new ClassPathXmlApplicationContext(jobPath); } catch (BeansException e) { logger.info("No XML-based context named " + jobPath + ". Trying class-based configuration."); context = new AnnotationConfigApplicationContext(Class.forName(jobPath)); } }    ・・・ {code} --------------------------------------------------------------------------- Currently, the “start” method tries to load the configuration given by parameter “jobPath” as an “XML Configuration“ by parsing the XML file of “jobPath”, at first. In case an exception occurs while loading “XML Configuration”, the configuration is loaded as a “Java Configuration”. 【Problems】 “Java Configuration” loading is necessary only when an XML file given by “jobPath” does not exist. In other cases (such as a case that an XML file is not parsable), I want the exception to be re-thrown to let us know the real reason of it. (It is also appreciated to load “Java Configuration” only when the jobPath represents a classpath, or a file of “jobPath” is not an XML file.) In my case, I gave a path of “job-launcher-context.xml” to “jobPath”, and got an exception below, which does not explain the real reason of the exception. So it is so difficult to troubleshoot without debugging.   ----------------------------------------------------------------------------- java.lang.ClassNotFoundException: job-launcher-context.xml at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at jp.co.nssol.sample.batch.common.CommandLineLauncher.start(CommandLineLauncher.java:195) at jp.co.nssol.sample.batch.common.CommandLineLauncher.main(CommandLineLauncher.java:478) --------------------------------------------------------------------------- 【Source Code (proposed)】 {code} int start(String jobPath, String jobIdentifier, String[] parameters, Set<String> opts) { ConfigurableApplicationContext context = null; try { try { context = new ClassPathXmlApplicationContext(jobPath); } catch (BeansException e) { if (org.apache.commons.lang.exception.ExceptionUtils.indexOfType(e, FileNotFoundException.class) >= 0) { // in case FileNotFoundException, load as a “Java Configuration” LOGGER.warn("No XML-based context named " + jobPath + ". Trying class-based configuration."); context = new AnnotationConfigApplicationContext(Class.forName(jobPath)); } else { throw e; // <- re-throw the exception } } {code}
    via by Shahid Shahiduzzaman,
  • Creating this improvement request on behalf of the customer: I have a improvement request for Spring Batch as follows - 【Product & Version】 Spring Batch 3.0.0.M2 【Class】 org.springframework.batch.core.launch.support.CommandLineJobRunner 【Source Code (current)】 {code} int start(String jobPath, String jobIdentifier, String[] parameters, Set<String> opts) { ConfigurableApplicationContext context = null; try { try { context = new ClassPathXmlApplicationContext(jobPath); } catch (BeansException e) { logger.info("No XML-based context named " + jobPath + ". Trying class-based configuration."); context = new AnnotationConfigApplicationContext(Class.forName(jobPath)); } }    ・・・ {code} --------------------------------------------------------------------------- Currently, the “start” method tries to load the configuration given by parameter “jobPath” as an “XML Configuration“ by parsing the XML file of “jobPath”, at first. In case an exception occurs while loading “XML Configuration”, the configuration is loaded as a “Java Configuration”. 【Problems】 “Java Configuration” loading is necessary only when an XML file given by “jobPath” does not exist. In other cases (such as a case that an XML file is not parsable), I want the exception to be re-thrown to let us know the real reason of it. (It is also appreciated to load “Java Configuration” only when the jobPath represents a classpath, or a file of “jobPath” is not an XML file.) In my case, I gave a path of “job-launcher-context.xml” to “jobPath”, and got an exception below, which does not explain the real reason of the exception. So it is so difficult to troubleshoot without debugging.   ----------------------------------------------------------------------------- java.lang.ClassNotFoundException: job-launcher-context.xml at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at jp.co.nssol.sample.batch.common.CommandLineLauncher.start(CommandLineLauncher.java:195) at jp.co.nssol.sample.batch.common.CommandLineLauncher.main(CommandLineLauncher.java:478) --------------------------------------------------------------------------- 【Source Code (proposed)】 {code} int start(String jobPath, String jobIdentifier, String[] parameters, Set<String> opts) { ConfigurableApplicationContext context = null; try { try { context = new ClassPathXmlApplicationContext(jobPath); } catch (BeansException e) { if (org.apache.commons.lang.exception.ExceptionUtils.indexOfType(e, FileNotFoundException.class) >= 0) { // in case FileNotFoundException, load as a “Java Configuration” LOGGER.warn("No XML-based context named " + jobPath + ". Trying class-based configuration."); context = new AnnotationConfigApplicationContext(Class.forName(jobPath)); } else { throw e; // <- re-throw the exception } } {code}
    via by Shahid Shahiduzzaman,
  • Can't start Tomcat!&nbsp; help me!
    via by 843804,
  • Using Eclipse..
    via by 843834,
  • Poolman Object Pooling
    via by 843797,
  • Glassfish 3.1.2 OSE on IBM J9 JVM
    via by petino,
    • java.lang.ClassNotFoundException: RmiJdbc.RJDriver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at COM.cloudscape.core.RmiJdbcDriver.<clinit>(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at com.sun.enterprise.resource.PoolManagerImpl.registerJDBCDrivers(PoolManagerImpl.java:373) at com.sun.enterprise.resource.PoolManagerImpl$1.run(PoolManagerImpl.java:79) at java.security.AccessController.doPrivileged(Native Method) at com.sun.enterprise.resource.PoolManagerImpl.<init>(PoolManagerImpl.java:77) at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.<init>(J2EETransactionManagerImpl.java:69) at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:284) at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:866)

    Users with the same issue

    SacchiSacchi
    2 times, last one,
    zsambokizsamboki
    1 times, last one,
    PilleoPilleo
    2 times, last one,
    kimihanifkimihanif
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    1377 more bugmates