How to deploy a Spring Boot application on Weblogic 12c (12.1.3)?

青春壹個敷衍的年華 提交于 2021-02-04 19:48:09

问题


I'm trying to deploy a simple Spring Boot application on Weblogic 12c (12.1.3), in a developer environment it does work perfectly. However when need to repackage it in a war and to attach it to an earand this does not seem to deploy correctly.

This is the stacktrace:

<Nov 23, 2016 6:15:13 PM CET> <Error> <Munger> <BEA-2156200> <Unable to load descriptor weblogic.utils.classloaders.GenericClassLoader@6964c078 finder: weblogic.utils.classloaders.CodeGenClassFinder@5715556 annotation: my-app-ear@/WEB-INF/lib/tomcat-embed-websocket-8.5.6.jar!/META-INF/web-fragment.xml of module /my-app. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed

Any input will be very welcome. Thanks in advance.


回答1:


From Spring Boot docs,

To deploy a Spring Boot application to WebLogic you must ensure that your servlet initializer directly implements WebApplicationInitializer (even if you extend from a base class that already implements it).

For Example,

Change this,

public class Application extends SpringBootServletInitializer {  

to

public class Application extends SpringBootServletInitializer implements WebApplicationInitializer {

NOTE: SpringBootServletInitializer already implements WebApplicationInitializer, but you need to do it again.

As of now,I don't know Why.

public abstract class SpringBootServletInitializer implements WebApplicationInitializer {

From Spring source code,




回答2:


You need to do 2 things:

  1. On your weblogic 12.1.3 instance, upgrade your JPA api and add the hibernate 5 implementation

  2. In you web app, make sure what dependencies you have and that they do not overlap with the ones already provisioned under Weblogic classloader.

I have details the steps here:

http://javagoogleappspot.blogspot.be/2018/05/make-your-spring-boot-20-compatible.html



来源:https://stackoverflow.com/questions/40770784/how-to-deploy-a-spring-boot-application-on-weblogic-12c-12-1-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!