java - 如何在weblogic上部署spring boot应用程序?

标签 java spring spring-boot oracle12c

我想在weblogic上部署一个spring boot应用程序。我有这个错误:

错误 javax.servlet.ServletException:未在 Jetty 上运行,JSR-356 支持不可用 Erreur 未在 Jetty 上运行,JSR-356 支持不可用

Spring boot 版本 1.5.20/weblogic 版本 12c

你能帮我吗???

主要代码

@SpringBootApplication
public class BlsApplication extends SpringBootServletInitializer implements WebApplicationInitializer {

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

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(BlsApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(BlsApplication.class, args);
        LOGGER.info("BLS Application has been launched");
    }

}

pom.xml文件的代码

<dependencies>
  <dependency>
    <groupId>com.bct.bls</groupId>
    <artifactId>bls-service</artifactId>
    <version>1.1.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
      <exclusion>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
  </dependency>
  <dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
  </dependency>
  <dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-impl</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
  </dependency>
  <dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc7</artifactId>
  </dependency>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jsp-api</artifactId>
  </dependency>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
  </dependency>
  <dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>el-impl</artifactId>
  </dependency>
  <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-email</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
  </dependency>
  <dependency>
    <groupId>org.primefaces.extensions</groupId>
    <artifactId>all-themes</artifactId>
  </dependency>
  <dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-taglibs</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.webflow</groupId>
    <artifactId>spring-faces</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    <scope>provided</scope>
  </dependency>
</dependencies>

最佳答案

您需要从 pom.xml 中排除以下包

 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
  </dependency>

或将范围设置为“已提供”。

关于java - 如何在weblogic上部署spring boot应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57376785/

相关文章:

spring-boot - 如何将多个 war 文件重新部署到单个 Spring Boot 可部署 jar 中?

c# - 在同一台机器上开发 Java、C# 和 .NET

java - 在 Java 中枚举正则表达式的可能匹配项

java - 安排 Spring 缓存驱逐?

java - 如何从响应实体获取正文

java - 将 SecurityContextHolder.setContext(...) 设置为模拟,即使使用 @DirtiesContext 也会传递到不同的测试类

java - 从 int 数组创建 BigInteger 数组

java - 可靠/支持良好的库作为 GPS 单元的接口(interface)?

spring - 允许在 Rest 端点 Spring Boot 上发布

java - Spring Security的ACL配置问题