总结Sync4j的Nokia手机实践结果 

分类: J2ME   出处:iocblog整理  更新时间:2008-06-15   添加到收藏  

  配置好sync4j服务器后,我在nokia手机上设置好同步,准备和这个远端服务器进行联系人的同步。
  
  下面的日志记录了两次失败的过程:
  
  第一次手机登录:
  
  由于sync4j对设备要求事先在管理控制台上配置好,并添加规则,才能够让手机登录。所以第一次尝试遭遇到了下面的失败提示:
  
  [sep 17, 2005 2:13:16 pm] info: handling incoming request /sync4j/sync.
  
  [sep 17, 2005 2:13:16 pm][sync4j.handler] warning: client device 'imei:354488006208691' not found. authentication may fail.
  
  [sep 17, 2005 2:13:17 pm][sync4j]
  
  severe: error reading principal: sync4j.framework.server.store.notfoundexception: principal not found for imei:354488006208691/guest
  
  [sep 17, 2005 2:13:17 pm] info: authentication failed for device imei:354488006208691. make sure that the client used correct username and password and that there is a principal associating the user to the device.
  
  这时候手机上提示“无效的用户名密码”。
  
  说明手机的设备imei在系统中没有定义。
  
  添加了device,添加了该imei device+user的principal之后,重新来过。
  
  第二次手机登录:
  

  [sep 17, 2005 2:19:05 pm] info: handling incoming request /sync4j/sync.
  
  [sep 17, 2005 2:19:13 pm] info: guest/imei:354488006208691 logged in.
  
  这时候手机上提示“无法打开数据库”。
  
  打开所有的日志,可以看到:
  
  “
  [sep 17, 2005 3:06:09 pm]
  
  [sync4j.engine]
  
  finest:
  
   checking if the database[来源 www.iocblog.net]
  
  sync4j.framework.database.database@1d349e2[name=./scal,type=,statuscode=200,target=sync4j.framework.core.target@97d3f0,source=sync4j.framework.core.source@1db6942,anchor=sync4j.framework.core.anchor@1db9f45,principal=imei:353388006208690/guest] is in the server database list.
  
  [sep 17, 2005 3:06:09 pm][sync4j.engine] finest: not found sir”
  
  而使用sync4j所带的gui client得到的成功登录日志是:
  
  “[sep 17, 2005 3:13:08 pm] info: guest/syncml-phone logged in.
  
  [sep 17, 2005 3:13:08 pm][sync4j.handler] finest: moving to state state_pkg1_receiving
  
  [sep 17, 2005 3:13:08 pm][sync4j.handler] finest: processing the initialization commands
  
  [sep 17, 2005 3:13:08 pm][sync4j.engine] finest: checking if the database
  
  sync4j.framework.database.database@1a32ea4[name=scal,type=,statuscode=200,target=sync4j.framework.core.target@4b12d9,source=sync4j.framework.core.source@c28cb7,anchor=sync4j.framework.core.anchor@a45435,principal=syncml-phone/guest] is in the server database list.
  
  [sep 17, 2005 3:13:08 pm][sync4j.engine] finest: yes sir!”
  
  也就是说,nokia手机登录sync4j总是设置数据库为“./scal”,而原本应该为“scal”。
  
  在手机端配置参数时,确实有一个数据库名要求配置,但明明写的是“scal”,不知道为什么传过来请求时多了一个“./”,造成接下来“not found sir”错误,所以手机上提示“无法打开数据库”。
  
  不知道如何修改。



文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。