Results 1 to 10 of 27

Hybrid View

  1. #1
    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.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    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.

  3. #3
    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.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    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.

  5. #5
    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.

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    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.

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




 

 

Similar Threads

  1. Replies: 2
    Last Post: August 20th, 2015, 11:41 AM
  2. Replace Adapter without restart of Light Streamer service
    By Slavko Parezanin in forum Adapter SDKs
    Replies: 1
    Last Post: January 19th, 2015, 09:43 AM
  3. Replies: 5
    Last Post: August 20th, 2009, 10:38 AM
  4. Replies: 2
    Last Post: October 17th, 2008, 09:22 AM
  5. Hitting ESC stops streaming
    By Mone in forum Client SDKs
    Replies: 1
    Last Post: April 19th, 2007, 07: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 11:39 PM.