我在Spring Boot中有一个Web应用程序,可以在本地tomcat中正常运行。但是,我们的生产服务器位于Weblogic中,并且应用程序启动时失败,并显示以下错误:
""2018-12-20 08:28:14 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR org.glassfish.jersey.internal.Errors - Following issues have been detected:
WARNING: No injection source found for a parameter of type public javax.ws.rs.core.Response com.blah.rest.UploadCSVResource.uploadFile(java.io.InputStream,java.lang.String,java.lang.String) throws java.io.IOException at index 0.
WARNING: A HTTP GET method, public com.blah.entity.Status com.blah.rest.StatusResource.fetchLatestRecordByDate(int), should not consume any entity.
HINT: A HTTP GET method, public void com.blah.rest.BlahResource.load(java.lang.Integer,javax.servlet.http.HttpServletRequest), returns a void type. It can be intentional and perfectly fine, but it is a little uncommon that GET method returns always "204 No Content".
""2018-12-20 08:28:14 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@ac3fd42: startup date [Thu Dec 20 08:27:54 EST 2018]; root of context hierarchy
当我取出jersey-media-multipart时,该应用程序运行正常。这是我的gradle文件的相关部分:
compile ("javax:javaee-api:7.0")
compile ("javax.xml.bind:jaxb-api:2.3.0")
compile ("com.jcraft:jsch:0.1.54")
compile ("org.jasypt:jasypt:1.9.2")
compile ("javax.el:javax.el-api:3.0.0")
compile ("org.projectlombok:lombok:1.16.14")
compile ("org.glassfish.web:javax.el:2.2.6")
compile ('org.javassist:javassist:3.20.0-GA')
compile ('org.glassfish.jersey.core:jersey-server:2.24.1')
compile ('org.glassfish.jersey.containers:jersey-container-servlet-core:2.23.2')
compile ('org.glassfish.jersey.media:jersey-media-multipart:2.23.2')
compile ("org.apache.commons:commons-lang3:3.6")
compile ("org.apache.commons:commons-math3:3.6.1")
compile ("org.apache.commons:commons-collections4:4.1")
compile ("org.apache.commons:commons-io:1.3.2")
compile ("org.apache.commons:commons-csv:1.5")
compile ("org.springframework.boot:spring-boot:${springBootVersion}")
compile ("org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}")
compile ("org.springframework.boot:spring-boot-starter:${springBootVersion}")
compile ("org.springframework.boot:spring-boot-starter-logging:${springBootVersion}")
compile ("org.springframework.boot:spring-boot-starter-parent:${springBootVersion}")
compile ("org.springframework.boot:spring-boot-starter-web:${springBootStarterVersion}")
compile ("org.springframework.boot:spring-boot-starter-data-jpa:${springBootStarterVersion}")
compile ("org.springframework.boot:spring-boot-starter-jersey:${springBootStarterVersion}")
compile ("org.springframework.boot:spring-boot-starter-cache:${springBootStarterVersion}")
compile ("org.springframework.boot:spring-boot-starter-security:${springBootStarterVersion}")
compile ("org.springframework.boot:spring-boot-starter-thymeleaf:${springBootStarterVersion}")
并且我已经确保在球衣配置中注册了多部分功能
package com.blah.config;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.RequestContextFilter;
@Configuration
public class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
register(RequestContextFilter.class);
register(MultiPartFeature.class);
// Resources
packages("com.blah.rest");
// Exception Handlers
packages("com.blah.exception");
// Interceptor for Compression
packages("com.blah.interceptor");
}
}
有人知道如何在weblogic中解决此问题吗?我已经尽力想了一切。