您的位置:首页 > 理论基础 > 计算机网络

oracle ilearning中文汉字问题解决办法以及HTTP调试工具Fiddler的使用方法介绍

2013-01-25 14:12 1231 查看
作者:蓝色雨

ilearning课程跟踪的时候发现如果是三个汉字的人名的时候课程播放的时候报Incorrect Data Type错误

日志为:

** LMSGetValue("cmi.core.lesson_status") [Fri Jan 18 16:29:51 CST 2013]
Request:
action=GetParam
Reply:
errorCode=0
oracle.ila.user.email=@
cmi.launch_data=
oracle.ila.user.username=COLI_sunlin
cmi.core.credit=credit
cmi.core.session_time=00:00:00
oracle.ila.user.familiar_name=
cmi.core.entry=
cmi.core.lesson_location=
oracle.ila.user.first_name=闇?cmi.core.student_name=瀛? 闇?cmi.core.total_time=00:06:41.35
cmi.comments=
errorText=
cmi.core.lesson_status=incomplete
cmi.core.student_id=COLI_sunlin
cmi.core.exit=
cmi.core.lesson_mode=normal
oracle.ila.user.last_name=瀛?cmi.core.score.raw=
cmi.suspend_data=0+0+0-0+0+0-0+0+0+0+0
LMS Error: 405 - Incorrect Data Type
Error diagnostic: <none>
Error stack trace:
oracle.ila.learner.LMSException
at oracle.ila.learner.LMSKeyword.setValue(LMSKeyword.java:143)
at oracle.ila.learner.LMSKeyword.<init>(LMSKeyword.java:82)
at oracle.ila.learner.LMSGroup.addElement(LMSGroup.java:33)
at oracle.ila.learner.LMSGroup.addElement(LMSGroup.java:23)
at oracle.ila.learner.LMSApplet.createElements(LMSApplet.java:893)
at oracle.ila.learner.LMSApplet.getElements(LMSApplet.java:630)
at oracle.ila.learner.LMSApplet.getValue(LMSApplet.java:466)
at oracle.ila.learner.LMSApplet.LMSGetValue(LMSApplet.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MethodInfo.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MemberBundle.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke0(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$DefaultInvocationDelegate.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Returned: ""


发现是oracle.ila.user.first_name字段很长导致

于是反编译applet日志跟踪分析调用:

<applet name="API" width="1" height="1" codeBase="/ilearn/" code="oracle.ila.learner.LMSApplet" archive="lms.jar" alt="小应用程序" MAYSCRIPT="">

2network: 服务器 http://e.cohl.com/ilearn/en/learner/jsp/lms.jsp
3LMSBean.java

4ContentAPIBean.java

if(action.equalsIgnoreCase("GetParam"))

return doGetParam();

getPlayerModule().getParam(getAttemptUserId(), getAttemptId());

5PlayerModuleImpl.java

public synchronized Hashtable getParam(Number userId, Number attemptId)

然后用Fiddler工具截取二进制判断,发现可能是后台输出的时候是UTF8格式,而前台没设置编码,可能用的是GBK编码,后来在控制面板的时区中把系统设置为美国,果然没有问题。说明是中文操作系统导致

oracle.ila.user.first_name字段反正前台课件中没用到,于是在后台输出的时候替换了这个值

于是修改类public class LMSBean extends ContentAPIBean

protected String formatResponse(Hashtable h)
{
String msg = "";
Enumeration e = h.keys();
do
{
if(!e.hasMoreElements())
break;
String key = (String)e.nextElement();
if("oracle.ila.user.first_name".equals(key)){
msg = msg + key + "=" + "user";
}else if("cmi.core.student_name".equals(key)){
msg = msg + key + "=" + "cohl";
}else{
msg = msg + key + "=" + h.get(key);
}
if(e.hasMoreElements())
msg = msg + "\n";
} while(true);
return msg;
}


1先下载 dotnetfx 2.0,如果.net安装不上需要下载dotnetfx_cleanup_tool,清理一下重启电脑

2然后到官方下载 Fiddler2Setup.exe

3使用方法介绍:
http://wenku.baidu.com/view/d2de8baad1f34693daef3e35.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