当前位置:网站首页>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
边栏推荐
- 2020.2.14
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Alibaba cloud container service differentiation SLO hybrid technology practice
- Idea set class header comments
- EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
- Fudan 961 review
- STM32 GPIO CSDN creative punch in
- ISBN number
- Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
- Solution to the impact of Remote Code Execution Vulnerability of log4j2 component on December 9, 2021
猜你喜欢

A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders

URL (data:image/png; Base64, ivborw0k... Use case
![[GNN] hard core! This paper combs the classical graph network model](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[GNN] hard core! This paper combs the classical graph network model

Smart fan system based on stm32f407

Reading notes on how programs run

How to make icons easily

Idea integrates Microsoft TFs plug-in

I wrote a chat software with timeout connect function

Idea a method for starting multiple instances of a service

The first game of the new year, many bug awards submitted
随机推荐
Idea integrates Microsoft TFs plug-in
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
CSP window
Selenium library 4.5.0 keyword explanation (II)
2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
Selenium check box
What are the application fields of digital twins in industry?
Correlation analysis summary
Comment obtenir une commission préférentielle pour l'ouverture d'un compte en bourse? Est - ce que l'ouverture d'un compte en ligne est sécurisée?
2020.2.14
SQL data update
Several ways to set up a blog locally [attach relevant software download links]
D28:maximum sum (maximum sum, translation)
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
STM32 GPIO CSDN creative punch in
Global and Chinese market of melting furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
Bodong medical sprint Hong Kong stocks: a 9-month loss of 200million Hillhouse and Philips are shareholders
Open 2022 efficient office, starting from project management
[about text classification trick] things you don't know
Gossip about redis source code 75