I am in the process of upgrading our SAP Commerce platform to JDK 21 with Spring 6.
After fixing all compilation errors,
we have used <dependency><br><groupId>org.apache.commons</groupId><br><artifactId>commons-configuration2</artifactId><br><version>2.12.0</version><br></dependency></p><p> </p><p> </p><p>but getting below error:</p><p> </p><p>
Exception sending context initialized event to listener instance of class [de.hybris.platform.spring.HybrisContextLoaderListener]<br>java.lang.NoClassDefFoundError: org/apache/commons/configuration/AbstractConfiguration<br> at java.base/java.lang.Class.forName0(Native Method)<br> at java.base/java.lang.Class.forName(Class.java:423)<br> at java.base/java.lang.Class.forName(Class.java:414)<br> at io.ecx.mondi.core.annotation.processors.BeanAliasPostProcessor.processDefinition(BeanAliasPostProcessor.java:49)<br> at io.ecx.mondi.core.annotation.processors.BeanAliasPostProcessor.postProcessBeanDefinitionRegistry(BeanAliasPostProcessor.java:36)<br> at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)<br> at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:148)<br> at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791)<br> at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:609)<br> at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplic
Request clarification before answering.
Please check if somehow this may help you:
The error indicates that your application code or dependencies are still referencing classes from the legacy commons-configuration (version 1.x) package structure, specifically org.apache.commons.configuration.AbstractConfiguration. However, you've upgraded to commons-configuration2 (version 2.x), which uses a different package structure: org.apache.commons.configuration2.* [1].
org.apache.commons.configuration.*org.apache.commons.configuration2.*BeanAliasPostProcessor) is still referencing the old package structureVerify Current Dependencies
1# Check dependency tree for conflicting versions
2./gradlew dependencies | grep -i configuration
3# or for Maven
4mvn dependency:tree | grep -i configurationLook for any remaining commons-configuration:commons-configuration:1.x dependencies.
Update Dependency Configuration Replace your current dependency with the correct configuration:
1
2 org.apache.commons
3 commons-configuration2
4 2.12.0
5
6
7
8
9 commons-configuration
10 commons-configuration
11
12Update Custom Code Modify your BeanAliasPostProcessor.java and any other custom code:
1// Change from:
2import org.apache.commons.configuration.AbstractConfiguration;
3
4// To:
5import org.apache.commons.configuration2.AbstractConfiguration;Clean and Rebuild
1# For SAP Commerce
2ant clean all
3
4# Clear any cached dependencies
5rm -rf ~/.m2/repository/org/apache/commons/commons-configuration*
6rm -rf ~/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-configuration*Add explicit exclusions to prevent transitive dependencies from pulling in the old version:
1
2 your-dependency-group
3 your-dependency-artifact
4 your-version
5
6
7 commons-configuration
8 commons-configuration
9
10
11Leverage SAP's OpenRewrite recipes for automated code migration [2]:
1# Download sap-commerce-framework-update-recipes-1.1.3.jar
2./gradlew rewriteRun \
3 --init-script=init.gradle \
4 -PcommerceUpdatePaths="../custom/your-extension" \
5 -Drewrite.activeRecipe=com.sap.cx.rewrite.java.SelectiveCommerceCloudFrameworkUpdateorg.apache.commons.configuration2.*Would you like me to help you identify which specific dependencies in your project might be pulling in the legacy commons-configuration version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i am getitng error like : SEVERE: Exception sending context initialized event to listener instance of class [io.ecx.mondi.loginportal.filters.HybrisStorefrontContextLoaderListener] INFO | jvm 1 | main | 2025/12/29 14:45:59.372 | java.lang.NoClassDefFoundError: org/apache/commons/configuration/AbstractConfiguration INFO | jvm 1 | main | 2025/12/29 14:45:59.372 | at java.base/java.lang.Class.forName0(Native Method) INFO | jvm 1 | main | 2025/12/29 14:45:59.372 | at java.base/java.lang.Class.forName(Class.java:423) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at java.base/java.lang.Class.forName(Class.java:414) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at de.hybris.platform.spring.LazyInitOverrideBeanFactoryPostProcessor.forName(LazyInitOverrideBeanFactoryPostProcessor.java:82) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at java.base/java.util.Optional.map(Optional.java:260) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at de.hybris.platform.spring.LazyInitOverrideBeanFactoryPostProcessor.postProcessBeanFactory(LazyInitOverrideBeanFactoryPostProcessor.java:51) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:363) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:204) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791) INFO | jvm 1 | main | 2025/12/29 14:45:59.373 | at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:609) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:41002) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:42008) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:88) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.HybrisContextFactory$ApplicationContextFactory.build(HybrisContextFactory.java:256) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:78) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:815) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:856) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:781) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:658) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.Registry.activateTenant(Registry.java:719) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:568) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:627) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.Registry.startup(Registry.java:441) INFO | jvm 1 | main | 2025/12/29 14:45:59.374 | at de.hybris.platform.core.ClassLoaderUtils.executeWithWebClassLoaderParentIfNeeded(ClassLoaderUtils.java:35) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at de.hybris.platform.spring.HybrisContextLoaderListener.startRegistry(HybrisContextLoaderListener.java:353) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:213) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:200) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:126) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitializedInternal(HybrisContextLoaderListener.java:97) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:92) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4046) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4474) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) INFO | jvm 1 | main | 2025/12/29 14:45:59.375 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | at java.base/java.lang.Thread.run(Thread.java:1583) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | Caused by: java.lang.ClassNotFoundException: Could not find class: org.apache.commons.configuration.AbstractConfiguration INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | at de.hybris.bootstrap.loader.PlatformInPlaceClassLoader.loadClass(PlatformInPlaceClassLoader.java:148) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | ... 41 more INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | Dec 29, 2025 2:45:59 PM org.apache.catalina.core.StandardContext startInternal INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | Dec 29, 2025 2:45:59 PM org.apache.catalina.core.StandardContext startInternal INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | SEVERE: Context [] startup failed due to previous errors INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | Dec 29, 2025 2:45:59 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesRmiTargets INFO | jvm 1 | main | 2025/12/29 14:45:59.376 | WARNING: You need to add "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" to the JVM command line arguments to enable RMI Target memory leak detection. Alternatively, you can suppress this warning by disabling RMI Target memory leak detection. INFO | jvm 1 | main | 2025/12/29 14:45:59.418 | Dec 29, 2025 2:45:59 PM org.apache.coyote.AbstractProtocol start INFO | jvm 1 | main | 2025/12/29 14:45:59.418 | INFO: Starting ProtocolHandler ["http-nio-9001"] INFO | jvm 1 | main | 2025/12/29 14:45:59.433 | Dec 29, 2025 2:45:59 PM org.apache.coyote.AbstractProtocol start INFO | jvm 1 | main | 2025/12/29 14:45:59.433 | INFO: Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"] INFO | jvm 1 | main | 2025/12/29 14:45:59.449 | Dec 29, 2025 2:45:59 PM org.apache.catalina.startup.Catalina start INFO | jvm 1 | main | 2025/12/29 14:45:59.449 | INFO: Server startup in [900945] milliseconds INFO | jvm 1 | main | 2025/12/29 22:27:43.723 | Dec 29, 2025 10:27:43 PM com.microsoft.sqlserver.jdbc.SQLServerConnection prelogin INFO | jvm 1 | main | 2025/12/29 22:27:43.729 | WARNING: ConnectionID:716 ClientConnectionId: d6b2cd20-300c-43ba-818a-c911e160c249 Prelogin error: host 193.228.88.17 port 1433 Unexpected end of prelogin response after 0 bytes read INFO | jvm 1 | main | 2025/12/29 22:27:53.764 | Dec 29, 2025 10:27:53 PM com.microsoft.sqlserver.jdbc.SQLServerConnection prelogin INFO | jvm 1 | main | 2025/12/29 22:27:53.764 | WARNING: ConnectionID:717 ClientConnectionId: 8992ebc2-22fb-4580-bf82-8bbf38e3b58a Prelogin error: host 193.228.88.17 port 1433 Unexpected end of prelogin response after 0 bytes read INFO | jvm 1 | main | 2025/12/29 22:28:03.835 | Dec 29, 2025 10:28:03 PM com.microsoft.sqlserver.jdbc.SQLServerConnection prelogin INFO | jvm 1 | main | 2025/12/29 22:28:03.835 | WARNING: ConnectionID:718 ClientConnectionId: 70e7538f-933a-46ae-b7b9-50b3a401f088 Prelogin error: host 193.228.88.17 port 1433 Unexpected end of prelogin response after 0 bytes read INFO | jvm 1 | main | 2025/12/29 22:28:13.889 | Dec 29, 2025 10:28:13
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.