Spring Boot + Eclipse + Weblogic 12.2.1

问题描述 投票:0回答:4

当我通过 Eclipse Neon 在 weblogic 12.2.1 中部署 Spring Boot 应用程序时遇到问题。这是组件

  • 具有 Web 依赖的简单 Spring Boot 应用程序。
  • 日食霓虹灯
  • Weblogic 12.2.1.1 嵌入 eclipse

错误是:

weblogic.management.DeploymentException: java.lang.ClassNotFoundException: org.springframework.security.oauth2.client.token.AccessTokenRequest
    at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:132)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:246)
    at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:66)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65)
    Truncated. see log file for complete stacktrace

但我没有在应用程序中使用安全性。如果我将其作为“Spring Boot App”运行,应用程序就会运行。

我猜是weblogic的问题,我该如何解决?

spring weblogic12c
4个回答
10
投票

对于遇到此问题的其他人来说,这似乎是 Spring Boot (spring-boot-autoconfigure) 中的一个错误,该错误是由 Oracle WebLogic 团队对 EE 规范的令人讨厌的遵守引起的。请参阅此处了解更多信息:https://github.com/spring-projects/spring-boot/issues/9441

Spring Boot 1.5.5.RELEASE 版本已修复此问题。因此,如果您使用 gradle,按如下方式更改您的依赖项(以及您拥有的任何其他 Spring Boot 依赖项)应该可以修复它:

compile "org.springframework.boot:spring-boot-autoconfigure:1.5.5.RELEASE"

在遇到同样的问题后,我刚刚确认这对我有用。


2
投票

这里的另一个人被迫部署到 weblogic :\

这就是我为了解决 weblogic、eclipse 和 spring-boot 之间的集成问题所做的:

  1. 我已将 oauth 依赖项添加到我的 pom 中:

```

<dependency>
   <groupId>org.springframework.security.oauth</groupId>
   <artifactId>spring-security-oauth2</artifactId>
</dependency>
```

但之后,weblogic 询问我每个休息端点(不是执行器端点)的用户名和密码

那么,第二点来了:

  1. 从自动配置中排除安全性(或根据需要进行调整)

```

    @EnableAutoConfiguration(exclude = {      org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class 
})

``` 希望有帮助!


1
投票

对我来说,当使用 WebLogic 控制台部署 war 文件时,此异常消失了。似乎是 Eclipse-WebLogic 集成中的一个错误。


0
投票

2024年工作!在您的 pom.xml 中包含以下依赖项:

<dependency>
   <groupId>org.springframework.security.oauth</groupId>
   <artifactId>spring-security-oauth2</artifactId>
</dependency>

感谢@Bringer提供了正确的解决方案!

© www.soinside.com 2019 - 2024. All rights reserved.