-
February 21st, 2021, 12:43 PM
#1
https and java client
I have a java LS client and HTML 5 Ls client, both of them are connecting to LS server.
The LS server is located behind the load balancer, the LS server running under https protocol.
The problem that the HTML5 connects easily to the LS server, however, the java client doesn't reach the LS server at all...
What should I do in order to get the java client connected to the LS server.
-
February 22nd, 2021, 09:25 AM
#2
Hi ManKeer,
The APIs of the Web and Java client libraries are very similar, so there should be no substantial differences in the connect operations between the two client applications.
Some preliminary checks that you could make are:
- make sure that the license running on the server correctly enable both client libraries, this can be verified in the server log in the initialization phases or in the "License" tab of the monitoring dashboard;
- if the server is behind a load balancer and you are using a Java client library below version 4.3.0 the default value for setEarlyWSOpenEnabled is different from the JavaScript lib; setting it to false could be critical in some scenarios.
If you are still having problems we will need some more information and also logs.
You should check that while the Java client is trying to connect the server log is not logging anything at all, and in this case enable client-side logging.
Regards,
Giuseppe
-
February 23rd, 2021, 12:37 PM
#3
Hi Giuseppe,
I have used the setEarlyWSOpenEnabled two times, one with true and one with false, I have the client side logs for both case, however, the server side doesn't receive any connection request from the client.
The logs are ready just let me know how can I send u the logs.
Regards
-
February 23rd, 2021, 01:25 PM
#4
Hi ManKeer,
In order to provide the Java client logs you can contact us at support@lightstreamer.com
Regards,
Giuseppe
-
March 1st, 2021, 07:54 AM
#5
Hi Giuseppe,
I have sent an email to lightstreamer support, the email contains two attached files, one when setEarlyWSOpenEnabled = true, and one when setEarlyWSOpenEnabled = false.
Regards
-
March 1st, 2021, 09:48 AM
#6
Hi ManKeer,
Thank you for the logs, we have checked them and first of all I want to clarify that the value for EarlyWSOpen seems completely irrelevant for the issue.
Indeed from the logs it is evident that every time the client lib tries to open a connection with the server, in order to send the create_session request, it immediately receives the error "Couldn't get a socket, try again".
So it would seem a connectivity problem between the device running the client and the Lightstreamer server. Please could you check by telnet or ping if the two machines can communicate? Maybe it's a DNS problem and the client can't resolve the host name?
Regards,
Giuseppe
-
September 26th, 2021, 07:48 AM
#7
Java Client not connecting to the lightstreamer server
Hi giuseppe,
I have asked this question again on the stackoverflow, I have got the following response "The observed behavior is not related to client and server versions, but to other context characteristics. For instance, one of the many possible causes could be that the needed root certificate is missing in the java environment. My suggestion is to write to Lightstreamer support forum, where you will have the opportunity to submit client and server logs."
Now, my application is distributed to the clients, does that imply that I need to import the certificate in my JAR file????
would you please clarify this point for me?
![Quote](images/styles/AestheticaGreen/misc/quote_icon.png)
Originally Posted by
giuseppe.corti
Hi ManKeer,
Thank you for the logs, we have checked them and first of all I want to clarify that the value for EarlyWSOpen seems completely irrelevant for the issue.
Indeed from the logs it is evident that every time the client lib tries to open a connection with the server, in order to send the create_session request, it immediately receives the error "Couldn't get a socket, try again".
So it would seem a connectivity problem between the device running the client and the Lightstreamer server. Please could you check by telnet or ping if the two machines can communicate? Maybe it's a DNS problem and the client can't resolve the host name?
Regards,
Giuseppe
-
September 27th, 2021, 11:17 AM
#8
Hi ManKeer,
It seems to me that the actual cause of the problem has not yet been definitively determined.
But if it is really a refusal by the java client to accept the certificate (or a part relating to the chain of intermediaries) because of a missing certificate root in the jvm, yes a possible solution would be to provide the missing certificate with the client installation.
However, please consider that cases like this depend on a very unusual or extremely recent root certificate, and sometimes an update of the jvm is enough to solve the problem.
Regards,
Giuseppe
-
September 29th, 2021, 12:39 PM
#9
I have applied the code below, which loads the keystore that contains the required certificate, unfortunately not worked....
char[] keyStorePassword = "MYPASSWORD".toCharArray();
KeyStore ks = KeyStore.getInstance("JKS");
FileInputStream fis = new FileInputStream("MYKEYSTORE.jks");
ks.load(fis, keyStorePassword);
fis.close();
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(/*"X509"*/TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(ks);
LightstreamerClient.setTrustManagerFactory(trustMa nagerFactory);
-
September 30th, 2021, 08:35 AM
#10
Hi ManKeer,
At this point, maybe the certificate hypothesis as cause of the issue is no longer valid.
However, it seems appropriate to me to have as much information as possible about the issue.
Please, could you provide us with a snippet of the server log (lightstreamer.log) of a test case that fails?
We can start with the factory configuration of the log; then based on the results we may ask you to move to more verbose levels.
Thank you,
Giuseppe
Similar Threads
-
By ManKeer in forum General
Replies: 1
Last Post: February 22nd, 2021, 09:28 AM
-
By subuta in forum Client SDKs
Replies: 2
Last Post: January 5th, 2012, 08:53 AM
-
By joshi_s_p in forum Client SDKs
Replies: 3
Last Post: January 4th, 2012, 08:30 AM
-
By k.mcc2009 in forum Adapter SDKs
Replies: 1
Last Post: May 21st, 2009, 09:41 AM
-
By jsharpe in forum Client SDKs
Replies: 4
Last Post: February 4th, 2009, 11:45 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 12:23 PM.
Bookmarks