Hi everyone,
I'm using a script unit to parse a JSON text.
In order to do this I'm importing the following libraries:
- com.fasterxml.jackson.core
- com.fasterxml.jackson.databind
I copied the listed libraries jars into /WebContent/WEB-INF/lib.
As soon as I open the page that should trigger the script the following error is returned:
It seems like the libraries are not present, but they actually are in the lib folder.
Thanks,
Davide
Hello Davide.
To add custom Json libraries that is not comming by default in WebRatio.
You can create in your Web Application project (In the WebRatio Explorer) a Folder named WebContent, inside this Folder create WEB-INF folder and inside this create lib.
Then inside lib folder you can add all the external .jar libraries and run in your Script component. Just make sure you read your Custom Library documentation and you can import as normal.
import org.Library. etc. etc.
Regards.
Hi,
did you add, just after #input and #output directives, lines such as:
import com.fasterxml.jackson.core.YourClasses
import com.fasterxml.jackson.databind.YourClasses
as appropriate?
Yes I did.
#input String json
#output String param
import com.fasterxml.jackson.core
import com.fasterxml.jackson.databind
Hi Davide
as far as I know, in an import directive you should specify a class, or all the classes in a package. When you state "import com.fasterxml.jackson.core", you are addressing a java package, not a Class.
Try to import each class you really need, I mean:
import com.fasterxml.jackson.core.YourClass
(substitute YourClass with the actual one), or all the classes in that package with:
import com.fasterxml.jackson.core.*
This should be correct. Let me know.