- PR -

ディレクティブのエンコード指定で落ちる

1
投稿者投稿内容
よしだ りょう
会議室デビュー日: 2003/01/31
投稿数: 1
投稿日時: 2003-02-05 16:26
初めて投稿します。

JDK1.4.1
Tomcat4.0.6
Windows98 SE

上記環境で簡単なJSPを作成したのですが、
<%@ page contentType="text/html; charset=Shift_JIS" %>
があると、エラーで落ちてしまいます。


作成したJSPです。
<%@ page contentType="text/html; charset=Shift_JIS" %>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<%
String s = "こんにちわ 世界";
out.println(s);
%>
</body>
</html>


以下エラーログです。
javax.servlet.ServletException: tried to access class sun.io.ByteToCharJIS0208 from class sun.nio.cs.ext.JIS_X_0208$Decoder
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:481)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

root cause

java.lang.IllegalAccessError: tried to access class sun.io.ByteToCharJIS0208 from class sun.nio.cs.ext.JIS_X_0208$Decoder
at sun.nio.cs.ext.JIS_X_0208$Decoder.(JIS_X_0208.java:40)
at sun.nio.cs.ext.SJIS.newDecoder(SJIS.java:39)
at sun.nio.cs.StreamDecoder$CharsetSD.(StreamDecoder.java:355)
at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:72)
at java.io.InputStreamReader.(InputStreamReader.java:83)
at org.apache.jasper.compiler.ParserController.getReader(ParserController.java:438)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:209)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)

<%@ page contentType="text/html; charset=Shift_JIS" %> を削除すると
普通に動作します。

なぜ落ちるのかがさっぱりわかりません。
charsetをEUC-JPでも落ちます。UTF-8だと落ちませんが文字化けします。

どんな情報でも構いませんので教えていただけないでしょうか。
1

スキルアップ/キャリアアップ(JOB@IT)