java.lang.ClassNotFoundException: myPackage.MyClass

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert 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}

,
Expert 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.

Solutions on the web

java.lang.ClassNotFoundException: myPackage.MyClass
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.mongodb.morphia.mapping.DefaultCreator.getClass(DefaultCreator.java:175)
at org.mongodb.morphia.mapping.DefaultCreator.createInstance(DefaultCreator.java:87)
at org.mongodb.morphia.mapping.DefaultCreator.createInstance(DefaultCreator.java:102)
at org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject(EmbeddedMapper.java:64)
at org.mongodb.morphia.mapping.Mapper.readMappedField(Mapper.java:793)
at org.mongodb.morphia.mapping.Mapper.fromDb(Mapper.java:250)
at org.mongodb.morphia.mapping.Mapper.fromDBObject(Mapper.java:191)
at org.mongodb.morphia.query.MorphiaIterator.convertItem(MorphiaIterator.java:134)
at org.mongodb.morphia.query.MorphiaIterator.processItem(MorphiaIterator.java:146)
at org.mongodb.morphia.query.MorphiaIterator.next(MorphiaIterator.java:117)
at services.DataService.getAllEntries(DataService.java:25)
at controllers.ApplicationController.index(ApplicationController.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.mangoo.routing.handlers.RequestHandler.invokeController(RequestHandler.java:125)
at io.mangoo.routing.handlers.RequestHandler.getResponse(RequestHandler.java:105)
at io.mangoo.routing.handlers.RequestHandler.handleRequest(RequestHandler.java:46)
at io.mangoo.routing.handlers.FormHandler.nextHandler(FormHandler.java:85)
at io.mangoo.routing.handlers.FormHandler.handleRequest(FormHandler.java:34)
at io.mangoo.routing.handlers.InboundCookiesHandler.nextHandler(InboundCookiesHandler.java:120)
at io.mangoo.routing.handlers.InboundCookiesHandler.handleRequest(InboundCookiesHandler.java:41)
at io.mangoo.routing.handlers.LocaleHandler.nextHandler(LocaleHandler.java:57)
at io.mangoo.routing.handlers.LocaleHandler.handleRequest(LocaleHandler.java:46)
at io.mangoo.routing.handlers.DispatcherHandler.nextHandler(DispatcherHandler.java:152)
at io.mangoo.routing.handlers.DispatcherHandler.handleRequest(DispatcherHandler.java:124)
at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:94)
at io.undertow.server.handlers.ExceptionHandler.handleRequest(ExceptionHandler.java:29)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:243)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:134)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:559)

Users with the same issue

1430 times, 11 hours ago
51 times, 12 hours ago
Once, 1 day ago
3 times, 1 day ago
Once, 2 days ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.