当前位置:网站首页>Anomalies seen during the interview
Anomalies seen during the interview
2022-07-04 00:19:00 【Hello】
executive summary :checked/unchecked What's the difference between exceptions ?
1️⃣checked: Generally, it refers to the external conditions that cannot be directly controlled by the program , It refers to a class that needs to be checked when compiling exception, Must be used in the user program try catch Mechanism processing or through throws Leave it to the caller . This kind of anomaly , Mainly refers to except Error as well as RuntimeException And its subclasses .
2️⃣unchecked: It refers to those exceptions that do not need to be handled at compile time . stay java In the system , be-all Error as well as RuntimeException And its subclasses are unchecked abnormal . Again, it is understood visually and frankly that there is no need try catch And other mechanisms , Think of it as unchecked It's abnormal .
One 、java.lang.IllegalArgumentException: Path cannot be null
2019-06-20 09:49:11,120 [main-EventThread] ERROR [org.apache.curator.framework.imps.CuratorFrameworkImpl:566] - Watcher exception
java.lang.IllegalArgumentException: Path cannot be null
at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:48)
at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:37)
at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:105)
at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:104)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:594)
at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:198)
at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:40)
at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient$CuratorWatcherImpl.process(CuratorZookeeperClient.java:131)
at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:68)
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:530)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:505)
Two 、Exception in thread “main” com.aliyuncs.exceptions.ClientException:
"C:\Program Files\Java\jdk1.8.0_161\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2018.3.5\lib\idea_rt.jar=58742:D:\Program Files\JetBrains\IntelliJ IDEA 2018.3.5\bin" -Dfile.encoding=GBK -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;E:\workspace\mchopin\target\classes;D:\repository\org\springframework\boot\spring-boot-starter-web\2.1.5.RELEASE\spring-boot-starter-web-2.1.5.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter\2.1.5.RELEASE\spring-boot-starter-2.1.5.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-logging\2.1.5.RELEASE\spring-boot-starter-logging-2.1.5.RELEASE.jar;D:\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\repository\org\springframework\boot\spring-boot-starter-json\2.1.5.RELEASE\spring-boot-starter-json-2.1.5.RELEASE.jar;D:\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;D:\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.8\jackson-datatype-jdk8-2.9.8.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.8\jackson-datatype-jsr310-2.9.8.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.8\jackson-module-parameter-names-2.9.8.jar;D:\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.5.RELEASE\spring-boot-starter-tomcat-2.1.5.RELEASE.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.19\tomcat-embed-core-9.0.19.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.19\tomcat-embed-el-9.0.19.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.19\tomcat-embed-websocket-9.0.19.jar;D:\repository\org\hibernate\validator\hibernate-validator\6.0.16.Final\hibernate-validator-6.0.16.Final.jar;D:\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\repository\org\springframework\spring-core\5.1.7.RELEASE\spring-core-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-jcl\5.1.7.RELEASE\spring-jcl-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-web\5.1.7.RELEASE\spring-web-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-beans\5.1.7.RELEASE\spring-beans-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-webmvc\5.1.7.RELEASE\spring-webmvc-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-aop\5.1.7.RELEASE\spring-aop-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-context\5.1.7.RELEASE\spring-context-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-expression\5.1.7.RELEASE\spring-expression-5.1.7.RELEASE.jar;D:\repository\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;D:\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.5.RELEASE\spring-boot-starter-jdbc-2.1.5.RELEASE.jar;D:\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\repository\org\springframework\spring-jdbc\5.1.7.RELEASE\spring-jdbc-5.1.7.RELEASE.jar;D:\repository\org\springframework\spring-tx\5.1.7.RELEASE\spring-tx-5.1.7.RELEASE.jar;D:\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.0.1\mybatis-spring-boot-starter-2.0.1.jar;D:\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.0.1\mybatis-spring-boot-autoconfigure-2.0.1.jar;D:\repository\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;D:\repository\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar;D:\repository\org\springframework\boot\spring-boot-devtools\2.1.5.RELEASE\spring-boot-devtools-2.1.5.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot\2.1.5.RELEASE\spring-boot-2.1.5.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.5.RELEASE\spring-boot-autoconfigure-2.1.5.RELEASE.jar;D:\repository\com\aliyun\aliyun-java-sdk-core\4.0.6\aliyun-java-sdk-core-4.0.6.jar;D:\repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;D:\repository\org\apache\httpcomponents\httpclient\4.5.8\httpclient-4.5.8.jar;D:\repository\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;D:\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\repository\com\sun\xml\bind\jaxb-core\2.1.14\jaxb-core-2.1.14.jar;D:\repository\com\sun\xml\bind\jaxb-impl\2.1\jaxb-impl-2.1.jar;D:\repository\javax\activation\activation\1.1.1\activation-1.1.1.jar;D:\repository\com\aliyun\aliyun-java-sdk-dysmsapi\1.1.0\aliyun-java-sdk-dysmsapi-1.1.0.jar;D:\repository\com\alibaba\fastjson\1.2.47\fastjson-1.2.47.jar" com.xxp.mchopin.util.SmsDemo
Exception in thread "main" com.aliyuncs.exceptions.ClientException: MissingAccessKeyId : AccessKeyId is mandatory for this action. RequestId : F58F1F9E-8D3F-44A3-A64E-E6B4BCB51BA1
at com.aliyuncs.DefaultAcsClient.parseAcsResponse(DefaultAcsClient.java:230)
at com.aliyuncs.DefaultAcsClient.getAcsResponse(DefaultAcsClient.java:134)
at com.xxp.mchopin.util.SmsDemo.sendSms(SmsDemo.java:47)
at com.xxp.mchopin.util.SmsDemo.main(SmsDemo.java:70)
Process finished with exit code 1
3、 ... and 、java.io.IOException: Broken pipe
know broken pipe
pipe It means pipe , Inside the pipeline is the data flow , Usually data read from a file or network socket . When the pipe suddenly closes from the other end , Sudden interruption of data will occur , That is broken. For the file File Come on , This may be because the file is installed on a disconnected CD or on a remote network . about socket Come on , It may be that the network is unplugged or the process at the other end crashes . stay Java in , There is no specific BrokenPipeException. Include such errors in another exception , for example java.io.IOException:Broken pipe
solve the problem
In fact, when the exception occurs , For the server , Not much impact . This error may be caused by the sudden termination of the process by a client . But in order to make the program beautiful 、 grace , Or catch the exception in the right place , And deal with it . Another possibility is that the code in the program takes too long to execute , The user waited too long , Will forcibly stop the process . In this case, we need to analyze log What is unusual in the interim report is where it often happens , Optimize the code reasonably , Improve the running speed of code , In order to fundamentally avoid the recurrence of such problems .
Four 、java.net.MalformedURLException
URL url = new URL(param);
When building objects , Participation is null, Lead to URL switch views . Before entering the parameter , Carry out non null Judge , This exception can be avoided .
5、 ... and 、org.springframework.web.HttpMediaTypeNotSupportedException
6、 ... and 、java.lang.Exception: Test class should have exactly one public zero-argument constructor
7、 ... and 、java.time.format.DateTimeParseException
Exception in thread "main" java.time.format.DateTimeParseException: Text '2008-8-08 00:00:00' could not be parsed at index 5
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
at java.time.LocalDateTime.parse(LocalDateTime.java:492)
at com.yikesong.core.domain.money.model.finance.FinanceService.getInstants(FinanceService.java:179)
at com.yikesong.core.domain.money.model.finance.FinanceService.main(FinanceService.java:167)
8、 ... and 、ResourceNotFoundException
边栏推荐
- P1656 bombing Railway
- NLP pre training technology development
- Shell script three swordsman sed
- China standard gas market prospect investment and development feasibility study report 2022-2028
- How to write a good title of 10w+?
- Qtcharts notes (V) scatter diagram qscatterseries
- D24:divisor and multiple (divisor and multiple, translation + solution)
- A method to solve Bert long text matching
- Powerful blog summary
- Gossip about redis source code 82
猜你喜欢

