Copy link to clipboard
I am taking over a codebase from another developer. The codebase is written using FW/1 4.3 and curently runs on Windows Server 2016 with ACF 2016. The current hosting account belongs to the developer, and will be shut down at the end of the year.
I am testing setting up the clients site on a new install of the server and ACF version that they offer when opening a new hosting account, which are Windows Server 2022 and ACF 2021.
I have setup the site in IIS and configured CF. A test site with a fresh install of FW/1 runs smoothly, but when I setup a site with the clients codebase in it I get this error:
Exception occured before FW/1 was initialized Exception in onError cannot simultaneously fetch multiple bags (org.hibernate.loader.MultipleBagFetchException)
followed by this error:
Unable to create requested service [org.hibernate.engine.spi.CacheImplementor] (org.hibernate.service.spi.ServiceException) Error message: net.sf.ehcache.CacheException: Another CacheManager with same name '_ORM_dsports_dsports' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: URLConfigurationSource [url=file:/C:/websites/dsports.com/ehcache-config_ORM_dsports_dsports.xml]
What I have tried so far:
1. I have no idea where to even start trying to troubleshoot the multiple bags issue. All I have found online is related to Java code directly. I am thinking that somewhere in the models folder, there is a relation that is causing the issue, but I have not idea where to even look, as the error occurs before the framework is even initialized, so placing dumps is not working.
2. I have modified the onError method in the one.cfc, to shutdown the cachemanager if one already exists, (per the suggestion in the message), this has not fixed the issue as it still persists.
I also setup a fresh VM with Windows Server 2016 and ACF 2016, and the site works fine.
I have been trying to figure this out for several days now, and I am just hitting wall after wall. Any advice would be helpful. Thanks.
Copy link to clipboard
The cause of at least one problem is clear. Your application has more than one cache-manager. There should only be one.
The error message gives you two clues:
Another CacheManager with same name '_ORM_dsports_dsports' already exists in the same VM
Second, ColdFusion is making use of the configuration file
Have you configured this file in the ORMSettings in Application.cfc? If so, it just might be that ColdFusion is using settings from the file on top of its own Hibernate settings.
What happens when you test by commenting out any settings that involve the file C:/websites/dsports.com/ehcache-config_ORM_dsports_dsports.xml ?