I have a strange behaviour when working with the Telegram TDLIB. I've compiled TDLib for C++ Windows Library and have now the tdjson.dll for Win32 and Win64.
My app is using the WIN32 version without any problem, but when I try to set TdLib parameters on the Win64 via setTdlibParameters and JSON I get the following error:
{"#type":"error","code":400,"message":"Valid api_id must be provided. Can be obtained at https://my.telegram.org"}
I even use the same JSON string as used in the WIN32 version:
{"#type":"setTdlibParameters","parameters":{"database_directory":"C:\\tdlib","use_file_database":true,"use_chat_info_database":true,"use_message_database":true,"use_secret_chats":true,"api_id":123456789,"api_hash":"5485ed51254e12547ae5555555e555d0","system_language_code":"en","device_model":"Desktop","application_version":"0.1","enable_storage_optimizer":true}}
However, I always got the invalid API_ID error with WIN64. Why is the same JSON request not working with x64 DLL version?
Any help is much appreciated.
My question was answered here: https://github.com/tdlib/td/issues/2211
Starting from TDLib v1.8.6+ setTdlibParameters values must be inlined and i can see in your JSON examples you haven't inlined the parameters.
To inline setTdlibParameters values remove the key/array parameters. So your JSON will be like:
{
"#type":"setTdlibParameters",
"use_test_dc":false,
"database_directory":"",
"files_directory":"",
"database_encryption_key":"",
"use_file_database":false,
"use_chat_info_database":false,
"use_message_database":false,
"use_secret_chats":false,
"api_id":1245678,
"api_hash":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"system_language_code":"en",
"device_model":"Desktop",
"system_version":"",
"application_version":"0.1",
"enable_storage_optimizer":false,
"ignore_file_names":false
}
This should work fine in TDLib 1.8.6+.
Related
I was using the rbrack and lbrack in my Angular code yesterday and I found out that Angular throws an error on this.
Code:
<gen-pack-comp [email]="email""></gen-pack-comp>
Error:
Error in src/app/genesis/gen.pack.component.html (3:53)
Unknown entity lbrack
I saw the Named Character references and the rbrack or lbrack is a HTML standard U+0005B
So, I wanted to know why its not supported or am I doing something wrong in the syntax?
Version:
Angular CLI: 11.1.0
Node: 15.7.0
OS: Windows x64
You can use the hex or decimal (e.g. ] and ] for rbrack) representation of the entity. Angular uses it's own HTML parser for templates, and the team decided to only include most used entity names to keep the parser size reasonably small.
You can find related git issue here.
I am getting below exception while running my application.
Caused by: java.lang.UnsatisfiedLinkError:
com.chrysalisits.crypto.LunaAPI.Initialize()V
at com.chrysalisits.crypto.LunaAPI.Initialize(Native Method)
at com.chrysalisits.crypto.LunaTokenManager.(LunaTokenManager.java:107)
at com.chrysalisits.crypto.LunaTokenManager.getInstance(LunaTokenManager.java:62)
I have added LunaProvider.jar and libLunaAPI in $JAVA_HOME/jre/lib/ext.
I strongly recommend that you ask the HSM Support Team for help on this instead of Stackoverflow.
This error comes up if Java is not able to find the concerned .so / .dll (Library) file. Also, make sure that you have the correct 32 / 64 Bit version of the Library in the location.
That said, in the VM Arguments you could also set :
-Djava.library.path=/location_to_the_libLunaAPI_so_file (possibly, /usr/lunasa/JSP/lib .. or something)
I have solved my problem.
Actual Problem was mismatch between native client library (libLunaAPI.so) and Luna client.
My application was using old library's com.chrysalisits.crypto.* classes to interact with Luna client however my Luna client got updated and functions which it exposed in its native library was not present in current library.
I updated my client application by using com.safenetinc.luna.* classes and latest client library.
I'm trying to use Hangfire MySqlStorage in Web API app with mysql DB. I installed NuGet package "Hangfire.MySqlStorage" version 1.0.3. When I'm configuring Hangfire I'm getting following error,
HttpConfiguration does not contain a definition for 'UseStorage' and
no extension method 'UseStorage' accepting a first argument of type
'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?)
Seems I'm missing a reference here. Could not figure out.
It seems you are calling the method on the wrong object.
It should be, as per the documentation:
GlobalConfiguration.Configuration.UseStorage(
new MySqlStorage(connectionString));
Where GlobalConfiguration is actually Hangfire.GlobalConfiguration from the Hangfire.Core library.
I am using a JSON parser to extract the value and I am using the following jar
json-path-2.1.0, and I am getting the following error when I invoke the use case deployed as webservice on weblogic server
I wrote a small main program to extract the value from the json string and it works fine, but the server version of the use case is giving the issue. I am not sure if there are any other jars part of my ear can negatively impact this
SEVERE: defaultReader
java.lang.NoSuchFieldError: defaultReader
at com.jayway.jsonpath.spi.json.JsonSmartJsonProvider.<init>(JsonSmartJsonProvider.java:39)
at com.jayway.jsonpath.internal.DefaultsImpl.jsonProvider(DefaultsImpl.java:21)
at com.jayway.jsonpath.Configuration.defaultConfiguration(Configuration.java:174)
at com.jayway.jsonpath.internal.JsonContext.<init>(JsonContext.java:52)
at com.jayway.jsonpath.JsonPath.parse(JsonPath.java:596)
Stumbled about the same problem.
The reason why it does not work is not the JDK 8.
The reason why you encounter this issue, is the fact that weblogic 12.2.1.X is bundling some old version of json-smart.
On my machine this would be found here:
jar:file:/C:/dev/WLS_12_2_1_2_0/oracle_common/modules/net.minidev.json-smart.jar!/net/minidev/json/JSONValue.class
Now if you are using a library like json-path that depends on json-smart, then by default the container will load the required class using one of its built-in modules.
The blowup you have, seems to be that the JSONValue class that your json-path depends on seemed to have this defaultReder field.
Here is a snipet of the clode that is blowing up.
public JsonSmartJsonProvider() {
this(JSONParser.MODE_PERMISSIVE, JSONValue.defaultReader.DEFAULT_ORDERED);
}
That
JSONValue.defaultReader
Seems not to be valid on weblogs older system class loader class.
You can tell the container to use what you are packing by putting into your weblogic.xml deployment descriptor something like this:
<wls:prefer-application-packages>
<wls:package-name>net.minidev.json.*</wls:package-name>
</wls:prefer-application-packages>
I am having quite a bit of trouble getting weblogic to swallow the fine-grained instruction above.
I found myself to force weblogic to swallog all that goes into the web-inf folder instead doing:
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
I would have rather not be using a hammer like the web-inf-classes, but I am dancing with the weblogic system classloader when I do not go coarse grained...
Regards.
I too was facing this issue, It turned out some other library was using json-smart's older version, and it was getting precedence over json-path's json-smart dependency. Removing the other jar solved the issue. Or you can also downgrade your json-path's version to appropriate version such that it support json-smart's older version.
Looks like JsonParser jar is present in JVM 1.8 version and it seems to have more precedence over the JsonParser class available in Json-path.jar. Apparently the us case doesn't work in 12.2.1 version of the weblogic server but it works fine in 12.1.3
I had the same problem but I use Gradle so I had to add:
compile group: 'net.minidev', name: 'json-smart', version: '2.3' to my dependencies.
The parse4cn1 library works well with parse.com but it has some issues when working with Node 4.3.2 and parse-server open source. For example, when calling the ParseUser.signup() function, the "Invalid key name" exception is always happened. I tried to debug and figure out that the ParseCommand object should add the ParseConstants.CONTENT_TYPE_JSON to its header in order to make it can work. I don't why because it still works without doing this with parse.com.
Another issue is the ParseQuery.find() is always failed when using the ParseQuery.whereContainedIn(). The server exception is "ParseException [code=102, msg=Improper encode of parameter, cause=null]". I guess this issue probably regarding the parameter has the json format in this case as well but I don't know to to resolve it. Any advice is appreciate. Sidiabale, do you have any advice? Thanks!
These problems are solved in version 3.0 of parse4cn1. Apparently, Parse Server is stricter with the need to specify the content-type header so code that previously worked with Parse.com does not work with Parse Server. I've addressed these issues in the aforementioned release. Try again with version 3.0 and let me know if you encounter any issues.