2

I am trying to connect Solace using my Java code

properties.setProperty(JCSMPProperties.HOST, "XXXXXXXXXX:80");
properties.setProperty(JCSMPProperties.USERNAME, "USERNAME");
properties.setProperty(JCSMPProperties.PASSWORD,  "PASSWORD");
properties.setProperty(JCSMPProperties.VPN_NAME, "VPN_NAME");
//properties.setProperty(JCSMPProperties.)
final JCSMPSession session = JCSMPFactory.onlyInstance().createSession(properties);
session.connect();

while connecting I am getting the following error and I have no clue as of why.

Error communicating with the router. cause: java.io.IOException: Could not read valid SMF Header from network. found smf version=0 
Caused by: java.io.IOException: Could not read valid SMF Header from network. found smf version=0

Can someone please explain me why we get this error. Thanks in advance.

Aman Vaishya
  • 179
  • 12

1 Answers1

1

I see you are connecting to port 80. Is that correct? It should be 55555.

For example,

final JCSMPProperties properties = new JCSMPProperties();
properties.setProperty(JCSMPProperties.HOST, "hostname:55555");
properties.setProperty(JCSMPProperties.USERNAME, "USERNAME");
properties.setProperty(JCSMPProperties.PASSWORD, "PASSWORD");
properties.setProperty(JCSMPProperties.VPN_NAME, "VPN_NAME");
final JCSMPSession session = JCSMPFactory.onlyInstance().createSession(properties);

session.connect();
Himanshu Gupta
  • 657
  • 2
  • 8
  • 16
  • tried connecting to 55555 too, I was still getting the same error – Aman Vaishya Jul 25 '20 at 16:03
  • 1
    Login to the Solace CLI and see if the right ports are exposed. You can do that by running "show service" command. I would also recommend sharing this on https://solace.community/ – Himanshu Gupta Jul 27 '20 at 13:36