05 December 2008

NoSuchFieldException: dojoType in class "java class name"

Past few day I'm struggle with the error "NoSuchFieldException: dojoType in class equis.metastock.MS4Java.class" after my machine updated to JRE 1.6 update 10. My chart applet start conflicting with the dojo.js and above javascript error is showing all the time when the page is opened.

The problem is "parseonload=true" statement of the dojo script. It is parsing the java applet every time dojoOnLoad is fired. In JRE 1.6 update 10, SUN add some features to facilitate the interacting between Java applet and javascript. But this improvement somehow case the error.

Last week, I finally solved the problem. Solution is really simple. The error is "NoSuchFieldException: dojoType in class equis.metastock.class". So, I add both dojotype and dojoType in my applet tag and it's works ..... :).

< applet class="equs.metastock.class" codebase="..." archive="..." dojotype="" dojotype="" > ...... < /applet >

If you don't need to used "parseonload=true", then change to "parseonload=false". It will solve the problem also. In my case, I cannot set to false and I came up with the above solution.

Happy Programming ... :)


No comments: