Weblogic配置错误 - 未找到Java类的消息正文编写器,Java类类和MIME媒体类型application / json

时间:2014-10-31 20:51:24

标签: java json configuration jersey weblogic

我遇到了在Weblogic服务器上运行的应用程序的问题。奇怪的是,应用程序在其他3个JVM(6个托管服务器)上运行良好。有一个带有2个托管服务器的JVM都会出现此错误:

####<Oct 31, 2014 3:58:43 PM EDT> <Notice> <StdErr> <physaddress> <managedServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1414
785523072> <BEA-000000> <Oct 31, 2014 3:58:43 PM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: The registered message body writers compatible with the MIME media type are:
*/* ->
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
  com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General>
####<Oct 31, 2014 3:58:43 PM EDT> <Notice> <StdErr> <physaddress> <managedServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1414785523072> <BEA-000000> <Oct 31, 2014 3:58:43 PM com.sun.jersey.spi.container.ContainerResponse logException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class xVO, and Java type class xVO, and MIME media type application/json was not found
        at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3741)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3705)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2282)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2181)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1491)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class xVO, and Java type class xVO, and MIME media type application/json was not found
        ... 21 more>

我不确定其他信息可能对您有所帮助。服务器工作正常。我们的想法是,有一些配置变化可以解决问题,但我不确定它是什么。同样,应用程序在其他3个weblogic实例上运行良好。这个特殊的例子不起作用,我们不确定原因。

任何帮助将不胜感激。 我很乐意根据要求提供更多信息。 谢谢!

1 个答案:

答案 0 :(得分:1)

极少数情况下的Weblogic会在暂存目录中保留旧的已部署文件(当然,这也取决于文件的部署方式)。通常,如果存在与一个weblogic服务器而不是另一个weblogic服务器相关的问题,则停止托管服务器,删除tmp,阶段或仅将其移动到新目录并重新启动受管服务器使受管服务器拉出最新文件并将其解压缩( stage保留war / ear文件,tmp具有解压缩版本)。这通常可以解决问题。