Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot + Eclipse + Weblogic 12.2.1

I'm having an issue when I deploy a spring boot application in weblogic 12.2.1 through Eclipse Neon. This are the components

  • Simple spring boot application with web dependency.
  • Eclipse neon
  • Weblogic 12.2.1.1 embed in eclipse

The error is:

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

But I'm not using security in the application. If I run it as "Spring Boot App" the application runs.

I guess the problem is with weblogic, how can I solve it?

like image 608
Victor Cruz Avatar asked May 03 '17 18:05

Victor Cruz


3 Answers

For anybody else hitting this, it appears this is a bug in Spring Boot (spring-boot-autoconfigure) induced by the Oracle WebLogic team's pesky adherence to the EE spec. See here for more info: https://github.com/spring-projects/spring-boot/issues/9441

The 1.5.5.RELEASE version of Spring Boot has this fixed. So if you're using gradle for example, changing your dependency as follows (and any other Spring Boot dependencies you have) should fix it:

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

I've just confirmed this works for me after getting the same problem.

like image 52
Chris Avatar answered Jan 08 '23 04:01

Chris


Another guy here forced to deploy to weblogic :\

This is what I've done in order to fix the integration issue beetween weblogic, eclipse and spring-boot:

  1. I've added oauth dependency to my pom:

```

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

But after that, weblogic asked my user and password for every rest endpoint (not actuator ones)

So, here comes the second point:

  1. Exclude security from autoconfiguration (or adjust it as you wish)

```

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

``` Hope it helps!

like image 23
Bringer Avatar answered Jan 08 '23 04:01

Bringer


For me this exception disappeared when deployed the war file using the WebLogic console. Seems to be a bug in Eclipse-WebLogic integration.

like image 36
Jozsef Frigo Avatar answered Jan 08 '23 05:01

Jozsef Frigo