Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121

    LS adapter gets stops automatically get function only after restart the LS

    Hello,
    I'm having an issue on newly installed LS server in cent os 7. In this I have created the remote adapter written using in java and it's working fine for my functionality, but some times getting stops and I need to restart the LS server and adapter. If I need to know the issue means what are all the logs need to be enable and what are all the setting need to be change in log xml.

    01-Oct-20 01:15:38,311|INFO |L.requests |SERVER POOLED THREAD 1 |Serving request: /lightstreamer/bind_session.js --> LS_session=Scac7447bd89d6dbcM488T4411914&LS_phase= 2422&LS_cause=ws.error.failure.wsc.unknown&LS_keep alive_millis=5000&LS_content_length=4000000&LS_con tainer=lsc& on "Lightstreamer HTTP Server" from 157.46.93.34:52095
    01-Oct-20 01:15:38,311|INFO |L.requests |SERVER POOLED THREAD 1 |Sync error: Can't find session: Scac7447bd89d6dbcM488T4411914 on "Lightstreamer HTTP Server" from 157.46.93.34:52095


    01-Oct-20 01:30:01,963|INFO |L.requests |SERVER POOLED THREAD 1 |Serving request: /lightstreamer/control.js --> LS_op=destroy&LS_session=Scac7447bd89d6dbcM488T441 1914&LS_cause=new.timeout.5.2.error&LS_unique=5& on "Lightstreamer HTTP Server" from 157.46.93.232:52112


    01-Oct-20 01:33:56,653|INFO |L.requests |SERVER POOLED THREAD 8 |Sync error: Can't find session: S2127168ce79f32c9M488T3346125 on "Lightstreamer HTTP Server" from 157.46.82.181:55838


    01-Oct-20 01:33:56,653|INFO |L.requests |SERVER POOLED THREAD 8 |Sync error: Can't find session: S2127168ce79f32c9M488T3346125 on "Lightstreamer HTTP Server" from 157.46.82.181:55838


    01-Oct-20 01:34:20,177|INFO |L.requests |SERVER POOLED THREAD 6 |Sync error: Can't find session: S367273aebb31d305M488T3355893 on "Lightstreamer HTTP Server" from 157.46.82.181:55840
    Last edited by rvkvino; October 1st, 2020 at 08:11 AM.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    The reported log lines tell of client problems that seem unrelated with the Adapter behavior.
    What evidence do you have that the Adapter stops?
    If your evidence is based on some client not receiving the expected updates, the issue may lie on other parts of the pipeline.

    Anyway, if you want to trace the activity of your Remote Adapters, you should leverage the "LightstreamerProxyAdapters" logger.
    The factory setting of this logger is INFO, which should already produce log in case of problems.
    Do you confirm that you can't see any log from this logger?

    You can set this logger at DEBUG level, to see the subscription activity, or even to TRACE level, to see all the update flow.
    Then you can evaluate if something is not as expected.
    Consider that if the activity is high, this log can be very verbose;
    the best condition is if the activity is low, or if you can replicate the issue with a dedicated Server instance.

    Please check if your Server is earlier than 6.0, because in that case the loggers were different.

  3. #3
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    By adapter stopping the service to all, by that stock rates not updating to all. I can see my screen also this not getting update the rates. This totally getting issue on my remote adapter I feel.

    I need to check my code also whether this causes any issue, could you please help me is the possible to store my java file errors on LS log file.

    My code is like,
    public class ExternalFeedSimulator {
    private static Jedis jedis;
    private static JedisPool jedisPool;

    public ExternalFeedSimulator() {
    JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxTotal(1000);
    jedisPool = new JedisPool(poolConfig, RedisDBConfig.HOST, RedisDBConfig.PORT, RedisDBConfig.TIMEOUT);
    }
    public static String getJSON() {
    try {
    jedis = jedisPool.getResource();
    ClientsRateRow[] craterows = gson.fromJson(jedis.get("WLallclientsrates"), ClientsRateRow[].class);
    for (ClientsRateRow raterow : craterows) {
    liveratesnew.put(raterow.client_com_id, raterow);
    curclientrates.add(raterow);
    }
    } catch (IllegalStateException ex) {
    ex.printStackTrace();
    } catch (JedisConnectionException e) {
    e.printStackTrace();
    } catch (SecurityException e) {
    e.printStackTrace();
    } finally {
    jedis.close();
    }
    return null;
    }

    To check if get any error this need to store into LS log file. Can you help how to store the errors into ls log file from my customer class.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hello,
    To avoid misunderstandings, please confirm if the Adapter under investigation is an in-process Adapter or a Remote Adapter.
    If your intention is that the Adapter should produce its log in the same file used by the Server, this is possible (only in some conditions) for an in-process Adapter.
    For a Remote Adapter, I don't think that logback offers this possibility. In that case, you can only have the Server log the communication between the Server and the Remote Adapter (i.e. subscriptions and update events) in the way already explained.

  5. #5
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    I have used only remote adapter to subscribe items. Now I need to store the remote adapter file if anything exception happened need to be store into server log.

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Sorry, this is not supported by Lightstreamer directly.
    Our policy is that the log file generated by the Server is only owned by the Server and should not be concurrently accessed by other processes, like Remote Adapters.
    The Adapter log should be inspected separately (or it may be manually merged with the Server log, but only when the log file is no longer used by the Server).

    Since the configuration of the log appenders is free and it is only subject to logback capabilities, you may configure the Server log appenders and the Remote Adapter log in such a way that they are merged in the same file.
    But I am not familiar with these techniques.
    On the other hand, if you really want to share the same log configuration and the same log interface (via slf4j) used by the Server, you can do that with a fake in-process Adapter; we can expand on this if needed. But you have to send the log from the Remote Adapter to the fake adapter yourself in some way.

  7. #7
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    I don't need to save logs in same file. I need to save in any of the file to check the issue. Please help me to store my remote adapter log in any of the file. My adapter is written in java.

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Sorry for the misunderstanding.
    If you use Lightstreamer SDK for Java Remote Adapters, the SDK library produces some log and there are instructions on how to configure the verbosity and the log file.
    You can find the relevant information in the javadocs for SDK version 1.3.1
    https://lightstreamer.com/docs/ls-se...nce/index.html
    (see setLoggerProvider)

    I'm not sure that this is what you expected.
    If you want a facility to write to a file the log produced by your code, this is not provided, but it is the other way round.
    In fact, the library doesn't provide a log implementation, but requires that the hosting program provides such implementation for its own log.
    In this way, the hosting program can implement a bridge to send the log produced by the library to this implementation.

    We show the full process in the examples. See this one.
    Look in particular for the custom OutPrintLog class and its uses. Unfortunately, the example is simple and just sends the log to the standard output. To send the log to an implementation like log4j, more custom code is needed.

    Please be aware that this matter has undergone a few changes in the latest 1.4.0 version of the SDK, hence, when you upgrade the SDK, a small code change will be needed.

  9. #9
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    Exception in thread "Timer-0" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 12 at com.google.gson.internal.bind.ReflectiveTypeAdapte rFactory$Adapter.read(ReflectiveTypeAdapterFactory .java:176) at com.google.gson.internal.bind.TypeAdapterRuntimeTy peWrapper.read(Type AdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.rea d(ArrayTypeAdapter.java:72)at com.google.gson.Gson.fromJson(Gson.java:795)
    at com.google.gson.Gson.fromJson(Gson.java:761)
    at com.google.gson.Gson.fromJson(Gson.java:710)
    at com.google.gson.Gson.fromJson(Gson.java:682)at stocklist.feed_simulator.ExternalFeedSimulator.get JSON(ExternalFeedSimulator.java:98)at stocklist.feed_simulator.ExternalFeedSimulator$1.r un(ExternalFeedSimulator.java:170) at java.base/java.util.TimerThread.mainLoop(Timer.java:556) at java.base/java.util.TimerThread.run(Timer.java:506)
    Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 12 at com.google.gson.stream.JsonReader.expect(JsonReade r.java:339) at com.google.gson.stream.JsonReader.beginObject(Json Reader.java:322)

    I had checked on this and getting this error on screen. When I happened this exception getting stop the LS and adapter.




  10. #10
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hello,
    So your suspect that the problem was in the Adapter is correct.
    I confirm that the error does not occur in Lightstreamer library code, but in custom code.
    Note that, even though you have kept the "ExternalFeedSimulator" class name that we use in our StockListDemo example, the getJSON method reported in the stack trace is not part of the original demo code, as well as the inclusion of the third-party com.google.gson library.
    So we have no clue on this error.

 

 

Similar Threads

  1. Replies: 2
    Last Post: August 20th, 2015, 12:41 PM
  2. Replace Adapter without restart of Light Streamer service
    By Slavko Parezanin in forum Adapter SDKs
    Replies: 1
    Last Post: January 19th, 2015, 10:43 AM
  3. Replies: 5
    Last Post: August 20th, 2009, 11:38 AM
  4. Replies: 2
    Last Post: October 17th, 2008, 10:22 AM
  5. Hitting ESC stops streaming
    By Mone in forum Client SDKs
    Replies: 1
    Last Post: April 19th, 2007, 08:42 PM

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 05:19 AM.