Java error resolution record (pit record)

Time:2021-8-9
  • You aren‘t using a compiler supported by lombok, so lombok will not work and has been disabled.
    Preferences | Build, Execution, Deployment | Compiler
    stayUser-local build process VM options (overrides Shared options):Add later-Djps.track.ap.dependencies=false

  • @Slf4j cannot find log
    Preferences | Build, Execution, Deployment | Compiler | Annotation Processors
    TickEnable annotation processing
    Restart idea

  • Pom.xml is not available
    Preferences | Build, Execution, Deployment | Build Tools | Maven | Ignored Files
    Uncheck the pom.xml of the corresponding project

  • JDK isn't specified for module '***'
    delete.ideaThen refresh it

  • Error:(28, 5) java: No property named "**" exists in source parameter(s). Did you mean "null"?
  • mapstructAll properties are ignored and an empty object is returned
    Error explanation: this error is caused by usingmapstructandlombokErrors in combination,mapstructThe property was not found when generating the transformation code
    Error analysis: the reason is that when generating conversion codelombokNot yet generatedsetter、getterThe corresponding method, so the property cannot be found
    Solution: inpom.xmlAdjustment orderlombokPut onmapstructPrevious compilation

  • Web server failed to start. Port 8080 was already in use.
    Stop other ports that occupy the portWeb server, you can also use the following method
    MAC system terminal execution

    #Find the PID occupied by port 8080
    lsof -i tcp:8080
    #'kill'
    kill 6095

  • MavenCreatedModuleDependent libraries cannot be used
    Idea - > preferences... - > build,... - > Maven - > ignored files - > check... / pom.xml


  • main/javaFile cannot create a java file
    Right clickjava -> Mark Directory as -> Sources Root
    Process terminated
    Click the item name in the left column of the error report to view the cause of the error and solve it
    Solution: caused by Chinese path


  • Error: (28,57) the diamond operator is not supported in Java: - source 1.5
    pom.xmlSpecifies the currently usedjdkedition

    <properties>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target> 
      <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    </properties>

  • MAC system idea integration Tomcat error
    Error running 'Tomcat 9.0.34':Unable to open debugger port (127.0.0.1:xxxxx):java.net.SocketException "Socket closed"
    Port number occupied: adjust the port numberStartup/Connection -> Debug -> Port
    Other reasons: the Tomcat installation path is incorrect
    To install Tomcat:https://www.jianshu.com/p/672…

  • Caused by: org.apache.ibatis.type.TypeException: The alias '*' is already mapped to the value '*.*.*'

    Error details:
    Caused by: org.apache.ibatis.type.TypeException:
    The alias ‘SiteVo’ is already mapped to the value ‘com.test.base.vo.manager.SiteVo’

Error reason:
The key is that the alias range specified in the configuration file is too wide, resulting in the same class under different packages, resulting in conflict. The above is displayed

Error message.
Profile content:

mybatis:
#Search for the specified package alias
typeAliasesPackage: com.test.**.entiy

  • Solution 1:
    Generally, it is recommended not to name the same.
    Just change the name of the same class.
  • Solution 2:
    When searching for the specified package alias (the above configuration file), it is best to specify the determined range, such as com.test.blog.entity, so that the above error will not occur.