Questions tagged [classnotfoundexception]

The Java exception thrown when an application tries to load a class by name but is not able to find the class.

The Java exception thrown when an application tries to load a class by name. Usually raised by one of:

  • the forName(String) method in class Class
  • the findSystemClass(String) method in class ClassLoader
  • the loadClass(String) method in class ClassLoader

when no definition for the class with the specified name could be found in the .

Don't confuse it with , it's a different kind of error, see the following links for more details:

2221 questions
4
votes
2 answers

Discord bot JDA doesn't work, caused by java.lang.ClassNotFoundException

I am trying to build a discord bot with the Java Discord API, but when I run this code snippet: public static void main(String[] args) throws LoginException { JDABuilder builder = JDABuilder.createDefault(token); …
4
votes
0 answers

ClassNotFoundException when replacing PlatformClassLoader with AppClassLoader

Today I was fiddling around with the classloading mechanism of IntelliJ IDEA. The standard flow of the start-up mechanism is as follow: And the custom com.intellij.util.lang.UrlClassLoader - which loads all the IDEA-related JARs is created as…
LppEdd
  • 20,274
  • 11
  • 84
  • 139
4
votes
1 answer

Android tries to reference an old package name of a Broadcast receiver after OTA app update

I'm working on a custom AOSP 8.1 based OS. I have a system app (in /system/priv-app) with an exported broadcast receiver. This means it can accept Intents from outside the application. If I refactor the broadcast receiver, e.g. change its package…
4
votes
0 answers

ClassNotFoundException from maven dependency but class exists and is in classpath

After many days searching from a similar problem and its solution on the internet, I now please request your help. First of all I'm working with : Java 8 (openjdk), Maven 3, Tomcat 8.5 and I use Eclipse-2019-09 as my IDE. For this project I'm build…
northwolf
  • 51
  • 4
4
votes
0 answers

multidexing a react-native app... madness

I’m trying to make sense of the madness that is android versioning / multidexing / etc because currently my app is broken. So for various reasons I have decided to only support android 5.0 (API 21 / LOLLIPOP …argh! why are there 3 names for it!?)…
pomo
  • 2,251
  • 1
  • 21
  • 34
4
votes
2 answers

Python used to run Java JAR, ClassNotFoundException

I'm using Pythons' subprocess module to run a command. The command is used to run java JAR file. When I run it via terminal, it runs fine producing the desired output. The JAVA command via terminal: java -cp "*" -Xmx2g…
Viv
  • 1,706
  • 1
  • 18
  • 27
4
votes
2 answers

Caused by: java.lang.ClassNotFoundException: com.amazonaws.transform.JsonErrorUnmarshallerV2

Im pretty sure the reason for this is because of mismatched versions so im sharing all my pom files, i have modules of project when i was working in one of the module where i had to use cognito i added dependency and changed all other to newer…
4
votes
4 answers

ClassNotFoundException when submitting JAR to Spark via spark-submit

I'm struggling to submit a JAR to Apache Spark using spark-submit. To make things easier, I've experimented using this blog post. The code is import org.apache.spark.SparkContext import org.apache.spark.SparkConf object SimpleScalaSpark { def…
dommer
  • 19,610
  • 14
  • 75
  • 137
4
votes
1 answer

Java class is present in classpath but startup fails with Error: Could not find or load main class

I have a jar file foobar.jar containing the following two classes: public class Foo { public static void main(String[] args) { System.out.println("Foo"); } } The other class looks like this: import…
boskoop
  • 1,157
  • 1
  • 10
  • 17
4
votes
1 answer

ClassNotFoundException: Didn't find class "com.yandex.metrica.MetricaEventHandler". Unity plugin

App crashing on testers devices, but not on mine. I trying install appmetrica plugin, but it isn't work, stats of appmetrica console is null and this error, placing above. I can't find the solution of this error. Can you please give the permanent…
4
votes
1 answer

Specifying additional jars in AWS EMR custom jar application

I am trying to run a hadoop job on an EMR cluster. It is being run as a Java command for which I use a jar-with-dependencies. The job pulls data from Teradata and I am assuming Teradata related jars are also packed within the jar-with-dependencies.…
Nik
  • 5,515
  • 14
  • 49
  • 75
4
votes
1 answer

PowerMockRule ClassNotFoundException is thrown

I have problem with PowerMock and Mockito compatibility. I have test class: @ActiveProfiles("test") @PrepareForTest(LanguageUtils.class) public class MyControllerTest { @Mock private MyMockClass MyMockClass; @Autowired private…
4the3eam
  • 194
  • 1
  • 12
4
votes
5 answers

NoClassDefFoundError org/apache/poi/ss/usermodel/Workbook

I am running a shell script which calls a java class to get some data from database and create an excel report with that data. I get the error Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook when the…
4
votes
5 answers

java.lang.ClassNotFoundException: com.mchange.v2.c3p0.ComboPooledDataSource in IntelliJ while it works fine in Eclipse

I made a simple Java EE app, and I have a problem with connection to database. In eclipse everything works fine, but when I try the same in Intellij errors occur. package db; import com.mchange.v2.c3p0.ComboPooledDataSource; import…
4
votes
1 answer

Why does using the Binding Interface resut in a ClassNotFound exception?

I am trying to create a custom attribute for any Android View. I saw in this post that I could do it with the Data Binding Library. The Data Binding Guide and the post explain the layout should begin with a tag, but when inflating it I…