Menu

#490 Unhandled exception

V3.4
open
nobody
None
1
2023-09-27
2022-02-01
No

OpenSong does not open (on a Win 10 machine) and comes up with error-

NilObjectException:
OpenSong v3.4.8 (1457).1457 Build date: 2021-06-01 17:08:57 Windows

Stacktrace:
BibleFactory.BuildKnownBibles
BibleFactory.AddSearchFolder%%o<folderitem>
App.Event_Open%%o<app>
Application._CallFunctionWithExceptionHandling%%o<application>p
REALbasic._RunFrameworkInitialization%%p
_Main
main</application></app></folderitem>

I tried reinstalling but it still gives the same error. I had no issues with the software till now. Any suggestions?
Thanks
J

Related

Support Requests: #359

Discussion

  • SvA

    SvA - 2022-02-14

    This error is likely cause by OpenSong being unable to create the folder Scripture in it's document folder, or to read from that folder.
    Please make sure you have permission to create files and folders within OpenSong's document folder. Please also make sure there is no other filesystem object named Scripture in OpenSong's Document folder, other than a folder.
    I will add code to handle this condition more gracefully.

     
  • Anonymous

    Anonymous - 2022-05-10

    HI, same problem as above.
    see attachment. there is a folder that says Scripture.
    please help.

     
  • SvA

    SvA - 2022-05-11

    Hi,
    Your screenshot shows the installation path. This contains the folder "OpenSong Scripture", where the default KJV bible module, that comes with OpenSong, is installed to.
    However, the issue is with a folder named "Scripture" (without OpenSong prepended) in OpenSong's document folder. That's where folders for Backgrounds, Songs, and Sets are located, not the ones containing the defaults, but the ones containing your own materials. This folder is by default located in your personal "My Documents" folder, and is named "OpenSong". It could be moved anywhere, though. If in doubt, open "%appdata%\OpenSong\preferences.plist" in Editor, search for <key>documents_folder and look for <key>path below that. The next line should read <string>file:/// followed by your OpenSong document folder name.

    And remember, the most likely cause of this error is that OpenSong is unable to create or access that folder.

     
  • Anonymous

    Anonymous - 2023-01-06

    **OpenSong doesnt work on my mac. I always have the same error message even if i tried to re-install it **

    NilObjectException:
    OpenSong v3.4.8 (1457).1457 Build date: 2021-06-01 17:08:20 macOS

    Stacktrace:
    RuntimeRaiseException
    RaiseNilObjectException
    BibleFactory.BuildKnownBibles
    BibleFactory.AddSearchFolder%%o<folderitem>
    App.Event_Open%%o<app>
    _Z29CocoaFinishApplicationStartupv
    _Z27PluginGetCocoaViewCallbacksv
    CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
    ___CFXRegistrationPost_block_invoke
    _CFXRegistrationPost
    _CFXNotificationPost
    -[NSNotificationCenter postNotificationName:object:userInfo:]
    -[NSApplication _postDidFinishNotification]
    -[NSApplication _sendFinishLaunchingNotification]
    _DPSNextEvent
    -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
    _Z29CocoaFinishApplicationStartupv
    _Z29CocoaFinishApplicationStartupv
    Application._CallFunctionWithExceptionHandling%%o<application>p
    _Z33CallFunctionWithExceptionHandlingPFvvE
    _Z29CocoaFinishApplicationStartupv
    -[NSApplication run]
    RuntimeRun
    REALbasic._RuntimeRun
    _Main
    main</application></app></folderitem>

    This is what i have in the file preferences.plist :
    ?xml version="1.0" encoding="UTF-8"?>

    <plist version="1.0">
    <dict>
    <key>version</key>
    <string>1</string>
    <key>log</key>
    <dict>
    <key>level</key>
    <dict>
    <key>value</key>
    <real>3</real>
    </dict>
    <key>file</key>
    <dict>
    <key>console</key>
    <true>
    </true></dict>
    </dict>
    <key>language</key>
    <dict>
    <key>value</key>
    <string></string>
    </dict>
    <key>documents_folder</key>
    <dict>
    <key>UseOldFolderDB</key>
    <dict>
    <key>value</key>
    <false>
    </false></dict>
    </dict>
    <key>saved_state</key>
    <dict>
    <key>last_scripture</key>
    <dict>
    <key>version</key>
    <string>KJV</string>
    <key>verse_per_slide</key>
    <real>2</real>
    </dict>
    </dict>
    </dict>
    </plist>

    PLEASE COULD YOU HELP ME ?
    
     
    • Anonymous

      Anonymous - 2023-09-26

      Please, can you tell me where the preferents.plist file is located in mac ?

       
      • Ed Palmer

        Ed Palmer - 2023-09-26

        /Users/<yourusername>/Library/Application Support/org.opensong.opensong. It is called org.opensong.opensong.plist. Since Library is a hidden folder, you have to use Finder's Go>Go to Folder (Command-Shift-G) and type the path.

         
        • Anonymous

          Anonymous - 2023-09-27

          Thank you so much, I've check and I don't have that folder in my computer. I'm using OpenSong v3.4.8. I've have the same issue and I don't know how to fix it, I wanted to reset the preferences files, but I can't found it.

           
  • SvA

    SvA - 2023-01-06

    Hi. I believe you are having the same issue and doing the same thing wrong as the original creator of this thread. The only difference being that he was on a windows system and you are on a Mac.

    According to the preferences.plist, OpenSong will ask you to choose your document folder when you start it. After this, I assume, you get the NilObjectException as reposted. Is this correct? or do you get the NilObjectException before any interaction with the program?

    You must choose a folder where you have full rights to crate folders and to manipulate files (create, modify, delete). Do not choose a folder that resides beside the executable (likely within the bundle. That will not work. Also, as said above, there must be no file or other object other than a writeable folder named Scripture within the folder you choose as your OpenSong document folder.

    If all fails, delete the preferences.plist file. Then, when asked to choose a document folder, create a new one.

     
    • Ed Palmer

      Ed Palmer - 2023-01-07

      SvA is correct. If OpenSong cannot create the folders in the parent folder that you select, this type of error will occur.

      By default on macOS, OpenSong will suggest your Documents folder as the place to store the OpenSong files (though Documents/OpenSong would actually be a better place). Using the open dialog in OpenSong should give OpenSong the permission to write within Documents. That may not be happening on your system for some reason.

      When OpenSong starts and you get the dialog to select the folder, you could try to set the folder to ~/Library/Application Support/org.opensong.opensong. As I understand it, macOS guarantees that this will be a writeable location for the application. To get to this folder, you will need to use the shortcut Cmd+Shift+G to bring up the field where you can type in a folder name. Enter ~/Library/Application Support/ and press Enter. Then create org.opensong.opensong if it does not exist, or select it if it does exist.

      @SvA: Do you know if the latest rev BibleFactory.BuildKnownBibles protects against this NilObjectException? If it does not, I will add some additional guard code so we can prevent this crash in the next release.

       
      • SvA

        SvA - 2023-01-08

        Hi Ed, this issue should be fixed with revision 1511.

        The error was only indirectly caused by <OpenSong Documents>\Scripture missing and OpenSong not being able to create the folder. So, the error is fixed by BibleFactory not assuming this folder is indeed a scripture folder.

        What is not addressed is all kind of problems that might arise from a writeprotected <OpenSong Document> folder.

        On Windows, selecting a document folder for OpenSong always has been confusing, because there is no dialog that makes clear what you get in the end. Therefore I created a dialog that works like selecting a non-standard installation folder for an application in an installer. Would you please check this new dialog on Mac OS and adjust it to what a Mac user would expect. The main problem here is providing a default and letting the user know whether a folder with the default name will be created within the folder selected, or if the selected folder itself will be used. Also, what happens if you navigate away from the location the dialog first opened to. Will you have to provide the default name yourself, or is it preserved?
        Finally, the default dialog provided by Xojo works great, provided the App using it has never been run before. After that, on Windows, you are unable to provide defaults. Instead Windows replaces the given defaults with the folder last used by the app (which might be, for example, the custom backgrounds folder you selected). See XoJo Issue #69014
        This change is Revision 1514.

         

        Last edit: SvA 2023-01-08
        • Ed Palmer

          Ed Palmer - 2023-01-08

          Thanks for confirming that you addressed this issue. I thought you had worked on BibleFactory recently. I scanned the recent commits and did not go back far enough.

          I agree with the confusion we have with the documents folder selection. I believe it might be good to indicate to the user if we create an OpenSong Documents in the selected folder. This may require an additional dialog box prior to showing the SelectFolder dialog since we have limited control over customizing it. What do you think is the correct way? Do we create an folder automatically or assume the user wants all four of the OpenSong folders in the folder selected? I am concerned that creating a folder named OpenSong Documents may not be friendly for non-English-speaking users. As a monoglot American, I do not have the point of view necessary to decide this internationalization issue.

          On macOS we have a similar issue to Windows with the last folder being "sticky" when the dialog is next used. I will investigate if we need to make additional adjustments for macOS.

           

Anonymous
Anonymous

Add attachments
Cancel