Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
weblogic上的spring boot rest应用程序_Spring_Rest_Spring Boot_Weblogic12c - Fatal编程技术网

weblogic上的spring boot rest应用程序

weblogic上的spring boot rest应用程序,spring,rest,spring-boot,weblogic12c,Spring,Rest,Spring Boot,Weblogic12c,我有一个spring boot rest应用程序在Tomcat上运行良好。 我的目标是在weblogic上部署相同的功能。我遵循了spring站点上提到的步骤 我在项目中没有web.xml文件。 部署之后,我遇到了这个错误 java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request,

我有一个spring boot rest应用程序在Tomcat上运行良好。 我的目标是在weblogic上部署相同的功能。我遵循了spring站点上提到的步骤

我在项目中没有web.xml文件。 部署之后,我遇到了这个错误

java.lang.IllegalStateException: No thread-bound request found: 
Are you referring to request attributes outside of an actual web request, 
or processing a request outside of the originally receiving thread? If you are actually operating with
in a web request and still receive this message, your code is probably running outside 
of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener 
or RequestContextFilter to expose the current request.
        at org.springframework.web.context.request.RequestContextHolder.currentR
equestAttributes(RequestContextHolder.java:131) ~[spring-web-4.3.13.RELEASE.jar:
4.3.13.RELEASE]

同样的请求在tomcat中也可以正常工作。我不确定是否需要包含带有ContextLoaderListener的web.xml文件。但是我想知道在tomcat容器中这怎么不是问题。

在tomcat和Weblogic中使用相同的代码可能不起作用,因为每种代码都有其特殊性。Spring Boot和Weblogic:不太可能的结合……bean中的@autowired HttpServletRequest和HttpServletResponse出现了问题。在Weblogic上访问请求或响应对象时引发此错误。Imho您不应该自动连接请求和响应,而应该将它们作为方法参数传递。也就是说,WebLogic附带了它自己的Spring版本,您需要包含一个WebLogic特定的部署描述符,以使应用程序中的类比服务器中的类更受欢迎。最后,它在WebSecurityConfig类上使用addBefore添加RequestContextFilter。仍然不确定tomcat做了什么不同,它是不需要的