简体   繁体   中英

Deploying Spring boot into WebLogic 10.3.6

I've developed a RESTful webservices using java 7 and spring boot 1.5.9. Have added weblogic.xml and dispatcherServlet.xml files in webcontent folder. I've generated a WAR and tried to deploy it into our weblogic server 10.3.6, while doing that i'm getting this error on weblogic console: 1. Unable to access the selected appliation 2. Exception in Appmerge flows' progression 3. Exception in Appmerge flows' progression 4. Unmarshaller failed

In logs "

My webLogic.xml

<?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://xmlns.oracle.com/weblogic/weblogic-web-app
        http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">

    <wls:context-root>/myweb</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.springframework.*</wls:package-name>
            <wls:package-name>org.springframework.util.MultiValueMap.*</wls:package-name>
            <wls:package-name>org.slf4j.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.databind.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.datatype.jsr310.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>

</wls:weblogic-web-app>

dispatcherServlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">     
</beans>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
  <display-name>SlotBookingAvailability</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

ServletInitializer.java

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

public class ServletInitializer extends SpringBootServletInitializer {

    protected SpringApplicationBuilder configure(
            SpringApplicationBuilder application) {
        return application.sources(new Class[]{SlotBookingAvailabilityApplication.class});
    }
}

Could anyone please tell me how to resolve this?

I think your weblogic.xml is not correct. Try this and this should fix your problem

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app 
                    http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM