SAP Knowledge Base Article - Preview

3277306 - Error running SAP Commerce locally on Mac M1

Symptom

You are running ant initialize and the error below occurs:

[java] java.lang.UnsatisfiedLinkError: Can't load library: /path/to/bin/modules/sap-framework-core/sapcorejco/lib/darwinintel64/libsapjco3.jnilib
[java]     at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
[java]     at java.base/java.lang.Runtime.load0(Runtime.java:768)
[java]     at java.base/java.lang.System.load(System.java:1837)
[java]     at com.sap.conn.jco.rt.DefaultJCoRuntime.loadJCoLibrary(DefaultJCoRuntime.java:797)
[java]     at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:444)
[java]     at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:1383)
[java]     at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:934)
[java]     at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:36)
[java]     at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:236)
[java]     at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:215)
[java]     at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:99)
[java]     at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
[java]     at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:43)
[java]     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[java]     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[java]     at java.base/java.lang.Class.newInstance(Class.java:584)
[java]     at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:155)
[java]     at com.sap.conn.jco.ext.Environment.isSessionReferenceProviderRegistered(Environment.java:422)
[java]     at de.hybris.platform.sap.core.jco.runtime.SAPJCoSessionReferenceProvider.init(SAPJCoSessionReferenceProvider.java:62)
[java]     at de.hybris.platform.sap.core.jco.runtime.SAPJCoReferenceProviderLifecycle.init(SAPJCoReferenceProviderLifecycle.java:22)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1922)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1864)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
[java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
[java]     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
[java]     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
[java]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
[java]     at de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:88)
[java]     at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:166)
[java]     at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:122)
[java]     at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:101)
[java]     at de.hybris.platform.core.HybrisContextHolder.getAppCtxFactory(HybrisContextHolder.java:152)
[java]     at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:78)
[java]     at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:753)
[java]     at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:792)
[java]     at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:725)
[java]     at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:650)
[java]     at de.hybris.platform.core.Registry.activateTenant(Registry.java:711)
[java]     at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:560)
[java]     at de.hybris.platform.core.Registry.activateMasterTenantForInit(Registry.java:628)
[java]     at de.hybris.platform.util.ClientExecuter.execute(ClientExecuter.java:32)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[java]     at de.hybris.bootstrap.loader.Loader.execute(Loader.java:136)
[java]     at de.hybris.bootstrap.loader.Loader.main(Loader.java:110)
[java] de.hybris.platform.core.UninstantiableCoreApplicationContextException: Error creating Spring application context.
[java]     at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:796)
[java]     at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:725)
[java]     at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:650)
[java]     at de.hybris.platform.core.Registry.activateTenant(Registry.java:711)
[java]     at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:560)
[java]     at de.hybris.platform.core.Registry.activateMasterTenantForInit(Registry.java:628)
[java]     at de.hybris.platform.util.ClientExecuter.execute(ClientExecuter.java:32)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[java]     at de.hybris.bootstrap.loader.Loader.execute(Loader.java:136)
[java]     at de.hybris.bootstrap.loader.Loader.main(Loader.java:110)
[java] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sapCoreDefaultJCoSessionReferenceProviderLifecycle' defined in class path resource [global-sapcorejco-spring.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: Can't load library: /path/to/bin/modules/sap-framework-core/sapcorejco/lib/darwinintel64/libsapjco3.jnilib
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
[java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
[java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
[java]     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
[java]     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
[java]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
[java]     at de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:88)
[java]     at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:166)
[java]     at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:122)
[java]     at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:101)
[java]     at de.hybris.platform.core.HybrisContextHolder.getAppCtxFactory(HybrisContextHolder.java:152)
[java]     at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:78)
[java]     at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:753)
[java]     at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:792)
[java]     ... 12 more
[java] Caused by: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: Can't load library: /path/to/bin/modules/sap-framework-core/sapcorejco/lib/darwinintel64/libsapjco3.jnilib
[java]     at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:227)
[java]     at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:99)
[java]     at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
[java]     at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:43)
[java]     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[java]     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[java]     at java.base/java.lang.Class.newInstance(Class.java:584)
[java]     at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:155)
[java]     at com.sap.conn.jco.ext.Environment.isSessionReferenceProviderRegistered(Environment.java:422)
[java]     at de.hybris.platform.sap.core.jco.runtime.SAPJCoSessionReferenceProvider.init(SAPJCoSessionReferenceProvider.java:62)
[java]     at de.hybris.platform.sap.core.jco.runtime.SAPJCoReferenceProviderLifecycle.init(SAPJCoReferenceProviderLifecycle.java:22)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1922)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1864)
[java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
[java]     ... 29 more
[java] Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...


Read more...

Environment

SAP Commerce

Product

SAP Commerce all versions

Keywords

Java Connector , KBA , CEC-COM-CPS , SAP Commerce , BC-MID-CON-JCO , Java-Connector , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.