×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    19

    FileConnection ConnectionNotFoundException

    Hi,
    we are implementing audio recording concept in our application. In that first create a file using fileconnection like

    conn = (FileConnection)Connector.open("file:///"+test.amr,Connector.READ_WRITE);

    While run the program its giving following exception:

    javax.microedition.io.ConnectionNotFoundException: Only absolute file URL's of type <drive>path> are supported

    Any idea about this exception, and anybody can tell me how to create a file in the nokia device?

    Thanks
    Mindus

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: FileConnection ConnectionNotFoundException

    are you getting this error on device or simulator
    Regards,
    Saurabh

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    19

    Re: FileConnection ConnectionNotFoundException

    Hi
    I am getting this error on emulator (Nokia 6212)

    Any idea about this issue?


    Thanks
    Mindus

  4. #4
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: FileConnection ConnectionNotFoundException

    Actually the file system of nokia emulator support drives which you are not specifying in your code if you try ur code in default simulator of wtk it will run what you have to do is

    1........Enumerate drives in filsystem from here

    Result obtained from above is further used to create a dynamic path and then used in file connection url
    Regards,
    Saurabh

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    19

    Re: FileConnection ConnectionNotFoundException

    Hi
    thanks for your reply. I think i will get output like SDCard or MemoryCard etc. So can i
    create a path like file:///MemoryCard/test.amr

    please reply what to do


    thanks
    mindus

  6. #6
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: FileConnection ConnectionNotFoundException

    Quote Originally Posted by mindus View Post
    Hi
    thanks for your reply. I think i will get output like SDCard or MemoryCard etc. So can i
    create a path like file:///MemoryCard/test.amr

    please reply what to do


    thanks
    mindus
    I never tried on nokia simulator but on default simulators that netbeans provide however I do code the same way and dat works fine on nokia devices

    WHy dont you try to print the output of the above scenario I told you and then hardcode teh path but literally I dont suggest hardcoding the path of your main code its for just testing purpose
    Regards,
    Saurabh

  7. #7
    Registered User
    Join Date
    Jan 2010
    Posts
    19

    Re: FileConnection ConnectionNotFoundException

    I tried that logic

    Enumeration drivesEnum = FileSystemRegistry.listRoots();
    while (drivesEnum.hasMoreElements()) {
    String drives = (String)drivesEnum.nextElement();
    System.out.println("All Drives --->" + drives);

    I am getting following output:

    All Drives ---> C:/

    And i am tried to execute the program file:///C:/test.amr

    Now i am getting java.lang.SecurityException: Access denied Error.


    Thanks
    Minuds

  8. #8
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: FileConnection ConnectionNotFoundException

    dont write in drive directly like this file:///c:/test.amr
    but use some folder file:///c:/test/test.amr
    Regards,
    Saurabh

  9. #9
    Registered User
    Join Date
    Jan 2010
    Posts
    19

    Re: FileConnection ConnectionNotFoundException

    Its not working. Same exception occured.

    Its is need to give any permission on Jad file;

    MIDlet-Permissions:

    Which class to add in permissions



    Thanks
    Mindus

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: FileConnection ConnectionNotFoundException

    You cannot give yourself permission. You can only write files in certain folders. Try this example.

    Graham.

Similar Threads

  1. FileConnection & Motorola V195
    By arnaultp in forum Mobile Java General
    Replies: 3
    Last Post: 2008-07-08, 16:52
  2. FileConnection for files inside jar
    By ben-efiz in forum Mobile Java General
    Replies: 1
    Last Post: 2008-03-13, 22:36
  3. Need help to find out the error in FileConnection!
    By katy2 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-04-02, 08:05
  4. (FileConnection) Share apps between 6600 and 6630
    By matteopiccioni in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-06-21, 21:59
  5. Java FileConnection Optional Package 1.0 (JSR 75)
    By thecrowi in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-24, 08:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×