[J2q & A] untrusted domain is not configured response

Source: Internet
Author: User
Tags netbeans
  [When]

First use Netbean 4.0/5.0 DevelopmentProgramWhen running the program, the user may encounter the following error, causing the simulator to flash through :

Using the storage root Defacolorcolorphone To run
The domain name is incorrect. Switch 'Untrusted'
Java. Lang. securityexception: untrusted domain is not configured

At com. Sun. MIDP. Security. permissions. fordomain (permissions. Java: 530)
At com. Sun. MIDP. Dev. devmidletsuiteimpl. Create (devmidletsuiteimpl. Java: 148)
At com. Sun. MIDP. Dev. devmidletsuiteimpl. Create (devmidletsuiteimpl. Java: 91)
At com. Sun. MIDP. Main. Main. runlocalclass (main. Java: 453)
At com. Sun. MIDP. Main (main. Java: 126)
Execution completed.

 

[Howto]

One of the possible causes:

User'sWindowsThe logon username is in Chinese, or the user's program path contains Chinese characters.

 

Cause 2:

NetbeanThere is a corresponding way to set the trust domain. You may not have set this parameter.

We recommend that you Netbean Select a project, right-click À Properties, find run, Then configure the domain in it and follow his selection Untrusted .

[ More details ]

" Because Netbean The C: \ document and Settings \ $ {username }\ Create one . Netbean And some related properties and settings are built under this directory. Netbean Use simplified Chinese,If $ {Username} It is a Chinese text and cannot be confirmed Untrusted domain Is identified as incorrect .

Modification method:

In Netbean Before installation, go "C: \ Program Files \ netbeans-5.0 \ etc" Find Netbeans. conf File, and find the following content
# Netbeans_default_userdir = "$ {home}/. netbeans/5.0"
Modify Netbeans_default_userdir = "F: \ prog \ Java \. netbeans \ 4.0" And then start Netbean You can. ( The preceding directory needs to be changed visually, but it is recommended that the directory be pure English ) .

"

And

"

 

Understanding protection Domains

A protection comprises two parts:

    1. Permissions which are allowed (granted to contained MIDlet suites), and permissions for which the user must be consulted
    2. Criteria for entry into the protection domain

When you click onRunButton in the j2e-wireless toolkit, the current MIDlet suite is run in a protection domain calledUntrusted. In this domain, the user is consulted for all permissions. That's why the emulator prompts you for permission whenHttpmidletAttempts its HTTP connection.

You can change the MIDlet suite's runtime protection domain by choosingEdit-> preferences, Then clicking onSecurityTab:


Selecting a protection domain
(Click for the full image .)

The j2e-wireless Toolkit provided des four protection domains. midlets inMinimumDomain are denied all permissions.UntrustedDomain prompts the user for every permission.TrustedDomain is a kind of MIDlet Security Nirvana where all permissions are granted; It's equivalentMaximum.

 

"

[Tips]

In viewC ++Development,JavaMany developers have encountered similar problems. Therefore, we strongly recommend that:

1: YoursWindowsThe user name must not contain Chinese characters;

2: Your program running path, project path, or component registration path should not contain Chinese characters;

3 : As a full-time developer, please develop a good habit of English folder names.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.