After upgrade to leopard: "principalClass is nil" while loading preferencesPane

  • Hello,

    I have a preferencesPane that ran just fine on Tiger.
    On Leopard is does not load anymore, the Console says:

    14.11.07 08:57:24 System Preferences[3593] Error loading /Library/
    PreferencePanes/DICOMListener.prefPane/Contents/MacOS/DICOMListener:
    dlopen(/Library/PreferencePanes/DICOMListener.prefPane/Contents/MacOS/
    DICOMListener, 265): Symbol not found: _environ
      Referenced from: /Library/PreferencePanes/DICOMListener.prefPane/
    Contents/MacOS/DICOMListener
      Expected in: dynamic lookup
      14.11.07 08:57:24 System Preferences[3593] [NSPrefPaneBundle
    instantiatePrefPaneObject] (/Library/PreferencePanes/
    DICOMListener.prefPane): principalClass is nil.

    This is the plist file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
    ">
    <plist version="1.0">
    <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>DICOMListener</string>
    <key>CFBundleHelpBookFolder</key>
    <string>DICOMListener Help</string>
    <key>CFBundleHelpBookName</key>
    <string>DICOMListener Help</string>
    <key>CFBundleIconFile</key>
    <string>DICOMListener</string>
    <key>CFBundleIdentifier</key>
    <string>com.crispyprojects.DICOMListener</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>DICOMListener</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>0.3</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>0.3</string>
    <key>NSMainNibFile</key>
    <string>storeSCP_controllerPref</string>
    <key>NSPrefPaneIconFile</key>
    <string>DICOMListener.icns</string>
    <key>NSPrefPaneIconLabel</key>
    <string>DICOMListener</string>
    <key>NSPrincipalClass</key>
    <string>storeSCP_controllerPref</string>
    </dict>
    </plist>

    I tried to recompile using the new XCode tools, but no luck...

    Does anynoe have a hint for me?

    Thank you!

    Best regards,

    Stephan
  • You are directly referencing environ, which you can't do from a
    loadable bundle. I am surprised this worked on Tiger - I'd wager it
    didn't actually. You might have been hacking around it with
    bundle_loader or something.

    You can get a pointer to environ from _NSGetEnviron in crt_externs.h

    -- Finlay

    On 14/11/2007, Stephan Ruggiero
    <stephan.ruggiero...> wrote:
    > Hello,
    >
    > I have a preferencesPane that ran just fine on Tiger.
    > On Leopard is does not load anymore, the Console says:
    >
    > 14.11.07 08:57:24 System Preferences[3593] Error loading /Library/
    > PreferencePanes/DICOMListener.prefPane/Contents/MacOS/DICOMListener:
    > dlopen(/Library/PreferencePanes/DICOMListener.prefPane/Contents/MacOS/
    > DICOMListener, 265): Symbol not found: _environ
    > Referenced from: /Library/PreferencePanes/DICOMListener.prefPane/
    > Contents/MacOS/DICOMListener
    > Expected in: dynamic lookup
    > 14.11.07 08:57:24 System Preferences[3593] [NSPrefPaneBundle
    > instantiatePrefPaneObject] (/Library/PreferencePanes/
    > DICOMListener.prefPane): principalClass is nil.
    >
    > This is the plist file:
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    > "http://www.apple.com/DTDs/PropertyList-1.0.dtd
    > ">
    > <plist version="1.0">
    > <dict>
    > <key>CFBundleDevelopmentRegion</key>
    > <string>English</string>
    > <key>CFBundleExecutable</key>
    > <string>DICOMListener</string>
    > <key>CFBundleHelpBookFolder</key>
    > <string>DICOMListener Help</string>
    > <key>CFBundleHelpBookName</key>
    > <string>DICOMListener Help</string>
    > <key>CFBundleIconFile</key>
    > <string>DICOMListener</string>
    > <key>CFBundleIdentifier</key>
    > <string>com.crispyprojects.DICOMListener</string>
    > <key>CFBundleInfoDictionaryVersion</key>
    > <string>6.0</string>
    > <key>CFBundleName</key>
    > <string>DICOMListener</string>
    > <key>CFBundlePackageType</key>
    > <string>BNDL</string>
    > <key>CFBundleShortVersionString</key>
    > <string>0.3</string>
    > <key>CFBundleSignature</key>
    > <string>????</string>
    > <key>CFBundleVersion</key>
    > <string>0.3</string>
    > <key>NSMainNibFile</key>
    > <string>storeSCP_controllerPref</string>
    > <key>NSPrefPaneIconFile</key>
    > <string>DICOMListener.icns</string>
    > <key>NSPrefPaneIconLabel</key>
    > <string>DICOMListener</string>
    > <key>NSPrincipalClass</key>
    > <string>storeSCP_controllerPref</string>
    > </dict>
    > </plist>
    >
    >
    > I tried to recompile using the new XCode tools, but no luck...
    >
    > Does anynoe have a hint for me?
    >
    > Thank you!
    >
    > Best regards,
    >
    > Stephan
    >
  • Am 14.11.2007 um 09:55 schrieb Stephan Ruggiero:
    > 14.11.07 08:57:24 System Preferences[3593] Error loading /Library/
    > PreferencePanes/DICOMListener.prefPane/Contents/MacOS/
    > DICOMListener:  dlopen(/Library/PreferencePanes/
    > DICOMListener.prefPane/Contents/MacOS/DICOMListener, 265): Symbol
    > not found: _environ
    > Referenced from: /Library/PreferencePanes/DICOMListener.prefPane/
    > Contents/MacOS/DICOMListener
    > Expected in: dynamic lookup
    > 14.11.07 08:57:24 System Preferences[3593] [NSPrefPaneBundle
    > instantiatePrefPaneObject] (/Library/PreferencePanes/
    > DICOMListener.prefPane): principalClass is nil.

      Why go with the second error if there's an error before that? Are
    you calling a function or accessing a global named "environ"? I guess
    it can't resolve that symbol, so it can't load your principal class,
    and that is why it says "principalClass is nil".

    Cheers,
    -- M. Uli Kusterer
    "The Witnesses of TeachText are everywhere..."
    http://www.zathras.de
  • On Nov 14, 2007, at 3:55 AM, Stephan Ruggiero wrote:

    > I have a preferencesPane that ran just fine on Tiger.
    > On Leopard is does not load anymore, the Console says:
    >
    > 14.11.07 08:57:24 System Preferences[3593] Error loading /Library/
    > PreferencePanes/DICOMListener.prefPane/Contents/MacOS/
    > DICOMListener:  dlopen(/Library/PreferencePanes/
    > DICOMListener.prefPane/Contents/MacOS/DICOMListener, 265): Symbol
    > not found: _environ
    > Referenced from: /Library/PreferencePanes/DICOMListener.prefPane/
    > Contents/MacOS/DICOMListener
    > Expected in: dynamic lookup
    > 14.11.07 08:57:24 System Preferences[3593] [NSPrefPaneBundle
    > instantiatePrefPaneObject] (/Library/PreferencePanes/
    > DICOMListener.prefPane): principalClass is nil.

    Is the principal class name listed in your plist actually correct?  I
    had an incorrect entry in my plist but on Tiger and prior -[NSBundle
    principalClass] still returned the correct class.  On Leopard it
    started returning a different class from the bundle.

    -Frank

    ------------------------------------
    Frank M. Midgley
    <knarf...>
    http://homepage.mac.com/knarf/
    Sterling, VA USA
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today