Dreaded Exception SEVERE: A message body writer for Java class, MIME media type application/json


Gone are the days when error messages made sense. Something as simple as Annotation Missing has been replaced by something silly as MIME media type application.

The crazy exception below translates to having the following annotations in the ConsolidationSearchForUsersResponse class

@XmlRootElement(name = "Response")
@XmlAccessorType(XmlAccessType.FIELD)

</code>

Crazy Log shit

INFO com.mcruiseon.atom.endpoint.EndPointConsolidation - SearchUsers,
Aug 13, 2015 12:46:16 AM com.sun.jersey.spi.container.ContainerResponse write
com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, and Java type class com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, and MIME media type application/json was not found
Aug 13, 2015 12:46:16 AM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: The registered message body writers compatible with the MIME media type are:
application/json ->
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
*/* ->
com.sun.jersey.core.impl.provider.entity.FormProvider
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.json.impl.provider.entity.JSONJAXBElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
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
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy

Aug 13, 2015 12:46:16 AM 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 com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, and Java type class com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, 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:1448)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
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:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, and Java type class com.mcruiseon.atom.endpoint.response.ConsolidationSearchForUsersResponse, and MIME media type application/json was not found
... 28 more

Aug 13, 2015 1:02:09 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/AtomEndPoint] has started
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/AtomEndPoint] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AtomEndPoint] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->z8kfsx9b9t027hydr9jt|140323e]-AdminTaskTimer] but has failed to stop it. This is very likely to create a memory leak.
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AtomEndPoint] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->z8kfsx9b9t027hydr9jt|140323e]-HelperThread-#0] but has failed to stop it. This is very likely to create a memory leak.
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AtomEndPoint] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->z8kfsx9b9t027hydr9jt|140323e]-HelperThread-#1] but has failed to stop it. This is very likely to create a memory leak.
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AtomEndPoint] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->z8kfsx9b9t027hydr9jt|140323e]-HelperThread-#2] but has failed to stop it. This is very likely to create a memory leak.
Aug 13, 2015 1:02:09 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/AtomEndPoint] appears to have started a thread named [Thread-5] but has failed to stop it. This is very likely to create a memory leak.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s