applet object give nullpointer exception when first time calling method on object with java update 1.7
===

I update my jre from 1.6 update 31 to 1.7 update05, now when first time applet object is created and java script call the method on applet object then it give null pointer exception but and after that it does not occur but when I put an alert just before the call to method on object then at alert object is shown and this exception does not occur. Can any body tell me what is the problem and what should I do to resolve it.