Skip to content
Advertisement

Tag: classnotfoundexception

android.os.BadParcelableException: ClassNotFoundException when unmarshalling

We are facing getting a BadParceableException and we have no idea why. Above is the stacktrace: We saw some similars errors here in stackoverflow, but no one actually worked for us. The exception is saying that the error happens at “super(in)”, in this class: private static class SavedState extends BaseSavedState { int mSelectedPosition; } Does anyone have any idea to

Keep getting NoClassDefFoundError while loading a class with URLClassLoader

Recently I’m creating something that have to load/unload external jar packages dynamically. I’m now trying to do this with URLClassLoader, but I keep getting NoClassDefFoundError while trying to make new instances. It seems that the external class is loaded successfully since the codes in the constructor are executed, but ClassNotFoundException and NoClassDefFoundError still keep being thrown. I made an small

JSONObject ClassNotFoundException

I am working in IntelliJ and using Maven. I have a class that uses JSONObject: Maven dependency in the pom.xml file: I can do a mvn clean package and builds successfully. But when I try to run it, I get: Error: java.lang.ClassNotFoundException: org.json.JSONObject Is there anything else I’m missing here? Thanks! Answer Add json jar to your classpath or use

classpath – running a java program from the command line

My code compiled fine with the following command: javac -cp “../lib/*” AvroReader.java (lib is where i put my jar files) At run time I get a ClassNotFoundException on the following line: DatumReader<?> dtmrdr = new GenericDatumReader(); It says it can’t find org.apache.avro.generic.GenericDatumReader even though I’ve imported it. Why is this happening? Answer Importing has nothing to do with loading classes

Advertisement