Java – deploying spring boot applications in Weblogic

I deployed a spring boot application in Weblogic 12C

10.4. 4 403 prohibit the server from understanding the request, but refuse to fulfill the request Authorization will not help. Requests cannot be repeated If the request method is not head and the server wants to disclose why the request has not been implemented, the reason for rejecting the entity should be described This status code is usually used when the server does not want to explicitly show the reason why the request was rejected, or when no other response is applicable

I wonder if anyone can help

Solution

I reviewed your code and saw a problem in such code:

You are doing the right thing (as defined in the springboot documentation), but it seems to have a weblogic12c error (or perhaps an interpretation of the standard) It seems that weblogic12c searches for classes that implement webapplicationinitializer directly Notice how your code extends springbootservlet initializer (which implements webapplicationinitializer) Weblogic 12C doesn't seem to like it Therefore, the easiest way is to make your application class implement webapplicationinitializer So change this line:

public class Application extends SpringBootServletInitializer {

To this:

public class Application extends SpringBootServletInitializer implements WebApplicationInitializer {

Note: once the above content is fixed, you will encounter another weblogic12c deployment problem: "java.lang.illegalargumentexception: loggerfactory is not logback loggercontext, but logback is on the classpath" To fix other problems, create a new file Src / main / webapp / WEB-INF / Weblogic XML and put the contents in it:

<?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
        <wls:weblogic-version>12.1.1</wls:weblogic-version>
        <wls:context-root>helloApp</wls:context-root>
        <wls:container-descriptor>
            <wls:prefer-application-packages>
                <wls:package-name>org.slf4j.*</wls:package-name>
            </wls:prefer-application-packages>
        </wls:container-descriptor>
    </wls:weblogic-web-app>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>