[J2ME Q&A]Target port denied to untrusted applications问题回应

简介:

 [When]

开发J2ME程序的时候,用户可能在运行Socket程序连接远端Socket服务器时出现不受信任的错误,如下面的代码:

SocketConnection sc =

(SocketConnection)Connector.open("socket://localhost:8080");

 

报错为:
Uncaught exception java/lang/SecurityException:

Target port denied to untrusted applications.

 

[HowTo]

可能导致的原因之一:

SocketConnection的使用中,只有受信任的midlet才可以去访问服务器的808080端口。如果不受信任的midlet尝试去访问服务器的808080端口,那么SecurityException会被抛出。

这时候,只要在J2ME Wireless Toolkit 选项里面的安全域里面选trusted

 

 [More Details]

WTKàKtoolbarà“偏好”菜单:

TrustedDomainInKToolbar

目录
相关文章
|
iOS开发
IOS Pods Failed to connect to www.gstatic.com port 443: Operation timed out
IOS Pods Failed to connect to www.gstatic.com port 443: Operation timed out
88 0
|
3月前
|
Java Spring
成功解决Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings
这篇文章提供了解决Spring Initializr网站初始化失败问题的方法,包括检查URL、网络和代理设置。
成功解决Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings
|
6月前
|
Java Spring
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
1012 0
|
关系型数据库 MySQL 数据库
MySql错误 1251 - Client does not support authentication protocol requested by server
MySql错误 1251 - Client does not support authentication protocol requested by server
91 0
|
Docker 容器
docker报错ERROR: for hass “host” network_mode is incompatible with port_bindings
docker报错ERROR: for hass “host” network_mode is incompatible with port_bindings
2726 0
|
Java Spring
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
3503 1
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
|
安全 网络安全 开发工具
【已解决】Unable to negotiate with 47.98.49.44 port 22: no matching host key type found. Their offer: ssh
Unable to negotiate with 47.98.49.44 port 22: no matching host key type found. Their offer: ssh
489 0
【已解决】Unable to negotiate with 47.98.49.44 port 22: no matching host key type found. Their offer: ssh
|
XML 安全 Android开发
Android P 第二个测试版本请求网络 CLEARTEXT communication to host not permitted by network
Android P 第二个测试版本请求网络 CLEARTEXT communication to host not permitted by network
184 0
|
网络安全
Received disconnect from **.**).***.*** port 22:2: Too many authentication failures 解决办法
登录云服务器(使用云服务器自己的命令行工具) 之后只需要修改这个地方就可以了 vim  /etc/ssh/sshd_config 将这行注释去掉,并且修改他的值稍微大一点即可 MaxAuthTries 10
5153 0