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

作者:蓝色雨


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值