我们正在实施一个使用WSO2 DSS的解决方案。 我们不想摆脱它,因为我们组织中的许多参与者都使用其暴露的界面。 我们计划迁移到Cassandra或DynamoDB,所有这些都部署在AWS上。 我们正面临阻塞问题,因为我们能够连接。 我们被迫使用亚马逊SDK,我们必须使用比v.2更新的joda-time库版本 当我们尝试检索项目时,我们有下一个例外。
java.lang.NoSuchMethodError: org.joda.time.format.DateTimeFormatter.withZoneUTC()Lorg/joda/time/format/DateTimeFormatter
所以我们猜测它是因为WSO2使用了这个库的不同版本。
WSO2 v.3.2.1
joda-time v.2.8.1
感谢。
答案 0 :(得分:0)
我遇到了同样的问题,但我已经完成了一些测试,我认为它并不是一个真正的joda-time库问题。
我已经编译了一个包含所有依赖项的已组装jar,并且至少运行一次。
在 pom.xml 文件配置中:
<build>
<plugins>
...
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
用以下内容编译jar:
mvn assembly:assembly
我在 $ WSO_INSTALATION_DIR / repository / components / lib 上复制了jar并启动了wso2服务器,它可以工作!
但现在我在更改数据源代码时遇到问题并重新部署。
如果我再次复制lib上的.jar,我没有对数据源代码的最后更改,如果我从 lib / 和 dropin中删除了jar / 文件夹我收到以下错误:
java.lang.ClassCastException: org.wso2.dss.connectors.dynamodb.DynamoDBDataSource cannot be cast to org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS
at org.wso2.carbon.dataservices.core.description.config.InlineCustomQueryBasedDSConfig.<init>(InlineCustomQueryBasedDSConfig.java:66)
at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.getCustomQueryConfig(ConfigFactory.java:143)
at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.createConfig(ConfigFactory.java:73)
at org.wso2.carbon.dataservices.core.DataServiceFactory.createDataService(DataServiceFactory.java:137)
at org.wso2.carbon.dataservices.core.DBDeployer.createDBService(DBDeployer.java:764)
at org.wso2.carbon.dataservices.core.DBDeployer.processService(DBDeployer.java:1127)
at org.wso2.carbon.dataservices.core.DBDeployer.deploy(DBDeployer.java:178)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135)
at org.wso2.carbon.core.CarbonAxisConfigurator.loadServices(CarbonAxisConfigurator.java:464)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:65)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:398)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.wso2.dss.connectors.dynamodb.DynamoDBDataSource cannot be cast to org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS
at org.wso2.carbon.dataservices.core.description.config.InlineCustomQueryBasedDSConfig.<init>(InlineCustomQueryBasedDSConfig.java:48)
... 54 more
我希望这个提示可以帮助解决这个问题,我会继续尝试找到一个完整的解决方案。
编辑:我发现如果你复制 lib 目录下的两个jar,组装好的jar和没有依赖jar,它就可以了。