getting "Content-Type must be 'text/plain' with 'charset=utf-8' (or unspecified charset)" error

590 views
Skip to first unread message

Clundahl

unread,
May 29, 2008, 12:16:33 AM5/29/08
to Google Web Toolkit
Hi

Im using Netbeans with plugin gwt4nb and running the rc 1.5.0 and
getting this stacktrace

javax.servlet.ServletException: Content-Type must be 'text/plain' with
'charset=utf-8' (or unspecified charset)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.readPayloadAsUtf8(RemoteServiceServlet.java:
119)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
178)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
831)
at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:
411)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
317)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
198)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:
390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
230)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
198)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
288)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:
271)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:
94)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:
577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
272)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:
637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:
568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:
813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:
341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:
263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:
214)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:
265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:
106)

Does anybody have an idea what to change? This did work on the
previous "gwt-windows-1.4.62"


Regards

//Clundahl

ukid...@mac.com

unread,
Jun 25, 2008, 8:43:12 PM6/25/08
to Google Web Toolkit
I am getting a similar error since I switched from GWT 1.4 to GWT 1.5.
Interesting thing is that a couple of times today the app worked.
http://ukitech.blogspot.com/2008/06/gwt-15-rpc-error.html
Tomcat 5, Mac OS X 1.5, GWT 1.5 RC1

----

ERROR 2008-06-25 19:37:39.883 org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/csd].log()
Exception while dispatching incoming RPC call
javax.servlet.ServletException: Content-Type must be 'text/plain' with
'charset=utf-8' (or unspecified charset)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.readPayloadAsUtf8(RemoteServiceServlet.java:
119)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
178)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:613)

Miguel Méndez

unread,
Jun 25, 2008, 9:20:16 PM6/25/08
to Google-We...@googlegroups.com
Guys,

The RPC content type was switched from 'text/plain' in GWT 1.4 to 'text/x-gwt-rpc' in GWT 1.5.  If your server is complaining that the content type is not 'text/plain' then your server is still using a GWT 1.4 gwt-servlet.jar.  Updating your server to use the GWT 1.5 gwt-servlet.jar will fix it.
--
Miguel

woiff

unread,
Jul 30, 2008, 11:33:42 AM7/30/08
to Google Web Toolkit
Can client-side code utilizing RPC and compiled in GWT 1.4 work with
the 1.5 gwt-servlet.jar? It doesn't appear that it can, since I'm
getting similar 'text/x-gwt-rpc' errors in my server logs.

On Jun 25, 6:20 pm, "Miguel Méndez" <mmen...@google.com> wrote:
> Guys,
> The RPC content type was switched from 'text/plain' in GWT 1.4 to
> 'text/x-gwt-rpc' in GWT 1.5.  If your server is complaining that the content
> type is not 'text/plain' then your server is still using a GWT 1.4
> gwt-servlet.jar.  Updating your server to use the GWT 1.5 gwt-servlet.jar
> will fix it.
>
> On Wed, Jun 25, 2008 at 8:43 PM, ukidlu...@mac.com <ukidlu...@mac.com>
> wrote:
>
>
>
>
>
>
>
> > I am getting a similar error since I switched from GWT 1.4 to GWT 1.5.
> > Interesting thing is that a couple of times today the app worked.
> >http://ukitech.blogspot.com/2008/06/gwt-15-rpc-error.html
> > Tomcat 5, Mac OS X 1.5, GWT 1.5 RC1
>
> > ----
>
> > ERROR   2008-06-25 19:37:39.883 org.apache.catalina.core.ContainerBase.
> > [Catalina].[localhost].[/csd].log()
> >        Exception while dispatching incoming RPC call
> > javax.servlet.ServletException: Content-Type must be 'text/plain' with
> > 'charset=utf-8' (or unspecified charset)
> >        at
>
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.readPayloadAsUtf8(Remot­eServiceServlet.java:
> > 119)
> >        at
>
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceSer­vlet.java:
> > 178)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >         at
>
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio­nFilterChain.java:
> > 252)
> >         at
>
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC­hain.java:
> > 173)
> >         at
>
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j­ava:
> > 213)
> >         at
>
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j­ava:
> > 178)
> >         at
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
> > 126)
> >        at
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
> > 105)
> >         at
>
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav­a:
> > 107)
> >        at
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> > 148)
> >        at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> > 869)
> >        at org.apache.coyote.http11.Http11BaseProtocol
> > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
> > 664)
> >        at
>
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja­va:
> > 527)
> >        at
>
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW­orkerThread.java:
> > 80)
> >        at org.apache.tomcat.util.threads.ThreadPool
> > $ControlRunnable.run(ThreadPool.java:684)
> >        at java.lang.Thread.run(Thread.java:613)
>
> --
> Miguel- Hide quoted text -
>
> - Show quoted text -

Miguel Méndez

unread,
Jul 30, 2008, 1:00:33 PM7/30/08
to Google-We...@googlegroups.com
No, it won't.
--
Miguel

woiff

unread,
Jul 30, 2008, 1:08:58 PM7/30/08
to Google Web Toolkit
OK, so it can -- at least for my implementation and preliminary tests
-- if you're willing to take your old client-side 1.4 javascript /
public files and do a search on 'text/plain' and replace with 'text/x-
gwt-rpc'. Obviously, this is not the ideal option for backward
compatibility.

On Jul 30, 8:33 am, woiff <cdwo...@gmail.com> wrote:
> Can client-side code utilizingRPCand compiled in GWT 1.4 work with
> the 1.5 gwt-servlet.jar?  It doesn't appear that it can, since I'm
> getting similar 'text/x-gwt-rpc' errors in my server logs.
>
> On Jun 25, 6:20 pm, "Miguel Méndez" <mmen...@google.com> wrote:
>
>
>
> > Guys,
> > TheRPCcontent typewas switched from 'text/plain' in GWT 1.4 to
> > 'text/x-gwt-rpc' in GWT 1.5.  If your server is complaining that thecontent> typeis not 'text/plain' then your server is still using a GWT 1.4
> > gwt-servlet.jar.  Updating your server to use the GWT 1.5 gwt-servlet.jar
> > will fix it.
>
> > On Wed, Jun 25, 2008 at 8:43 PM, ukidlu...@mac.com <ukidlu...@mac.com>
> > wrote:
>
> > > I am getting a similar error since I switched from GWT 1.4 to GWT 1.5.
> > > Interesting thing is that a couple of times today the app worked.
> > >http://ukitech.blogspot.com/2008/06/gwt-15-rpc-error.html
> > > Tomcat 5, Mac OS X 1.5, GWT 1.5 RC1
>
> > > ----
>
> > > ERROR   2008-06-25 19:37:39.883 org.apache.catalina.core.ContainerBase.
> > > [Catalina].[localhost].[/csd].log()
> > >        Exception while dispatching incomingRPCcall
> > > javax.servlet.ServletException:Content-Typemust be 'text/plain' with
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages