javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml'

Atlassian JIRA | Lucas Timm [Atlassian] | 4 years ago
  1. 0

    h3. Steps to reproduce: - Set up a JIRA instance with [Atlassian Developer Toolbox|https://marketplace.atlassian.com/plugins/com.atlassian.devrel.developer-toolbox-plugin] (current version: 2.0.3); - Create a test project and an issue (FOOBAR-1); - Browse to _Administration -> Developer Toolbox -> Developer Toolbox -> REST API Browser_. - Click in _Applinks Product Plugin_ and select _Atlassian JIRA - Plugins - REST Plugin_ which has the URL http://$BASE_URL/rest/api/2; - Scroll down the screen and look for the *GET* method which belongs to the */issue/\{issueIdOrKey\}/transitions* method; - Enter "FOOBAR-1" on the _issueIdOrKey_ parameter and click in _Execute_; - Pick a transition ID and at random; - Now scroll down the screen a little bit and look for the *POST* method which belongs to */issue/\{issueIdOrKey\}/transitions*; - Enter "FOOBAR-1" on the _issueIdOrKey_ parameter, add the following parameters on the request field and click in _Execute_: {code} { "update": { "comment": [ { "add": { "body": "resolving issue" } } ] }, "transition": { "id": "5" } } {code} h4. Current behavior: - The issue is not transitioned, the comment isn't added and we have the following error in _jira-application.log_: {noformat} http-bio-8080-exec-18 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.IllegalArgumentException: Error parsing media type ', application/xml' javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml' at com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77) at com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637) at com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters(WebComponent.java:832) <+2> (WebComponent.java:407) (ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) <+1> (ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) <+16> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (RestServletUtilsUpdaterFilter.java:26) (RestServletUtilsUpdaterFilter.java:40) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (ContextFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37) <+15> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.permissions.ApiScopingFilter.doFilter(ApiScopingFilter.java:60) <+22> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (SecurityFilter.java:234) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (TrustedApplicationsFilter.java:98) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (BaseLoginFilter.java:169) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) (OAuthFilter.java:55) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) <+18> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (UrlRewriteFilter.java:738) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (GzipFilter.java:74) (GzipFilter.java:51) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:70) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.util.http.bigpipe.RequestIdSettingFilter.doFilter(RequestIdSettingFilter.java:22) <+43> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (JWDSendRedirectFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:45) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (JiraStartupChecklistFilter.java:74) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (MultiTenantServletFilter.java:91) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (StandardWrapperValve.java:225) (StandardContextValve.java:123) (AuthenticatorBase.java:472) (StandardHostValve.java:168) (ErrorReportValve.java:98) (StandardEngineValve.java:118) (AccessLogValve.java:927) (CoyoteAdapter.java:407) (AbstractHttp11Processor.java:1001) (AbstractProtocol.java:585) (JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalArgumentException: Error parsing media type ', application/xml' at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53) at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:89) ... 133 more at com.sun.jersey.core.header.reader.HttpHeaderReader.nextToken(HttpHeaderReader.java:98) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:89) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77) ... 136 more {noformat} h4. Expected behavior: - The issue should be transitioned and the comment must be added; h3. Considerations: - The REST method is *working*; Testing it with [Postman REST Client|https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm/details?utm_source=chrome-ntp-icon] or another tool we got the expected behavior. - The "Caused by" in the stacktrace told us what problem have happened: The header _Content-Type_ was set to {{"', application/xml'"}} instead of {{"application/json"}}.

    Atlassian JIRA | 4 years ago | Lucas Timm [Atlassian]
    javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml'
  2. 0

    h3. Steps to reproduce: - Set up a JIRA instance with [Atlassian Developer Toolbox|https://marketplace.atlassian.com/plugins/com.atlassian.devrel.developer-toolbox-plugin] (current version: 2.0.3); - Create a test project and an issue (FOOBAR-1); - Browse to _Administration -> Developer Toolbox -> Developer Toolbox -> REST API Browser_. - Click in _Applinks Product Plugin_ and select _Atlassian JIRA - Plugins - REST Plugin_ which has the URL http://$BASE_URL/rest/api/2; - Scroll down the screen and look for the *GET* method which belongs to the */issue/\{issueIdOrKey\}/transitions* method; - Enter "FOOBAR-1" on the _issueIdOrKey_ parameter and click in _Execute_; - Pick a transition ID and at random; - Now scroll down the screen a little bit and look for the *POST* method which belongs to */issue/\{issueIdOrKey\}/transitions*; - Enter "FOOBAR-1" on the _issueIdOrKey_ parameter, add the following parameters on the request field and click in _Execute_: {code} { "update": { "comment": [ { "add": { "body": "resolving issue" } } ] }, "transition": { "id": "5" } } {code} h4. Current behavior: - The issue is not transitioned, the comment isn't added and we have the following error in _jira-application.log_: {noformat} http-bio-8080-exec-18 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.IllegalArgumentException: Error parsing media type ', application/xml' javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml' at com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77) at com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637) at com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters(WebComponent.java:832) <+2> (WebComponent.java:407) (ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) <+1> (ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) <+16> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (RestServletUtilsUpdaterFilter.java:26) (RestServletUtilsUpdaterFilter.java:40) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (ContextFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37) <+15> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.permissions.ApiScopingFilter.doFilter(ApiScopingFilter.java:60) <+22> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (SecurityFilter.java:234) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (TrustedApplicationsFilter.java:98) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (BaseLoginFilter.java:169) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) (OAuthFilter.java:55) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40) <+18> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (UrlRewriteFilter.java:738) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (GzipFilter.java:74) (GzipFilter.java:51) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:70) <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.util.http.bigpipe.RequestIdSettingFilter.doFilter(RequestIdSettingFilter.java:22) <+43> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (JWDSendRedirectFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:45) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (JiraStartupChecklistFilter.java:74) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (MultiTenantServletFilter.java:91) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (StandardWrapperValve.java:225) (StandardContextValve.java:123) (AuthenticatorBase.java:472) (StandardHostValve.java:168) (ErrorReportValve.java:98) (StandardEngineValve.java:118) (AccessLogValve.java:927) (CoyoteAdapter.java:407) (AbstractHttp11Processor.java:1001) (AbstractProtocol.java:585) (JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalArgumentException: Error parsing media type ', application/xml' at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53) at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:89) ... 133 more at com.sun.jersey.core.header.reader.HttpHeaderReader.nextToken(HttpHeaderReader.java:98) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:89) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77) ... 136 more {noformat} h4. Expected behavior: - The issue should be transitioned and the comment must be added; h3. Considerations: - The REST method is *working*; Testing it with [Postman REST Client|https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm/details?utm_source=chrome-ntp-icon] or another tool we got the expected behavior. - The "Caused by" in the stacktrace told us what problem have happened: The header _Content-Type_ was set to {{"', application/xml'"}} instead of {{"application/json"}}.

    Atlassian JIRA | 4 years ago | Lucas Timm [Atlassian]
    javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type ', application/xml'
  3. 0

    I have a textual file with SQL extension. I have attached it using Eclipse Mylyn/JIRA integration plugin. I have deleted that file from Jira using browser. I have tried to attach that file again using browser. I got following error on server side: {code:java} 2012-11-20 17:10:19,870 http-8080-5 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.IllegalArgumentException: Error parsing media type 'text\plain' javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'text\plain' at com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77) at com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637) at com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters(WebComponent.java:832) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:407) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilterInternal(RestServletUtilsUpdaterFilter.java:26) at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilter(RestServletUtilsUpdaterFilter.java:40) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.executeRequest(AccessLogFilter.java:103) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.doFilter(AccessLogFilter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.security.xsrf.XsrfTokenAdditionRequestFilter.doFilter(XsrfTokenAdditionRequestFilter.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.permissions.ApiScopingFilter.doFilter(ApiScopingFilter.java:71) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:234) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:98) ... some more lines ... Caused by: java.lang.IllegalArgumentException: Error parsing media type 'text\plain' at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53) at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:89) ... 131 more Caused by: java.text.ParseException: Expected separator '/' instead of '\' at com.sun.jersey.core.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:117) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:90) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77) ... 134 more {code}

    Atlassian JIRA | 4 years ago | Rade Martinović
    javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'text\plain'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If Bad Content-Type is set in request say "abcd" it throws java.lang.IllegalArgumentException: Error parsing media type "abcd" with 500 internal server error. While is handled appropriately in a put request which returns Bad Content-Type header value: 'abcd' with status code as 400 Bad Request. The stacktrace of error: javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'abcd' at com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77) at com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637) at com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters(WebComponent.java:832) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:407) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) .... at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalArgumentException: Error parsing media type 'abcd' at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53) at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:89) ... 38 more Caused by: java.text.ParseException: End of header at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.getNextCharacter(HttpHeaderReaderImpl.java:219) at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:184) at com.sun.jersey.core.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:112) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:90) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77) ... 41 more

    Java.net JIRA | 5 years ago | chandankr
    javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'abcd'
  6. 0

    I have a textual file with SQL extension. I have attached it using Eclipse Mylyn/JIRA integration plugin. I have deleted that file from Jira using browser. I have tried to attach that file again using browser. I got following error on server side: {code:java} 2012-11-20 17:10:19,870 http-8080-5 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.IllegalArgumentException: Error parsing media type 'text\plain' javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'text\plain' at com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77) at com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637) at com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters(WebComponent.java:832) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:407) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795) at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilterInternal(RestServletUtilsUpdaterFilter.java:26) at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilter(RestServletUtilsUpdaterFilter.java:40) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.executeRequest(AccessLogFilter.java:103) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.doFilter(AccessLogFilter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.security.xsrf.XsrfTokenAdditionRequestFilter.doFilter(XsrfTokenAdditionRequestFilter.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.labs.remoteapps.modules.permissions.ApiScopingFilter.doFilter(ApiScopingFilter.java:71) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:234) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:98) ... some more lines ... Caused by: java.lang.IllegalArgumentException: Error parsing media type 'text\plain' at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53) at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) at com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:89) ... 131 more Caused by: java.text.ParseException: Expected separator '/' instead of '\' at com.sun.jersey.core.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:117) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:90) at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77) ... 134 more {code}

    Atlassian JIRA | 4 years ago | Rade Martinović
    javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Error parsing media type 'text\plain'

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.ws.rs.WebApplicationException

      java.lang.IllegalArgumentException: Error parsing media type ', application/xml'

      at com.sun.jersey.server.impl.model.HttpHelper.clientError()
    2. Jersey
      ContainerRequest.getMediaType
      1. com.sun.jersey.server.impl.model.HttpHelper.clientError(HttpHelper.java:265)
      2. com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:91)
      3. com.sun.jersey.server.impl.model.HttpHelper.getContentType(HttpHelper.java:77)
      4. com.sun.jersey.spi.container.ContainerRequest.getMediaType(ContainerRequest.java:637)
      4 frames