Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NullPointerException when calling the EOModel.createPrototypeCache method from the wrong EOModel (take 2) #958

Merged

Commits on Oct 8, 2021

  1. Fix NullPointerException when calling the EOModel.createPrototypeCach…

    …e method from the wrong EOModel (take 2)
    
    This error was first reported and fixed by the PR wocommunity#551. One reason for this kind of error is the presence of duplicate `NSBundles` in the classpath. The previous fix prevented EOModels from the same `NSBundle` from being loaded twice.
    
    There's another scenario, though, where the same issue may arise. If two distinct `NSBundle`s have the same EOModel, the application may not initialize properly, throwing the exception below:
    
    ```
    java.lang.NullPointerException
    	at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
    	at com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
    	at com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:290)
    	at com.webobjects.eoaccess.EOAttribute.<init>(EOAttribute.java:998)
    ```
    
    This fix prevents EOModels with the same name from being loaded twice.
    hprange committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    32d6da6 View commit details
    Browse the repository at this point in the history