Error while initializing MIDlet object SecurityException - Java me
I am working on an application on Jav开发者_如何学JAVAa me. All i want to do is to access members from a MIDlet from another class.
I have a class mainFrm which is the main form. And i want to access some non-static methods from another class.
And my code is the following:
mainFrm myForm = new mainFrm(); //Initialize the object
myForm.aNonStaticMethod(); //Call the method
However when calling the constructor i get a Security exception.
I think that i miss something! Any help would be gratefull! Thnx!!!
In my experience with MIDP, Security Exceptions are primarily caused by lack of signing, and it usually is only thrown when trying to access a class that is placed in a "trusted" domain (i.e. not accessible unless the JAD is signed). See: http://developers.sun.com/mobility/midp/articles/permissions/ for more info on domains and permissions.
My guess is that in your mainFrm() constructor you are accessing a class that cannot be accessed via untrusted domain. 99% of these exceptions are due to HTTP or Sockets. Are you using those classes in the constructor?
精彩评论