|
|
Re: ECF Generic server is connecting to the wrong host [message #1002604 is a reply to message #1002525] |
Fri, 18 January 2013 23:20 |
Greg Babcock Messages: 41 Registered: October 2012 |
Member |
|
|
The snippet I posted was for the client. Here is the server code.
Dictionary<String, String> dict = new Hashtable<String, String>();
// add OSGi service property indicated export of all interfaces exposed
// by service (wildcard)
dict.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES, IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
// add OSGi service property specifying config
dict.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS, CONTAINER_TYPE);
// add ECF service property specifying container factory args
dict.put(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS, "ecftcp://localhost:3787/server");
try {
bundleContext.registerService(new String[] {
ConfigurationUtil.class.getName(), EMailUtil.class.getName(), ServiceUtil.class.getName(),
RemoteConfigurationUtil.class.getName()} , new RemoteConfigurationUtilImpl(props), dict);
log.info("RemoteConfigurationUtilImpl RemoteService registered");
}catch(Exception e){
e.printStackTrace();
}
I am using jmdns, but I really don't need discovery because I only need to connect to a static IP. This was the closest example that I could find for a point to point connection.
10.1.1.33 is the ip of the server, it is on the same lan as the client.
Thanks,
Greg
|
|
|
Re: ECF Generic server is connecting to the wrong host [message #1002733 is a reply to message #1002604] |
Sat, 19 January 2013 08:34 |
Eclipse User |
|
|
|
On 01/19/2013 12:20 AM, Greg Babcock wrote:
> The snippet I posted was for the client. Here is the server code.
>
>
> Dictionary<String, String> dict = new Hashtable<String, String>();
> // add OSGi service property indicated export of all interfaces
> exposed
> // by service (wildcard)
> dict.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES,
> IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
> // add OSGi service property specifying config
> dict.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS,
> CONTAINER_TYPE);
> // add ECF service property specifying container factory args
>
> dict.put(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS,
> "ecftcp://localhost:3787/server");
> try {
> bundleContext.registerService(new String[] {
> ConfigurationUtil.class.getName(),
> EMailUtil.class.getName(), ServiceUtil.class.getName(),
> RemoteConfigurationUtil.class.getName()} , new
> RemoteConfigurationUtilImpl(props), dict);
> log.info("RemoteConfigurationUtilImpl RemoteService
> registered");
> }catch(Exception e){
> e.printStackTrace();
> }
>
>
> I am using jmdns, but I really don't need discovery because I only need
> to connect to a static IP. This was the closest example that I could
> find for a point to point connection.
> 10.1.1.33 is the ip of the server, it is on the same lan as the client.
Hi Greg,
with this configuration you will end up with JmDNS announcing your
service as "ecftcp://localhost:3787/server" and consumers will obviously
fail to connect to the remote service provider but connect to localhost
instead. Try without SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS or at
least set the hostname to the external name of the machine providing the
service.
HTH
Markus
|
|
|
|
Re: ECF Generic server is connecting to the wrong host [message #1003849 is a reply to message #1002837] |
Tue, 22 January 2013 05:53 |
Eclipse User |
|
|
|
On 01/19/2013 04:37 PM, Greg Babcock wrote:
> Thank you for your reply. I tried using both the ip and server name
> without any luck. If it makes any difference, I am accessing the server
> via a VPN. Is it possible to establish a connection without using
> discovery?
Hi Greg,
I wonder if it is really JmDNS that is still announcing the service as
localhost. Can you use an scanner like 'mdns-scan' and check what gets
announced on your LAN?
Markus
|
|
|
|
Powered by
FUDForum. Page generated in 0.04462 seconds