当前位置:网站首页>NoClassDefFoundError and classnotfoundexception exceptions
NoClassDefFoundError and classnotfoundexception exceptions
2022-06-24 05:45:00 【FHAdmin】
1. brief introduction ClassNotFoundException and NoClassDefFoundError When JVM Unable to find classpath The requested class occurred .
2.ClassNotFoundException ClassNotFoundException It's a checked exception , An exception that occurs when an application attempts to load a class with its fully qualified name and cannot find it on the classpath . Mainly occurs when trying to use Class.forName()、ClassLoader.loadClass()、ClassLoader.findSystemClass() When loading a class . for example : Load a class that doesn't exist
Class.forName("acb.s.sad")3.NoClassDefFoundError Happen when NoClassDefFoundError ( java fhadmin.cn), The system does not work properly , And it can't be recovered . When JVM Try the following :
Use new Instantiate a class Use method calls to load classes When the compiler can successfully compile classes , but java The runtime cannot find the class file , Errors will occur . It usually occurs when an exception occurs when executing a static block or initializing a static field of a class , So class initialization failed 4. Solution The main reason is that the runtime class file ( Class path ) Unavailable . resolvent :
Ensure that the class containing the class or... Can be used in the classpath jar. without , You need to add it manually . If available on the classpath , Then it is possible that the path is covered . At this time, you need to find the exact path of the class . 5. summary ClassNotFoundException and NoClassDefFoundError It's all because of java The runtime could not find the class related . ClassNotFoundException yes java Exception thrown when loading class at runtime (Exception), And the name is provided at run time . NoClassDefFoundError Is that this class exists at compile time , but java The runtime cannot find... On the path .
边栏推荐
- Interpretation of PNG files (1): past and present lives of png/apng format
- [JS reverse hundred examples] Dangle login interface parameters reverse
- PV and PVC analysis and use in kubernetes
- How to apply for a company domain name? What are the requirements for the applicant company?
- Go's package management learning notes
- What is domain name resolution? How much does domain name registration cost
- Experience sharing on unified management and construction of virtual machine
- How to make a secondary domain name? What is the purpose of a secondary domain name?
- Oceanus practice consumption CMQ subject model data source
- What is domain name registration? Do you still need to purchase ECS after domain name registration?
猜你喜欢
Learning routes and materials for cloud native O & M engineers
Easy to understand JDBC tutorial - absolutely suitable for zero Foundation
What cloud native knowledge should programmers master?

Answer questions! This article explains the automated testing framework in software testing from beginning to end

How should we learn cloud native in 2022?
随机推荐
How about the VIP domain name? Does the VIP domain name need to be filed after registration?
What if the domain name is blocked? What can I do to quickly unseal?
How to build a website after registering a domain name? Do you need maintenance later?
How to apply for a company domain name? Does it cost money to apply for a company domain name?
Easy to understand JDBC tutorial - absolutely suitable for zero Foundation
How to renew the domain name when it expires
How to resolve Chinese domain names? What is domain name resolution?
What domain name is XYZ? How to register a domain name
Tomorrow, we will help farmers make their debut together!
To create a high-quality geek for human beings, cloud + community starts the competition "discovery plan"
How enterprises overcome the data security barrier with the imminent implementation of the new law | interview with think tank on industrial security concept
What domain name is better? What should I pay attention to when buying a domain name
Creating a database using mysqladmin
How to register a Chinese domain name? Is it necessary to register a Chinese domain name?
Disaster recovery series (III) -- cloud network disaster recovery construction
How to resolve computer domain name resolution errors how to select a good domain name
PV and PVC analysis and use in kubernetes
Inferior administrator and black heart Haikang
Will cloud server hosting become the mainstream?
What does it mean that the domain name is being walled? How to solve the problem of domain name by wall?