Java Compilation Error - package org.json does not exist

3
Hello, I am creating a new application in Mendix 7.18.1 using some modules which I have pulled from another application that was built in Mendix 6.10.12.  I was previously able to run the app locally however I brought in an additional module (from the 6.10.12 project) which I later decided to remove and am now running into this compilation error. I unselected all of the additional files which could have been moved into the project while importing that module.  I have updated all app store modules as recommended from this similar forum question and am wondering if anyone can suggest possible next steps/solutions.  Similar Mendix Question: https://forum.mendix.com/link/questions/86614 Thank you, Neil Error Message: Buildfile: D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\deployment\build_core.xml compile:     [javac] Compiling 576 source files to D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\deployment\run\bin     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:12: error: package org.json does not exist     [javac] import org.json.JSONArray;     [javac]                ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:13: error: package org.json does not exist     [javac] import org.json.JSONObject;     [javac]                ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:72: error: cannot find symbol     [javac]     private JSONArray reformatRestrictedLocations(JSONObject rl) {     [javac]                                                   ^     [javac]   symbol:   class JSONObject     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:72: error: cannot find symbol     [javac]     private JSONArray reformatRestrictedLocations(JSONObject rl) {     [javac]             ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\ReportStepJava.java:12: error: package unittesting does not exist     [javac] import unittesting.TestManager;     [javac]                   ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\ThrowAssertionFailed.java:12: error: package unittesting does not exist     [javac] import unittesting.TestManager;     [javac]                   ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\processqueue\actions\AppendNewActionToQueue.java:13: error: package processqueue.queuehandler does not exist     [javac] import processqueue.queuehandler.QueueHandler;     [javac]                                 ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:32: error: cannot find symbol     [javac]         JSONObject json = new JSONObject(s_json);     [javac]         ^     [javac]   symbol:   class JSONObject     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:32: error: cannot find symbol     [javac]         JSONObject json = new JSONObject(s_json);     [javac]                               ^     [javac]   symbol:   class JSONObject     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:34: error: cannot find symbol     [javac]         JSONArray vendors = json.getJSONArray(is_vendor?vendor_element:customer_element);     [javac]         ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:36: error: cannot find symbol     [javac]             JSONObject vendor = vendors.getJSONObject(i);     [javac]             ^     [javac]   symbol:   class JSONObject     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:39: error: cannot find symbol     [javac]                     JSONArray reformated = reformatRestrictedLocations(vendor.getJSONObject(restrictedlocations));     [javac]                     ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:73: error: cannot find symbol     [javac]         JSONArray res = new JSONArray();     [javac]         ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:73: error: cannot find symbol     [javac]         JSONArray res = new JSONArray();     [javac]                             ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:75: error: cannot find symbol     [javac]             JSONArray locations = rl.getJSONArray(locationIDs);     [javac]             ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_import\actions\JA_JSON_ReformatRESTRICTEDLOCATIONS.java:77: error: cannot find symbol     [javac]                 JSONArray locations_inner = locations.getJSONArray(i);     [javac]                 ^     [javac]   symbol:   class JSONArray     [javac]   location: class JA_JSON_ReformatRESTRICTEDLOCATIONS     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\JA_GetAggregatedMemberValue.java:46: error: cannot find symbol     [javac]             if ( AnyObjectParameter1 == null ){     [javac]                  ^     [javac]   symbol:   variable AnyObjectParameter1     [javac]   location: class JA_GetAggregatedMemberValue     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\JA_GetAggregatedMemberValue.java:54: error: cannot find symbol     [javac]             String received_type = AnyObjectParameter1.getType();     [javac]                                    ^     [javac]   symbol:   variable AnyObjectParameter1     [javac]   location: class JA_GetAggregatedMemberValue     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\JA_GetAggregatedMemberValue.java:64: error: cannot find symbol     [javac]                 .filter(m -> AnyObjectParameter1.hasMember(m.getAttributeName()))     [javac]                              ^     [javac]   symbol:   variable AnyObjectParameter1     [javac]   location: class JA_GetAggregatedMemberValue     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\JA_GetAggregatedMemberValue.java:65: error: cannot find symbol     [javac]                 .map(m -> AnyObjectParameter1.getMember(context, m.getAttributeName()).getValue(context))     [javac]                           ^     [javac]   symbol:   variable AnyObjectParameter1     [javac]   location: class JA_GetAggregatedMemberValue     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\ReportStepJava.java:30: error: cannot find symbol     [javac]         TestManager.instance().reportStep(message);     [javac]         ^     [javac]   symbol:   variable TestManager     [javac]   location: class ReportStepJava     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\intacct_invoice\actions\ThrowAssertionFailed.java:30: error: package TestManager does not exist     [javac]         throw new TestManager.AssertionException(message);     [javac]                              ^     [javac] D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\javasource\processqueue\actions\AppendNewActionToQueue.java:65: error: cannot find symbol     [javac]         QueueHandler.getQueueHandler().appendActionForProcessing(context,  this.ActionToQueue, this.ProcessParameter1, false);     [javac]         ^     [javac]   symbol:   variable QueueHandler     [javac]   location: class AppendNewActionToQueue     [javac] Note: Some input files use or override a deprecated API.     [javac] Note: Recompile with -Xlint:deprecation for details.     [javac] 23 errors BUILD FAILED D:\Users\nhones\Documents\Mendix\eXpIntacctConnector-main\deployment\build_core.xml:29: Compile failed; see the compiler error output for details. Total time: 5 seconds
asked
3 answers
3

The class is part of com.mendix.json.jar as part of the Mendix runtime. The import of the jar to the userlibs of Mendix 7 solves the error for this missing object.

answered
3

It also seems like the unittesting module is missing. That causes some of your java compilation errors.

answered
1

Hi Neil,

The issue is with this java action JA_JSON_ReformatRESTRICTEDLOCATIONS. Its importing a library that is not in your userlib folder. Try finding that jar file, adding it to your userlib folder, clean deployment directory, and rerun the app locally. 

answered