常见问题

创建日期:2024-06-21
更新日期:2024-12-10

1、不显示服务面板。

解决方法1:点击视图菜单,然后点击 工具窗口、服务 即可。如果服务中不显示微服务,是由于项目无法正常编译导致的。正常编译后,重新加载项目,IDEA会提示是否使用服务面板。选择使用,服务面板中会显示所有微服务。

解决方法2:文件、设置、插件,启用Spring和Spring Boot。编辑.idea/workspace.xml,查找,如果找不到,自己添加上,然后重启idea。

  <component name="RunDashboard">

    <option name="configurationTypes">

      <set>

        <option value="SpringBootApplicationConfigurationType" ></option>

      </set>

    </option>

  </component>

2、运行微服务报错:Command line is too long. Shorten command line for XXXApplication or also for Spring Boot default configuration.。

点击XXXApplication超链接,在打开的编辑配置窗口里,展开Environment,缩短命令行选择JAR manifest或classpath file。

3、Maven面板双击clean报错:Process Terminated。

将maven的bin目录添加到Path变量中,在PowerShell中打开项目文件夹,执行 mvn clean,看看是否报错。

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Failure to find org.springblade.platform:blade-bom:pom:2.9.0.RELEASE in https://maven.aliyun.com/repository/public/ was cached in the local repository, resolution will not be reattempted until the update interval of aliyun-repos has elapsed or updates are forced @ line 51, column 25
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.springblade:BladeX:2.9.0.RELEASE (E:\Project\积成燃气检测预警平台\hylab-bladex\bladex\pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: Failure to find org.springblade.platform:blade-bom:pom:2.9.0.RELEASE in https://maven.aliyun.com/repository/public/ was cached in the local repository, resolution will not be reattempted until the update interval of aliyun-repos has elapsed or updates are forced @ line 51, column 25 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

由错误可知,是找不到 org.springblade.platform:blade-bom:pom:2.9.0.RELEASE 导致的。

在项目根目录的 pom.xml 文件夹,添加 maven私有仓库。在pom.xml上右键,重新加载项目。问题解决。

    <repositories>
        <repository>
            <id>hylab-business-release</id>
            <name>Release Repository</name>
            <url>http://192.168.23.106:8081/repository/maven-releases/</url>
        </repository>
    </repositories>

4、错误: 找不到或无法加载主类 @C:\Users\liteng\AppData\Local\Temp\idea_arg_file1940588895。

"C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\lib\idea_rt.jar=54505:C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 @C:\Users\liteng\AppData\Local\Temp\idea_arg_file1782253795 com.hylab.dap.CompanyApplication
错误: 找不到或无法加载主类 @C:\Users\liteng\AppData\Local\Temp\idea_arg_file1782253795

解决方法:在包含main方法的类CompanyApplication上右键,然后运行,会提示命令行超长。编辑配置,在环境中选择缩短命令行后,成功运行。

5、IDEA社区版服务窗口只能显示5个服务。

在选择项目窗口,点击自定义、所有设置。在弹出的设置窗口中,点击左侧高级设置,在右边找到运行/调试,把 临时配置限制 由5改成100即可。

6、IDEA社区版服务窗口添加服务,缺少类型。

在菜单 Run / Edit Configurations... 中修改,拖动还可以改变服务的顺序。