Alibaba cloud container service differentiation SLO hybrid technology practice
![[PHP basics] cookie basics, application case code and attack and defense](/img/7c/551b79fd5dd8a411de85c800c3a034.jpg)
[PHP basics] cookie basics, application case code and attack and defense

Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
![[Mongodb] 2. Use mongodb --------- use compass](/img/d5/0eb7dd4c407fbf2e9ba1b175f5424d.jpg)
[Mongodb] 2. Use mongodb --------- use compass

STM32 GPIO CSDN creative punch in

Idea set class header comments
![[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections](/img/c6/3dc7d01600f6713afdbb4cf3df5238.jpg)
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
![[CSDN Q & A] experience and suggestions](/img/db/dff3173dda24ca5740729b54a81153.jpg)
[CSDN Q & A] experience and suggestions

Tencent interview: can you find the number of 1 in binary?

What is the Valentine's Day gift given by the operator to the product?
随机推荐
Docking Alipay process [pay in person, QR code Payment]
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) simulated examination and Guangdong Provincial Safety Officer a certificate third batch (main person in charg
Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028
Advanced C language - pointer 2 - knowledge points sorting
How to make recv have a little temper?
【leetcode】374. Guess the size of the number
What are the application fields of digital twins in industry?
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
Powerful blog summary
Generic tips
[about text classification trick] things you don't know
Analysis on the scale of China's smart health industry and prediction report on the investment trend of the 14th five year plan 2022-2028 Edition
I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises
[PHP basics] cookie basics, application case code and attack and defense
Gossip about redis source code 78
Is the low commission link on the internet safe? How to open an account for China Merchants Securities?
[GNN] hard core! This paper combs the classical graph network model
SQL data update