受这篇博文的启发,我尝试在经典的 SAP Neo SCP 上为我们现有的应用程序实现多租户。
我添加了依赖项
<dependency>
<groupId>com.sap.cloud.s4hana.cloudplatform</groupId>
<artifactId>tenant-scp-neo</artifactId>
<version>1.9.5</version>
</dependency>
到我的 POM 并通过测试程序访问租户
String tenantId = TenantAccessor.getCurrentTenant().getTenantId();
然后,我得到了这个错误
java.lang.NoClassDefFoundError: com/google/common/collect/Multiset
at com.sap.cloud.sdk.cloudplatform.monitoring.ExceptionMonitor.<init>(ExceptionMonitor.java:30) ~[core-1.9.5.jar:na]
at com.sap.cloud.sdk.cloudplatform.monitoring.ExceptionMonitor.<clinit>(ExceptionMonitor.java:28) ~[core-1.9.5.jar:na]
at com.sap.cloud.sdk.cloudplatform.logging.CloudLoggerFactory$CloudLogger.<init>(CloudLoggerFactory.java:67) ~[core-1.9.5.jar:na]
at com.sap.cloud.sdk.cloudplatform.logging.CloudLoggerFactory$CloudLogger.<init>(CloudLoggerFactory.java:47) ~[core-1.9.5.jar:na]
at com.sap.cloud.sdk.cloudplatform.logging.CloudLoggerFactory.getLogger(CloudLoggerFactory.java:19) ~[core-1.9.5.jar:na]
at com.sap.cloud.sdk.cloudplatform.tenant.ScpNeoTenantFacade.<clinit>(ScpNeoTenantFacade.java:21) ~[tenant-scp-neo-1.9.5.jar:na]
我该如何解决这个问题?