I get gson 2.8.6 in my project,but still have the error
maybe I get low version in my project,but should't use the lastest?
and i try force gson version to 2.8.6,but it don't work
Related
Up until now, I had been using the following libraries:
kotlin("jvm")
kotlin("plugin.serialization") version "1.7.10"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
Since until now, there is no serializer for the type kotlin.time.Duration, I had my own custom serializer. So far so good.
Now I want to update the kotlinx serialization libraries to 1.4.0, which has a DurationSerializer.
When I do this, the compiler naturally protests the following:
Caused by: java.lang.IllegalArgumentException: The name of serial descriptor should uniquely identify associated serializer. For serial name Duration there already exist DurationSerializer.
So I delete my custom DurationSerializer in order to use the new one included in the library, clean and attempt to recompile. However, when I do that, the following happens:
Serializer has not been found for type 'Duration'. To use context serializer as fallback, explicitly annotate type or property with #Contextual
Basically, the new library version can tell that my custome DurationSerializer is conflicting with its own, but then can't actually use its own. How do I get around this?
Got the answer from the kotlinx.serialization github repository here.
Turns out the library version of the serializer will only be added in a future compiler update.
In the meantime, our serial name for the custom serializer was too similar to the libraries', causing a conflict. Changed it from kotlin.time.Duration to CustomDurationSerializer and the issue went away.
I'm upgrading from deprecated gradle properties, and instead of referencing the File jar.destinationDir, I'm using the DirectoryProperty jar.destinationDirectory
But because I need a java.nio.file.Path object, my code changes from
jar.destinationDir.toPath()
into
jar.destinationDirectory.asFile.get().toPath()
Is there some groovy way to omit at least the .asFile.get()?
I am trying to upgrade the QFJ version 2.2.0 from 2.1.1 facing below issue.
java.lang.IllegalArgumentException: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(Unknown Source)
I have analysed this is because of QFJ DataDictionary.java's load method using below code.
private void load(InputStream inputStream) throws ConfigError {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
...}
Reason of error is not clearly understood by me(please try to explain) but found that Xerces, xercesImpl jar causing this error.
we are using these jar in some our project code that is why it is needed.
Can anyone try to explain why we have placed these lines? and we are placing then it should be under try and catch block. Is there any way to fix it. Without doing source code changes provide by QFJ.
Answer from QFJ team really appreciated.
we updated our solution to ValueInjecter v3.0 and now we have big problems because in this version an exception is raised if a property has no setter. This is different to Version 2.3.3.
We have a lot of classes where the missing setter is possible, so what can we do beside scanning the whole source code and check every usage of InjectFrom???
Is there any global Setting who avoids the exception when there is no setter?
Greeting
Martin
no, there isn't any global setting for that, but this has been recently fixed,
you can update to the latest version now, and it should work
When I try to use Jackson 2.1.1 with the following jar files (in Spring 3.2.2),
jackson-core-2.1.1.jar
jackson-annotations-2.1.1.jar
jackson-databind-2.1.1.jar
I get the following exception.
java.lang.ClassNotFoundException:
org.codehaus.jackson.JsonProcessingException
So I think, the class JsonProcessingException is contained by the jackson-core-asl-2.1.1.jar file (I'm not quite sure though) but I cannot see this file in the download. So where to get this file to resolve that exception?
jackson-all-1.9.8.jar contains necessary classes including the class org.codehaus.jackson.JsonProcessingException and JSON also works fine but I'm not sure this is perfectly compatible as I'm using classes from Jackson 2.1.1 for object mapping. Therefore I'm looking for the jackson-core-asl-2.1.1.jar file but I can't see such a JAR file. I can only see 1.x.x versions here.
In version 2.1.2, that class is called com.fasterxml.jackson.core.JsonProcessingException, and it's in the jackson-core jar. Jackson changed its packaging for version 2.0, along with numerous other things.
It seems you have some code that was written against an older version of Jackson, and is trying to load the class under an old name. You will need to either update this code, or use an old version of Jackson.
Use jackson-all-1.9.9 jar instead of the later versions(2.x.x.) of jackson-core, jackson-annotations and jackson-databind. Here is the link.