I get a class not found exception when i rename the package from "default package" in java. When i run the code within the default package, the code works fine but when i paste the code into a new java project in eclipse and into a new package, there is a classnotfound exception thrown even when the class referred to above is clearly present in the new package. What is wrong? please help me :(
I get a class not found exception when i rename the package from "default package"
1.8k Views Asked by DEKE At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in PACKAGE
- How to install libfuse2 on Ubuntu 22.04
- chatbot respond to onequery type
- How to get argument from Command line for my python package
- How can I record the entire screen outside of my Flutter app or control a specific area for recording, including sound?
- hashcat : Depends: libminizip1t64 but it is not installable E: Unable to correct problems, you have held broken packages
- OS: Parrot OS (hashcat : Depends: libminizip1t64 but it is not installable)
- Flutter: when I try to hot reload to run the app I get this error when using carousel slider "Error: Couldn't resolve the package 'carousel_slider "
- Could not create '.egg-info': The system cannot find the file specified
- How to implement facebook pixel in flutter in 2024 any example?
- Flutter error on using local_auth package and conflicts with other packages
- Eclipse: "package...does not exist" when building a Maven package that references a class in another project
- Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1Error:
- Export and create package of c++20 modules
- Enforce schema on schemaless DynamoDB database
- Problem with the packages file in my flutterflow project on Visual Code Studio
Related Questions in CLASSNOTFOUNDEXCEPTION
- java.lang.NoClassDefFoundError: io/micrometer/observation/transport/RequestReplyReceiverContext
- Maven java.lang.ClassNotFoundException: Could not find or load main class
- TWA app crash because of java.lang.ClassNotFoundException: Didn't find class "androidx.browser.trusted.LauncherActivity"
- springboot, spring boot jpa,class not found exception, Endpointer
- How to resolve class Not found exception in STS
- Java uncatchable ClassNotFoundException when using java.awt.Clipboard
- Caused by: java.lang.ClassNotFoundException and java.lang.NoClassDefFoundError
- Error inflating class androidx.appcompat.widget.SearchView in Dialog
- java.lang.RuntimeException: Unable to instantiate application class z
- Error: Could not find or load main class com.communication.App in IntelliJ IDE
- What causes a "java.lang.ClassNotFoundException: com.sun.jna.Callback" Error using maven javafx:jlink?
- Error: Could not find or load main class NewAssesment.Orenge Caused by: java.lang.ClassNotFoundException: NewAssesment.Orenge
- Newly created or modified java files not running in vscode
- Error: Could not find or load main class org.gradle.jvmargs Caused by: java.lang.ClassNotFoundException: org.gradle.jvmargs
- Exception in thread "main" java.lang.ClassNotFoundException while executing a jar file
Related Questions in DEFAULT-PACKAGE
- Default project missing
- How to access a Java class in the default package from jshell?
- About java default package(using Eclipse)
- How to add prefixes to jni dll function names
- How to run Dropwizard app in debug mode with Eclipse?
- How can I import classes that are located inside a referenced library?
- Changing lua default package
- loading config file from default package vs from classpath
- How can i call a JFrame from a class?
- Why use of default package is not recommended in JAVA?
- tomcat eclipse java ee default package
- Why shouldn't we use the (default)src package?
- I get a class not found exception when i rename the package from "default package"
- What is the default package in which my classes are put if I don't specify it?
- How to import a class from default package
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
My guess is that you're still trying to start the application with the existing application launcher, which is referring to the class in the "default" package.
Either create a new launcher, or edit the details of the existing one.
Of course, that's assuming you get the exception on launch. If that's not the case, you need to give us a lot more details.
EDIT: Okay, now you've posted the exception, it makes a lot more sense - you're trying to deserialize data which includes a reference to the class
FaceBundle. Renaming classes breaks serialized data - it's as simple as that.You can fiddle around with things in Java serialization, but I haven't done so myself. I suspect you'd want to create your own subclass of
ObjectInputStreamand overrideresolveClass.