详细解决方案
创建本地文件异常“ Root is not accessible”请高手指教
热度:8478 发布时间:2013-02-25 21:34:56
public void AddPhoto(byte[] snap){
try{
FileConnection fc=(FileConnection)Connector.open("file:///root/resources/base");
if(!fc.exists()){
fc.create();
OutputStream out = fc.openOutputStream();
out.write(snap);
out.flush();
out.close();
}
System.out.println("*****addphoto*****");
fc.close();
}catch(Exception e){
System.out.println("*****fc****");
e.printStackTrace();
}
为什么这段代码会出现这些错误:
java.io.IOException: Root is not accessible
Generic/DefaultColorPhone: at com.sun.midp.io.j2me.file.Protocol.ensureConnected(+47)
Generic/DefaultColorPhone: at com.sun.midp.io.j2me.file.Protocol.ensureOpenAndConnected(+21)
Generic/DefaultColorPhone: at com.sun.midp.io.j2me.file.Protocol.create(+8)
Generic/DefaultColorPhone: at com.protel.MM.Control.MutiFile.AddPhoto(+24)
Unable to translate stacktrace: Unable to start the "jad"-decompiler: [java.io.IOException: Cannot run program "jad.exe": CreateProcess error=2, The system cannot find the file specified]. jad is available from http://www.kpdus.com/jad.
Generic/DefaultColorPhone: at com.protel.MM.View.NoticForm$1.run(+17)
------解决方案--------------------------------------------------------
在我的机器上file:///root1/就对应如下地址
C:\WTK2.5.1\appdb\DefaultColorPhone\filesystem\root1
我的wtk装在c盘,你自己改改吧。
建议先使用如下方法获取根目录列表。
- Java code
public String[] DeviceGetRoots() { Enumeration enumRoot = FileSystemRegistry.listRoots();// 返回根目录组成的序列 Vector list = new Vector(); while (enumRoot.hasMoreElements()) { list.addElement(enumRoot.nextElement()); } String[] ret = null; if (list.size() > 0) { ret = new String[list.size()]; for (int i = 0; i < list.size(); i++) { ret[i] = (String) list.elementAt(i); } } return ret; }
------解决方案--------------------------------------------------------
mark
------解决方案--------------------------------------------------------
根目录写错了吧
wtk上应该是 file://localhosst/root
------解决方案--------------------------------------------------------
我用FileConnection创建目录时也遇到类似的问题,还不知道怎么解决!
------解决方案--------------------------------------------------------
根目录地址错了吧。 [file:///] 或者 [file://localhost/] 表示模拟器的根目录地址。
相关解决方案
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password,该如何处理
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password解决思路
- 网页展示Access denied for user 'root'@'localhost'
- root、root给它整郁闷死了.求解!该怎么处理
- 怎么在外部修改web项目的context-root(web发布名称)
- tomcat起步后spring自动关闭 Closing Spring root WebApplicationContext
- soap调用webservice,报错:Root element of a SOAP message must be: 'http://schemas.xmls,该怎么处理
- 创建本地文件异常“ Root is not accessible”请高手指教
- 关于JSR75开发 怎么查到 system root name。多谢
- 高手指教:jsp中出现The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs错误
- root cause com.mysql.jdbc.exceptions.MySQLSyntaxErrorException
- 使用eWebEditor 出现 msxml3.dll 异常 '80072ee2' 超时 /LM/W3SVC/519066790/Root/global.asa
- 虚拟机上安装ubuntu出现这个To run a command as administrator (user "root"), use "sudo <comm
- su - root -c 'setsid /opt/jboss-4.2.3GA/bin/run.sh &' 含义解决方法
- Access restriction:The type BASE64Decoder is not accessible .\jre\lib\rt.jar
- 关于“The type * is not accessible due to restriction on required library”有关问题的解决
- 解决mysql"Access denied for user 'root'@'IP地址'"有关问题
- 【转】关于“The type * is not accessible due to restriction on required library”有关问题的
- No such accessible method: addForwardConfig() on object错误
- Dynamic Performance Tables not accessible 有关问题
- Initializing Spring root WebApplicationContext停止启动,该如何解决
- SVN的Not authorized to open root of edit operation解决方法
- [求助]C:\Tomcat 5.5\webapps\ROOT\WEB-INF\classes
- The full stack trace of the root cause is available in the Apache Tomc ...
- 错误Unknown column 'root' in 'where clause'
- Thinkphp下面的xml_encode($data,encoding ='utf-8',root="think");函数怎么生成xml文件
- 数据库连接失败:mysql_error:Access denied for user 'root'@'localhost'解决思路
- phpnow_1.4.5-20筹建php环境,连接到数据库报错: Access denied for user 'root'@'localhost' (use
- 小弟我安装shuguang的cms到虚拟主机是时报Access denied for user 'root'@'localhost'
- phpnow_1.4.5-20筹建php环境,连接到数据库报错: Access denied for user 'root'@'localhost' (use