繁体   English   中英

如何修复错误加载项目:无法在 Intellij IDEA 中加载 facet Spring?

[英]How can I fix Error Loading Project: Cannot load facet Spring in Intellij IDEA?

我正在尝试通过从 gitlab 下载源代码在 Intellij IDEA 中运行 Spring Boot 项目。 但该项目没有运行并显示以下错误: 1. 加载项目时出错:无法加载 facet Spring 2. 加载项目时出错:无法加载 facet JPA 3. 加载项目时出错:无法加载 facet Web

这是错误的屏幕截图:

项目导入时的错误消息

我的主要 spring 启动文件的代码是:

package com.trucklagbe.tech.payment.nagad;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;


import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector;
import org.apache.tomcat.util.descriptor.web.SecurityCollection;
import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;



@SpringBootApplication
public class StarterApplication extends SpringBootServletInitializer {

/**
 * @param args
 */

private static final Logger LOGGER = LoggerFactory.getLogger(StarterApplication.class); 


private static Class<StarterApplication> application = StarterApplication.class;

public static void main(String[] args) {
    // TODO Auto-generated method stub
    LOGGER.info("payment-module-nagad started!");
    
    SpringApplication.run(StarterApplication.class, args);

}

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
    LOGGER.info("payment-module-nagad production deployment initiated!");
    
    return builder.sources(application);
}

在此处输入图片说明

正如错误正上方的信息消息中所述,Spring 仅支持IntelliJ IDEA Ultimate

您需要安装Ultimate版,以便诸如可配置的专用方面和向导之类的东西可用于 Spring、JPA 等框架(参见与社区版的比较)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM