org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener не удалось: java.lang.IllegalArgumentException: неверный источник - PullRequest
1 голос
/ 28 июня 2019

Я пытаюсь развернуть загрузочное веб-приложение Spring на сервере WebLogic. Код прекрасно работает в Tomcat при локальном запуске. Но когда я собираю jar и внедряю его в WebLogic, я получаю исключение.

<Jun 28, 2019 1:24:05 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener failed: java.lang.IllegalArgumentException: Invalid source 'com.example.MyApplication'.
java.lang.IllegalArgumentException: Invalid source 'com.example.MyApplication'
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:218)
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:144)
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
    at org.springframework.boot.SpringApplication.load(SpringApplication.java:703)
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:366)
    Truncated. see log file for complete stacktrace
> 

<Jun 28, 2019 1:24:05 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1561708384317' for task '5'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException: 
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: Invalid source 'com.xample.MyApplication'
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:218)
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:144)
    at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
    at org.springframework.boot.SpringApplication.load(SpringApplication.java:703)
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:366)
    Truncated. see log file for complete stacktrace
> 
<Jun 28, 2019 1:24:05 PM IST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'Application'.> 

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    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">

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>com.example.MyApplication</param-value>
    </context-param>    
    <listener>
        <listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextAttribute</param-name>
            <param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>

И просто прояснить несколько вещей,
- для сервера weblogic мне нужно иметь и web.xml, и weblogic.xml?
- почему фреймворк не определяет компоненты (фильтры, сервлеты и т. д.) из моих аннотаций

Любая помощь будет принята с благодарностью. Спасибо

...