Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member
    Join Date
    Dec 2019
    Posts
    66

    Lightbulb 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.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  3. #3
    Senior Member
    Join Date
    Dec 2019
    Posts
    66
    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


  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi ManKeer,

    In order to provide the Java client logs you can contact us at support@lightstreamer.com

    Regards,
    Giuseppe

  5. #5
    Senior Member
    Join Date
    Dec 2019
    Posts
    66
    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

  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  7. #7
    Senior Member
    Join Date
    Dec 2019
    Posts
    66

    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 Originally Posted by giuseppe.corti View Post
    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

  8. #8
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  9. #9
    Senior Member
    Join Date
    Dec 2019
    Posts
    66
    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);

  10. #10
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    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

  1. HTML5 LS client Vs Java LS client
    By ManKeer in forum General
    Replies: 1
    Last Post: February 22nd, 2021, 10:28 AM
  2. Replies: 2
    Last Post: January 5th, 2012, 09:53 AM
  3. where to download Java SE Client jar file
    By joshi_s_p in forum Client SDKs
    Replies: 3
    Last Post: January 4th, 2012, 09:30 AM
  4. Replies: 1
    Last Post: May 21st, 2009, 10:41 AM
  5. Replies: 4
    Last Post: February 5th, 2009, 12:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 08:26 AM.