Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Monday, July 26, 2021 at 09:24amHi
We are using onespan integration in Guidewire 8.0.7 version and I was able to create the package in my local environment . we promoted our code to the one of testing environment. When we click save draft package button on the onespanpackagepopupscreen we are getting the NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils exception. We tried different ways to resolve this issue but none of them worked. We really have no clue why this class is not being able to recognized by the compiler at runtime.
Reply to: Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Tuesday, July 27, 2021 at 09:51amHi bthirupathireddy,
Thanks for your post! I am not aware we have the class under this path - The only OneSpanJSONUtils I can find is under acc.oneSpan package. However, the path gw/accelerators/onespan does sound familiar to me, could you advise where in the code does it (either the class, or the path) get referenced?
Duo
Reply to: Hi bthirupathireddy, …
Tuesday, July 27, 2021 at 10:02amThanks Duo for replying.
Initially onespan package was present in acc.onespan only later we moved entire folder to new path which is gw.accelerators.onespan.
I have gone thorough the tomcat logs and able to identify the root cause of the issue. we have folder json in onespan package which has all json related java classes.
There is a reference "gw.accelerators.onespan.json.Json" in OneSpanJsonUtil.gs class which is considering as invalid by the JVM and throwing following exception
INFO: java.io.IOException: gw.lang.parser.exceptions.ParseResultsException: OneSpanJSONUtils.gs
Errors:
"gw.accelerators.onespan.json.Json" is not a valid type.
how to make this class compiled by JVM ? please suggest
Reply to: Thanks Duo for replying. …
Tuesday, July 27, 2021 at 10:10amIf we are talking about the JSON library (e.g. var idObject : Dynamic = Json.fromJson(jsonString) )
Shouldn't it be referenced as "uses gw.lang.reflect.json.Json"?
Duo
Reply to: If we are talking about the…
Tuesday, July 27, 2021 at 10:36amI am not sure When we got the onespan package from GuideWire "uses gw.lang.reflect.json.Json" reference was commented in onespanJsonutilclass.gs
Reply to: I am not sure When we got…
Tuesday, July 27, 2021 at 10:42amThis is the gs folder structure from my installation and I am not so sure I saw the same JSON folder as you mentioned.
Duo
Reply to: Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Tuesday, July 27, 2021 at 10:48amIt's strange we have json folder in our onespan code package. I have attached my folder structure. Can you share onespanJsonutil.gs class references and path where they are getting referenced from ?
Reply to: It's strange we have json…
Tuesday, July 27, 2021 at 10:51amThis is the original source code of OneSpanJSONUtils.gs, which is the same as you downloaded from marketplace.
Duo
Reply to: Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Tuesday, July 27, 2021 at 11:01amIn your class you are not even referencing "uses acc.onespan.json.Json " you are using uses gw.lang.reflect.json.Json. But in my local I don't have this file in respective jar file. Will you please share the jar file where gw.lang.reflect.json.Json getting referenced ?
Reply to: In your class you are not…
Wednesday, July 28, 2021 at 09:45amHi bthirupathireddy,
In my GW v9 installation, this JSON class is included in the "gosu-core-api-1.13.31.jar", instead of the util library.
Du
Reply to: Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Wednesday, July 28, 2021 at 11:16amwe are implementing onespan integration for GW v8.0.7. Can you share this "gosu-core-api-1.13.31.jar" file I will try with Jar file
Reply to: we are implementing onespan…
Wednesday, July 28, 2021 at 11:31amI am not sure if this will introduce any conflict since it's part of the gosu core APIs. Before you trying to do that, is this your team who manually added the utility library (the json folder) to the "gw/acc/accelerators/onespan" path? Could you share the files under the "gw/acc/accelerators/onespan" to [email protected], so that I can have a better understanding what changes have been made on top of the original code?
Duo
Reply to: I am not sure if this will…
Wednesday, August 4, 2021 at 12:23pmWe are able to resolve this issue and we are not getting that exception in our testing environment. I have committed all .class files of JSON library as a Jar file. Thanks for help.
but in testing environment we are not able to create package we are getting this exception "The specified user cannot be found." although the sender APIkey is different and recipient is different. I didn't get this error in my local environment. What should I do to fix this issue ?
Reply to: We are able to resolve this…
Thursday, August 5, 2021 at 05:09pmFrom the error message "The specified user cannot be found.", it sounds like you are specifying sender in the transaction creation UI, while the sender is not under the current API Key holder's account? If that's the case, you could do a quick test by removing the sender, or double confirm and use a sender that is available under the account.
Duo
Reply to: Getting NoClassDefFoundError: gw/accelerators/onespan/OneSpanJSONUtils
Tuesday, August 10, 2021 at 11:15amThanks I entered the wrong APIkey that's it was unable to aunthenticate the user. Thanks Duo