【发布时间】:2014-08-14 18:49:49
【问题描述】:
我有一个使用 OSGI(在 Karaf 中运行)设置的 REST 服务。
<jaxrs:server address="http://localhost:9001/rest" id="myFileService" >
<jaxrs:serviceBeans>
<ref component-id="FileServicesImpl" />
</jaxrs:serviceBeans>
</jaxrs:server>
当我浏览到http://localhost:8181/cxf 时,如果列出了我的服务,我可以成功连接到http://localhost:9001/rest 上的服务。如果我去http://MyMachineName:8181/cxf,我会得到服务列表,但如果我去http://MyMachineName:9001/rest,则找不到地址。
不管怎样,当我使用 MyMachineName 浏览到 /cxf 链接时,它仍然将端点列为 localhost。
有没有办法在蓝图配置中配置端点地址,以便它同时响应 localhost 和机器名称?或者只是特定的端口?还是我必须对机器名称进行硬编码或将其合并到配置文件中并将其强制为机器名称?
【问题讨论】:
标签: java osgi jax-rs blueprint-osgi