mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From llun <n...@llun.info>
Subject Can't use non english encoding when redirect request
Date Wed, 25 Nov 2009 18:11:02 GMT
I have problem with redirect request when response header has non english message. It shows
me below stacktrace. I debug to HttpResponseEncoder.java line 47 and see it use us-ascii charset
read header. So, when it read my response header it throws exception because it can't read
that message in ascii charset. I temporary fixed by changed to UTF but is it have a reason
or other ways to change charset without change code or should it change to unicode.

org.apache.mina.filter.codec.ProtocolEncoderException: java.nio.charset.UnmappableCharacterException:
Input length = 1
	at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:245)
	at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:467)
	at org.apache.mina.common.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:40)
	at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:835)
	at org.apache.mina.common.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:761)
	at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:467)
	at org.apache.mina.common.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:461)
	at org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:310)
	at org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:270)
	at play.server.HttpHandler.writeResponse(HttpHandler.java:402)
	at play.server.HttpHandler.copyResponse(HttpHandler.java:515)
	at play.server.HttpHandler$MinaInvocation.execute(HttpHandler.java:469)
	at play.Invoker$Invocation.run(Invoker.java:176)
	at play.server.HttpHandler$MinaInvocation.run(HttpHandler.java:456)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
	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:637)
Caused by: java.nio.charset.UnmappableCharacterException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:261)
	at org.apache.mina.common.AbstractIoBuffer.putString(AbstractIoBuffer.java:1275)
	at org.apache.asyncweb.common.HttpCodecUtils.encodeHeaders(HttpCodecUtils.java:216)
	at org.apache.asyncweb.common.HttpResponseEncoder.encode(HttpResponseEncoder.java:47)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:236)
	... 21 more



Mime
View raw message