classnotfoundexception

Unable to resolve superclass error when referencing .jar library

独自空忆成欢 提交于 2019-11-26 19:28:57
问题 I did an Android project and run it. It ran successfully. I developed a web service in Java and hosted it. It ran successfully. I exported the webservice into a .jar and added it to my Android project. When I try to call a method in the web service I get an Unable to resolve superclass error. My error log: Unable to resolve superclass of Lweb/service/RandomWordGeneratorService; (73) Link of class 'Lweb/service/RandomWordGeneratorService;' failed Could not find class 'web.service

ClassNotFoundException with com.mysql.cj.jdbc.Driver, MySQL Connector and IntelliJ IDEA

那年仲夏 提交于 2019-11-26 18:34:28
问题 I'm building up a Maven Java 1.8 project in which I've included the MySQL Connector as a dependency: <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.39</version> </dependency> In my application I've a singleton that holds the MySQL connection so when the application starts, the MySQL connector is triggered but I got a ClassNotFoundException for the driver that I'm using: com.mysql.cj.jdbc.Driver . The JDBC URL that I'm using is: jdbc:mysql:/

Java can't find main class

五迷三道 提交于 2019-11-26 17:39:33
问题 I have written the following Java source file ( Hello.java ): package com; public class Hello { public static void main(String[] args) { System.out.println("Hello!"); } } I save this to C:/tmpjava/Hello.java . From the command line, I navigate to that directory and run javac Hello.java . Then I run dir : Hello.class Hello.java Then, from the same directory that I just ran javac from, I run java Hello.class and get: Exception in thread "main" java.lang.NoClassDefFoundError: Hello/class Caused

java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory

拟墨画扇 提交于 2019-11-26 17:20:24
问题 I am trying to compile UploadServlet servlet via apache tomcat 8.0.14. my web.xml is fine and UploadServlet.java has compiled properly but yet when try to run i get following error ERROR HTTP Status 500 - Error instantiating servlet class UploadServlet exception javax.servlet.ServletException: Error instantiating servlet class UploadServlet root cause java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory root cause java.lang.ClassNotFoundException: org.apache.commons

android.content.ActivityNotFoundException: Unable to find explicit activity class

旧巷老猫 提交于 2019-11-26 15:31:59
I get this error: 06-06 10:45:19.685: E/AndroidRuntime(554): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.Android.myApp/com.Android.myApp.Facebook.Example}; have you declared this activity in your AndroidManifest.xml? But i have declared it in my manifest file. what might be the other reasons for such exception? My manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.Android.myApp" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="4" />

Java Class.forName() from distant directory

折月煮酒 提交于 2019-11-26 14:41:33
问题 I am currently loading Java classes using Class.forName() to load it. clazz = Class.forName("interfaces.MyClass"); But now I want to load classes from different directory, I have tried to set classpath by clazz = Class.forName("-cp \"C:/dir\" distantinterfaces.DistantClass"); With no success and ClassNotFoundException . Full path to distant class is: C:/dir/distantinterfaces/DistantClass.class 回答1: Use an URLClassLoader for this. The code might be something along the lines of: File f = new

NoClassDefFoundError for OkHttpClient

放肆的年华 提交于 2019-11-26 14:29:42
问题 After adding the facebook dependency in gradle I'm getting this runtime error: compile 'com.facebook.android:facebook-android-sdk:4.6.0' Please notice that I'm also using okhttp: compile 'com.squareup.okhttp:okhttp:2.5.0' and error log is: E/AndroidRuntime: FATAL EXCEPTION: Thread-109754 Process: com.venkat.project, PID: 4453 java.lang.NoClassDefFoundError: com.squareup.okhttp.internal.Util at com.squareup.okhttp.OkHttpClient.<clinit>(OkHttpClient.java:57) at com.venkat.project.http

org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException

夙愿已清 提交于 2019-11-26 13:19:07
I have been getting a ClassNotFoundException with org.glassfish.jersey.servlet.ServletContainer but it peculiarly started last night when I tried to start/re-start my Tomcat server (v7) with Eclipse Juno. Not sure what is going on. What's bizarre is that it just started happening last night while it was working perfectly well before that. Here is the stacktrace: Feb 25, 2014 11:11:19 AM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet com.att.ucomm.admin.UCommAdminFunctions as unavailable Feb 25, 2014 11:11:19 AM org.apache.catalina.core.StandardContext loadOnStartup

Java ClassNotFoundException with maven dependency

核能气质少年 提交于 2019-11-26 12:45:17
问题 I am getting ClassNotFoundException and NoClassDefFoundError exceptions when I attempt to run my application using a maven defined dependency. I added my maven dependency for the jar in question to my pom.xml file with the following declaration: <dependency> <groupId>spy</groupId> <artifactId>spymemcached</artifactId> <version>2.8.4</version> <scope>provided</scope> </dependency> This added the relevant JAR file to my Maven Dependencies folder in Eclipse. I can access the classes in code but

java.lang.ClassNotFoundException: org.postgresql.Driver, Android

孤街浪徒 提交于 2019-11-26 12:30:49
问题 I am running Eclipse on Windows. Following this tutorial I downloaded JDBC4, added it to my build path using Project>Properties>add External JAR, browsed for the file, it worked ( .classpath file shows the correct lib path). The package appears in my Referenced Libraries folder, so I continue the tutorial. import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; .... public void open () { try { Class.forName(\"org.postgresql