Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Connection to server failing Closed HTTP connection with internal cause code: 10

    Hello,
    I cant establish connection from my LS Client java app to the lightream server. i can ping the lightstream server. I suspect it has something to do with the SSL but I have them removed from the main lightstreamer_conf.xml
    <remove_protocols>SSL</remove_protocols>
    <remove_protocols>TLSv1$</remove_protocols>
    <remove_protocols>TLSv1.1</remove_protocols>

    my LS client says this:
    LSClientHandler:::: Start()::RuntimeException: com.lightstreamer.ls_client.PushConnException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

    lightstream server logs say this
    L.connections.proxy|ACCEPT POOLED THREAD 80 |Received no address chain through a X-Forwarded-For header on "Lightstreamer HTTP Server" from 127.0.0.1:34662
    L.connections |SERVER POOLED THREAD 10 |Closed HTTP connection with internal cause code: 10 (Read timed out) on "Lightstreamer HTTP Server" from 127.0.0.1:34662

    Can you please help. Thanks

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi baalbaki,

    This is a strange behavior, it seems that both sides are waiting for a network packet from the other side but then timed out.
    Please could you specify the Lightstreamer server version? Is this error always the same or do you see different messages?
    Maybe that it will be necessary to investigate further with a more complete snippet of server log (lightstreamer.log) and in case more precise instructions will follow.


    Anyway, if you want to be sure that your server is properly configured with the tls certificate you can always test it with ssllabs: https://www.ssllabs.com/ssltest/

    Regards,
    Giuseppe

  3. #3
    Hi Giuseppe,
    1-I have a firewall on the server im working on that i cant disable so i can't really test the lightstreamer server i'm running with ssltest. Doesnt me telnet localhost 8081 which is where my server is prove that server is running fine?
    2-i have ls-client-2.5.2.jar and lightstreamer server 7.2.2
    3-Its always the same error.

    4-For now I have a Lightstreamer client already functional that is receiving data from a "source" that is have no control of. This source i want to replace it with my own lighstreamer adapter and using the lighstreamer server.
    Im using one of your stocklist adapter for now combined with the server just to see if connection happens. Does having an incompatible client/adapter can cause the connection to not being established?

    5- I dont know how handshake between client and server work here. I have localhost with port, user and password matching client and lightstreamer_conf.xml. I've disabled SSL in lightstreamer_conf.xml. Do i need to send something? you said "it seems that both sides are waiting for a network packet from the other side"

    6-there are 2 ports in lightstreamer_conf.xml(ive chosen port 8081 and 8888), what is each used for?


    7- Here is the beginning of the logs from lightstreamer.log I dont know how to attach the lightstreamer.log to this thread
    Thanks for the help

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi baalbaki,

    From the error messages you reported in the post above there does not seem a problem with the Adapters configuration.

    About point 5. it is not clear to me if you want to offload tls from Lightstreamer so that the Lighstreamer server will only handle plain http requests.

    About point 6. in Lightstreamer you can define several endpoint ports both http and https.
    How this listening socket will be used depends on the deployment configuration.
    So it is your choice to define multiple listening ports and use them appropriately. Please refer to the inline comment of the <port_type> parameter in lightstreamer_conf.xml.

    For now, you could provide to support@lightstreamer.com a snippet of the complete server log with a case of a client failing to connect. We will then evaluate whether to correct the log settings.

    Regards,
    Giuseppe

  5. #5
    Hello giuseppe,
    So actually I want to listen to https request, so I guess I have to enable ssl and use the port in the config file for that <port ssl="Y">8887</port>. I will look into the doc called "SSL Certificates.pdf" to see how to configure it. Hopefully after that this will work.
    I've already sent the logs and config file, if you find what exactly is missing to have ssl enabled. Please let me know.
    Thanks

  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi baalbaki,

    I confirm that we received the files.
    I checked the configuration file and I can also confirm that no ssl ports are configured.
    You need to configure one (or more) <https_server name="Lightstreamer HTTPS Server"> section in the lightstreamer_conf.xml configuration file.
    Please pass through all the parameters in the <https_server> section and their description for guidance on how to properly set up the server to tls/ssl secure connections (please be careful that it is not the port configuration you mentioned).
    And yes, in particular for the creation and uploading of the TLS certificate, you can refer to the SSL Certificates.pdf document.

    Regards,
    Giuseppe

  7. #7
    Hi Giuseppe,
    I've tried to see if i use only http requests, and the connection works now.
    I will check how to make it work with https later.
    Thanks a lot for the help

  8. #8
    Hi Giuseppe,
    I've sent logs and some files by email.
    I have this adapter where I’ve just renamed the class and is the same as the adapter here (https://github.com/Lightstreamer/Lig...d-adapter-java)
    I run the lighstreamer server, and I run a LS client to connect to it (but don’t have the adapter compatible with it yet)
    I have this code for my customed adapter MARKETDATASETADAPTER
    public MarketDataSetAdapter() {
    logger.warn("MARKETDATASETADAPTER CONSTRUCTOR");
    try {
    FileWriter myWriter = new FileWriter("/tmp/filename.txt");
    myWriter.write("Files in Java might be tricky, but it is fun enough!");
    myWriter.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    }


    Question 1: The code above is never called. When does the adapter constructor is called? And where logger writes the adapter logs

    Question 2:
    In the lightstreamer.log, when I connect to the client, I see this:
    815
    OK
    Then
    ERROR
    17
    Data Adapter not found

    Question 3:
    I have several: ExtendedTableInfo with different types of extendedTableInfo.setDataAdapter() in the LS client im using. In adapters.xml file I was using my customs adapters by adding those in <data_provider . But the LS client wasn’t working unless I put the adapter class name im using in <adapters_conf id=.
    What is the difference between an adapter and a dataprovider? Can I have several adapters (<adapters_conf id) in In adapters.xml?

    Thanks

  9. #9
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    718
    Hi baalbaki,

    1) The adapter constructor is called in the initialization phase of the server, looking in the server log (lightstreamer.log) you attached the relevant log lines are:

    Code:
    01-Feb-22 17:46:51,352|DEBUG|L.i.subscriptions  |main                       |Found Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,352|DEBUG|L.i.subscriptions  |main                       |Initializing Adapters...
    01-Feb-22 17:46:51,353|INFO |L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter for Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter class com.lightstreamer.adapters.metadata.LiteralBasedProvider for MARKETDATASET
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Loading Metadata Adapter MARKETDATASET from ClassLoader  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / Adapters / MARKETDATASET Adapter Set
    01-Feb-22 17:46:51,354|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Adding class com.lightstreamer.adapters.metadata.LiteralBasedProvider from  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / com.lightstreamer.l.b.a.aa / com.lightstreamer.l.b.a.aa for metadata adapter...
    01-Feb-22 17:46:51,355|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Class for metadata adapter successfully added.
    01-Feb-22 17:46:51,355|DEBUG|L.i.subscriptions  |Init for MARKETDATASET     |Initializing Metadata Adapter for Adapter Set MARKETDATASET; class = com.lightstreamer.adapters.metadata.LiteralBasedProvider; params = {item_family_1=item.*, adapters_conf.id=MARKETDATASET, modes_for_item_family_1=MERGE}; dir = /export/tbricks/nbf_java/CandealSimulator/simulator/conf/../adapters/welcome_res
    01-Feb-22 17:46:51,356|INFO |L.i.subscriptions  |Init for MARKETDATASET     |Finished loading Metadata Adapter for Adapter Set MARKETDATASET
    01-Feb-22 17:46:51,356|INFO |L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter MARKETDATASET.MARKETDATASET
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter class main.java.com.lightstreamer.adapters.MarketDataSetAdapter for MARKETDATASET
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Loading Data Adapter MARKETDATASET from ClassLoader  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / Adapters / MARKETDATASET Adapter Set
    01-Feb-22 17:46:51,356|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Adding class main.java.com.lightstreamer.adapters.MarketDataSetAdapter from  / sun.misc.Launcher$ExtClassLoader / sun.misc.Launcher$AppClassLoader / com.lightstreamer.l.b.a.aa / com.lightstreamer.l.b.a.aa for data adapter...
    01-Feb-22 17:46:51,357|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Class for data adapter successfully added.
    01-Feb-22 17:46:51,531|DEBUG|L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Initializing Data Adapter MARKETDATASET.MARKETDATASET; class = main.java.com.lightstreamer.adapters.MarketDataSetAdapter; params = {data_provider.name=MARKETDATASET, adapters_conf.id=MARKETDATASET}; dir = /export/tbricks/nbf_java/CandealSimulator/simulator/conf/../adapters/welcome_res/MarketDataSetAdapter
    01-Feb-22 17:46:51,531|INFO |L.i.subscriptions  |MARKETDATASET.MARKETDATASET|Finished loading Data Adapter MARKETDATASET.MARKETDATASET
    So your class main.java.com.lightstreamer.adapters.MarketDataSet Adapter seems properly instantiated.So your class main.java.com.lightstreamer.adapters.MarketDataSet Adapter seems properly instantiated.
    From your log I understand that you use Log4j2 for the adapter log, in that case the log configuration should be provided in a file with name log4j2.xml in the classpath.
    Please consider as a reference the file log4j2.xml in the classes folder of the deploy.zip of this example (https://github.com/Lightstreamer/Lig...tag/new_deploy).
    After you will get the log of your adapter we will be able to understand what is wrong with the constructor code.

    2) The subscription request specifies the STATICDATA_ADAPTER Data Adapter that is non deployed based on the adapters.xml attached.

    /lightstreamer/control.txt --> LS_mode=MERGE&LS_session=Sf8349f30dd39d043M777T473 6262&LS_Snapshot=true&LS_id=SecSubType&LS_schema=S ecurityTypeList&LS_data_adapter=STATICDATA_ADAPTER&LS_table=1&LS_op=add on "Lightstreamer HTTP Server" from 127.0.0.1:35158


    3) No, the <adapters_conf id=" ... "> must be unique within the adapters.xml file as it represents the identification of the Adapter Set.
    An Adapter Set is made up of a Metadata Adapter and one or multiple Data Adapters (Data Provider and Data Adapter are synonymous).
    The Adapter Set is defined in the adapters.xml configuration file and in particular the Metadata Adapter in the <metadata_provider> section.
    And the Data Adapters each in its own section <data_provider name=" ... ">.

    You can also have several Adapters Sets deployed on the same Lightstreamer server, but you need to provide different adapters.xml in different sub-folders of <LS_HOME>/adapters/.

    Regards,
    Giuseppe

  10. #10
    Hi Giuseppe,
    Everything worked
    1)I've added log4j2.xml and i can see the adapters logs. Note in the lightstream servers packages, you guys are using log4j-api-2.17.0.jar and log4j-core-2.17.0.jar which are dangerous. You can google "log4j security vulnerability" to see which versions are safe
    2)I've renabled the adapters and in the xml file and everything is working fine.
    Thanks a lot for the quick responses!

 

 

Similar Threads

  1. LightStreamer Server Failing Upon A Connection
    By ErikLatimer in forum General
    Replies: 3
    Last Post: October 3rd, 2018, 12:06 PM
  2. Replies: 1
    Last Post: June 13th, 2016, 10:01 AM
  3. Replies: 5
    Last Post: January 18th, 2016, 10:10 AM
  4. Internal cause codes & Session callbacks
    By jonasby1 in forum General
    Replies: 4
    Last Post: February 16th, 2012, 08:47 AM
  5. Internal cause codes
    By BKnight in forum General
    Replies: 3
    Last Post: February 10th, 2012, 09:33 AM

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 12:04 AM.
Lightstreamer Logo