简体   繁体   English

CXF DOSGI ZOOKEEPER

[英]CXF DOSGI ZOOKEEPER

Good morning, 早上好,

I'm looking for help please.I'm only a beginner. 我正在寻找帮助。我只是一个初学者。

I am using cxf-dosgi from (DOSGi Apache Karaf Feature distribution) 我正在使用(DOSGi Apache Karaf Feature distribution)中的cxf-dosgi

I want to make transparent use of services between two remote machines. 我想透明地使用两台远程计算机之间的服务。 So I have a karaf container on each of these two machines. 所以我在这两台机器上都有一个karaf容器。


I tested this example : to start with two containers karaf hosted on the same machine then I changed the configuration to test with two containers hosted on two different remote machines. 我测试了此示例 :首先从同一台计算机上托管的两个容器karaf开始,然后更改配置,以对两台不同的远程计算机上托管的两个容器进行测试。 And it works great ! 而且效果很好!

So I want to do the same thing to export to export my web services. 所以我想做同样的事情来导出来导出我的Web服务。 I am using Spring DM. 我正在使用Spring DM。 So I do this on the server side : 所以我在服务器端这样做:

<osgi:service id="osgi-service" ref="myservice" interface="org.apache.camel.Endpoint"> <osgi:service-properties> <entry key="name" value="service"/> <entry key="service.exported.interfaces" value="*"/> </osgi:service-properties> </osgi:service>

I did the installations like in the tutorial with cxf dosgi version 1.6 But I get this error: 我在教程中使用cxf dosgi 1.6版进行了类似的安装,但出现此错误:

16:25:53,256 | ERROR | pool-21-thread-3 | w.service.RemoteServiceAdminCore  193 | 184 - cxf-dosgi-ri-dsw-cxf - 1.6.0 | failed to create server for interface org.apache.camel.Endpoint
java.lang.NullPointerException
    at java.lang.reflect.Array.newArray(Native Method)[:1.7.0_79]
    at java.lang.reflect.Array.newInstance(Array.java:70)[:1.7.0_79]
    at org.apache.cxf.aegis.type.TypeUtil.getTypeRelatedClass(TypeUtil.java:259)
    at org.apache.cxf.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:108)
    at org.apache.cxf.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:402)
    at org.apache.cxf.aegis.type.basic.BeanTypeInfo.getType(BeanTypeInfo.java:192)
    at org.apache.cxf.aegis.type.basic.BeanType.getDependencies(BeanType.java:547)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.addDependencies(AegisDatabinding.java:394)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.addDependencies(AegisDatabinding.java:399)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.addDependencies(AegisDatabinding.java:399)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:371)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:283)
    at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:242)
    at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:490)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
    at org.apache.cxf.dosgi.dsw.handlers.AbstractPojoConfigurationTypeHandler.createServerFromFactory(AbstractPojoConfigurationTypeHandler.java:191)
    at org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler.createServer(PojoConfigurationTypeHandler.java:119)
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportInterfaces(RemoteServiceAdminCore.java:184)
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:140)
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:59)
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:57)
    at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_79]
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:57)[184:cxf-dosgi-ri-dsw-cxf:1.6.0]
    at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:41)[184:cxf-dosgi-ri-dsw-cxf:1.6.0]
    at org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.exportServiceUsingRemoteServiceAdmin(TopologyManagerExport.java:185)[183:cxf-dosgi-ri-topology-manager:1.6.0]
    at org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport.doExportService(TopologyManagerExport.java:168)[183:cxf-dosgi-ri-topology-manager:1.6.0]
    at org.apache.cxf.dosgi.topologymanager.exporter.TopologyManagerExport$3.run(TopologyManagerExport.java:143)[183:cxf-dosgi-ri-topology-manager:1.6.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]

Have you an idea of what is wrong? 你有什么错的想法吗?

Ouch .. what are you doing with 1.4-SNAPSHOT. 哦,.. 1.4-SNAPSHOT在做什么。 First it is not a release and second it is quite old. 首先,它不是发行版,其次,它已经很老了。

Another thing that looks suspicious is the service.exported.interfaces=myInterface. 看起来可疑的另一件事是service.exported.interfaces = myInterface。 It should be a fully qualified java interface name. 它应该是标准Java接口名称。 For the start try service.exported.interfaces=* for it. 首先,尝试使用service.exported.interfaces = *。

You should start with my CXF DOSGi tutorial . 您应该从我的CXF DOSGi教程开始 The code there should work out of the box. 那里的代码应该开箱即用。 You can then add your changes in the config. 然后,您可以将更改添加到配置中。 So it is easier than to start completely new. 因此,这比开始全新的过程容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM