0

I have a few lines of Android Java code which are supposed to create a JReJSON (A Java Client Library for RedisJSON) object and print some data from my DB to Logcat:

            GenericObjectPoolConfig config = new GenericObjectPoolConfig();
            config.setJmxEnabled(false);
            config.setMaxTotal(128);
            JedisPool pool = new JedisPool(config,"192.168.0.120", 6381);
            JReJSON client = new JReJSON(pool);
            client.set("foo", "bar");
            Log.d("myTag", (String)client.get("foo"));
            LinkedTreeMap RusPro = client.get("RusPro");
            String str = RusPro.toString();
            Log.d("myTag", str + "xxx");
            Log.d("MyTag", (String)client.get("ANV"));

Log.d("myTag", (String)client.get("foo")); and Log.d("MyTag", (String)client.get("ANV")); work well: the strings stored in this keys are showed in Logcat. But Log.d("myTag", str + "xxx"); doesn't do anything: there is no message from this line of code in Logcat. So, my program just skips this piece of code not executing it. If I simply write Log.d("myTag", "xxx");, it will work. But as soon as I add str in the method, it won't.

So, this is the Logcat:

2020-04-30 21:57:36.545 9740-9928/io.SamsungProject D/myTag: bar //"foo" value
2020-04-30 21:57:36.552 9740-9928/io.SamsungProject D/MyTag: hello! //"ANV" value

What is the problem? Why the program "pass by" the line? There is not any exceptions as well.

  • Did you try to use get with class? https://www.javadoc.io/doc/com.redislabs/jrejson/latest/index.html `LinkedTreeMap RusPro = client.get("RusPro", LinkedTreeMap.class, ".");` – Guy Korland Apr 30 '20 at 21:30
  • @GuyKorland it says `cannot resolve method 'get(java.lang.String, java.lang.Class, java.langString` –  Apr 30 '20 at 23:06
  • @GuyKorland https://pastebin.com/ACTAQZBn - this is the value for "RusPro". Maybe there are some other ways to convert it to string? Anyway, the fact that Log.d with the value I tried to get doesn't print anything is really weird –  Apr 30 '20 at 23:13
  • As for the cannot resolve, issue, try to upgrade the jrejson client – Guy Korland May 01 '20 at 07:28
  • @GuyKorland I think it is up to date. I installed it about 1-2 weeks ago by downloading jrejson-1.2.0.jar from Maven Repository –  May 01 '20 at 08:43
  • I suggest you open an issue on https://github.com/RedisJSON/JRedisJSON/issues – Guy Korland May 04 '20 at 13:28

0 Answers0