quinta-feira, março 11, 2010

What happens when you erase appdb folder

I tried to run a j2me application that I'm developing at work and I got the following error:

Connecting to 127.0.0.1 on port 2800
Waiting for KVM...
Waiting for debugger on port 2419
Connection received.
Running with storage root C:\Documents and Settings\moliveira\j2mewtk\2.5.2\appdb\DefaultColorPhone
Running with locale: Portuguese_Brazil.1252
Running in the manufacturer security domain
Connected to KVM
Incorrect domain name, switching to 'null'
java.lang.NullPointerException
    at java.util.Hashtable.get(+6)
    at com.sun.midp.security.Permissions.isValidDomainName(+26)
    at com.sun.midp.dev.DevMIDletSuiteImpl.create(+16)
    at com.sun.midp.dev.DevMIDletSuiteImpl.create(+74)
    at com.sun.midp.main.Main.runLocalClass(+20)
    at com.sun.midp.main.Main.main(+80)
Execution completed.
2798099 bytecodes executed
18 thread switches
1665 classes in the system (including system classes)
40932 dynamic objects allocated (2354324 bytes)
3 garbage collections (2138384 bytes collected)


I made a mistake and the content of appdb that belongs to Sun Java  Wireless Toolkit 2.5.02_1 for CLDC has been erased. Some configuration file was deleted which caused the error described above.

The fastest mode to solve this problem:
  • erase the folder named j2mewtk that is inside Documents and Settings under another folder named as your login user. (For instance, C:\Documents and Settings\moliveira\j2mewtk\)
  • run the Wireless Toolkit. It will recreate the folder j2mewtk and the problem will be solved.

O que acontece quando se apaga a pasta appdb

Ao tentar rodar um aplicativo j2me que estou desenvolvendo aqui na empresa, ocorria o seguinte erro:

Connecting to 127.0.0.1 on port 2800
Waiting for KVM...
Waiting for debugger on port 2419
Connection received.
Running with storage root C:\Documents and Settings\moliveira\j2mewtk\2.5.2\appdb\DefaultColorPhone
Running with locale: Portuguese_Brazil.1252
Running in the manufacturer security domain
Connected to KVM
Incorrect domain name, switching to 'null'
java.lang.NullPointerException
    at java.util.Hashtable.get(+6)
    at com.sun.midp.security.Permissions.isValidDomainName(+26)
    at com.sun.midp.dev.DevMIDletSuiteImpl.create(+16)
    at com.sun.midp.dev.DevMIDletSuiteImpl.create(+74)
    at com.sun.midp.main.Main.runLocalClass(+20)
    at com.sun.midp.main.Main.main(+80)
Execution completed.
2798099 bytecodes executed
18 thread switches
1665 classes in the system (including system classes)
40932 dynamic objects allocated (2354324 bytes)
3 garbage collections (2138384 bytes collected)


Eu apaguei por engano todo o conteúdo da pasta appdb do Sun Java Wireless Toolkit 2.5.02_1 for CLDC e com isso alguma configuração foi embora.

O modo mais rápido de resolver isso é:

  • apague a pasta j2mewtk que está dentro de Documents and Settings sob outra pasta que tem o nome do teu login. (Por exemplo, C:\Documents and Settings\moliveira\j2mewtk\).
  • execute o Wireless Toolkit. Ele recriará a pasta j2mewtk e o problema será resolvido.