简体   繁体   中英

ERROR: package org.json does not exist in liferay?

I am getting this error even though I have imported them like so.

import org.json.JSONArray;
import org.json.JSONObject;

I tried with different versions also.

    implementation group: 'org.json', name: 'json', version: '20220320'
//  implementation group: 'org.json', name: 'json', version: '20200518'
//  implementation group: 'org.json', name: 'json', version: '20160807'
//  implementation group: 'org.json', name: 'json', version: '20160810'
//  implementation group: 'org.json', name: 'json', version: '20170516'
//  implementation group: 'org.json', name: 'json', version: '20171018'
//  implementation group: 'org.json', name: 'json', version: '20180130'
//  implementation group: 'org.json', name: 'json', version: '20180813'
//  implementation group: 'org.json', name: 'json', version: '20190722'
//  implementation group: 'org.json', name: 'json', version: '20200518'
//  implementation group: 'org.json', name: 'json', version: '20201115'
//  implementation group: 'org.json', name: 'json', version: '20210307'
//  implementation group: 'org.json', name: 'json', version: '20211205'
//  implementation group: 'org.json', name: 'json', version: '20180130'

I even downloaded the jar and placed it in my lib folder. Same error even then.

This is my build.gradle file

dependencies
{
    implementation enforcedPlatform( group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1")
    
    implementation group: 'log4j', name: 'log4j', version: '1.2.17'
    
    implementation group: 'org.json', name: 'json', version: '20220320'
//  implementation group: 'org.json', name: 'json', version: '20200518'
//  implementation group: 'org.json', name: 'json', version: '20160807'
//  implementation group: 'org.json', name: 'json', version: '20160810'
//  implementation group: 'org.json', name: 'json', version: '20170516'
//  implementation group: 'org.json', name: 'json', version: '20171018'
//  implementation group: 'org.json', name: 'json', version: '20180130'
//  implementation group: 'org.json', name: 'json', version: '20180813'
//  implementation group: 'org.json', name: 'json', version: '20190722'
//  implementation group: 'org.json', name: 'json', version: '20200518'
//  implementation group: 'org.json', name: 'json', version: '20201115'
//  implementation group: 'org.json', name: 'json', version: '20210307'
//  implementation group: 'org.json', name: 'json', version: '20211205'
//  implementation group: 'org.json', name: 'json', version: '20180130'
    
    compileInclude group: 'org.postgresql', name: 'postgresql', version: '42.2.25'

    compile 'com.liferay.portal:com.liferay.portal.kernel:2.0.0'
    compile 'javax.portlet:portlet-api:2.0'
    compile 'org.osgi:org.osgi.service.component.annotations:1.3.0'
    compile group: "com.liferay", name: "com.liferay.login.web", version: "1.0.5"
    compile group: "com.liferay", name: "com.liferay.blogs.web", version: "1.0.11"
    
    compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1" 
}

These are the imports in my view.jsp file

<%@page import="java.util.Properties"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="org.json.JSONObject"%>
<%@page import="org.json.JSONArray"%>
<%@page import="com.liferay.portal.kernel.util.PortalUtil"%>
<%@page import="com.liferay.portal.kernel.model.Organization"%>
<%@ include file="/init.jsp" %>

Can anyone please help me with this Error?

09-Sep-2022 08:32:36.540 SEVERE [http-nio-8080-exec-8] org.apache.jasper.compiler.Compiler.generateClass Error compiling file: C:\Users\ThisPc\Desktop\Liferay\liferay-ce-portal-7.1.2-ga3\work\user_module-1.0.0\org\apache\jsp\view_jsp.java
2022-09-09 08:32:36 ERROR PortletRequestDispatcherImpl:331 - Unable to dispatch request: PWC6033: Error in Javac compilation for JSP__PWC6199: Generated servlet error:_package org.json does not exist__PWC6199: Generated servlet error:_package org.json does not exist__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 131 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 139 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 149 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 909 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,048 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,065 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,081 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,097 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__ [Sanitized]
2022-09-09 08:32:36 ERROR PortletServlet:112 - javax.portlet.PortletException: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP__PWC6199: Generated servlet error:_package org.json does not exist__PWC6199: Generated servlet error:_package org.json does not exist__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 131 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 139 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 149 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 909 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,048 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,065 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,081 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,097 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__ [Sanitized]
javax.portlet.PortletException: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP__PWC6199: Generated servlet error:_package org.json does not exist__PWC6199: Generated servlet error:_package org.json does not exist__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONArray_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 36 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 131 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 139 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 149 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 909 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,048 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,065 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,081 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__PWC6197: An error occurred at line: 1,097 in the jsp file: /view.jsp_PWC6199: Generated servlet error:_cannot find symbol_  symbol:   class JSONObject_  location: class org.apache.jsp.view_jsp__ [Sanitized]
    at com.liferay.portlet.internal.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:333)
    at com.liferay.portlet.internal.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:128)
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:589)
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.include(MVCPortlet.java:605)
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.doView(MVCPortlet.java:160)
    at user_module.portlet.User_modulePortlet.doView(User_modulePortlet.java:76)
    at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:305)
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:492)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:291)
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.render(MVCPortlet.java:316)
    at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
    at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
    at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
    at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
    at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
    at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
    at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:564)
    at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:660)
    at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:357)
    at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:280)
    at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:383)
    at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:278)
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1534)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
    at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:202)
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
    at com.liferay.portal.servlet.TransferHeadersHelperImpl$TransferHeadersRequestDispatcher.include(TransferHeadersHelperImpl.java:162)
    at com.liferay.portlet.internal.PortletContainerImpl._render(PortletContainerImpl.java:870)
    at com.liferay.portlet.internal.PortletContainerImpl.lambda$render$2(PortletContainerImpl.java:216)
    at com.liferay.portlet.internal.PortletContainerImpl._preserveGroupIds(PortletContainerImpl.java:395)
    at com.liferay.portlet.internal.PortletContainerImpl.render(PortletContainerImpl.java:205)
    at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:142)
    at com.liferay.portlet.RestrictPortletContainerWrapper.lambda$render$0(RestrictPortletContainerWrapper.java:126)
    at com.liferay.portlet.RestrictPortletContainerWrapper._render(RestrictPortletContainerWrapper.java:183)
    at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:124)
    at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:212)
    at com.liferay.portal.action.RenderPortletAction.execute(RenderPortletAction.java:117)
    at com.liferay.portal.action.UpdateLayoutAction.addPortlet(UpdateLayoutAction.java:317)
    at com.liferay.portal.action.UpdateLayoutAction.getJSON(UpdateLayoutAction.java:268)
    at com.liferay.portal.struts.JSONAction.execute(JSONAction.java:77)
    at com.liferay.portal.struts.PortalRequestProcessor._processActionPerform(PortalRequestProcessor.java:706)
    at com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:646)
    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:194)
    at com.liferay.portal.servlet.MainServlet.process(MainServlet.java:1067)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:598)
    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:575)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:103)
    at com.liferay.portal.apio.internal.architect.servlet.filter.APIDocumentationFilter.processFilter(APIDocumentationFilter.java:74)
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
    at 

I am not able to add full stack trace limit is 30000 characters. please inform how to add.

There are several ways to attack this problem:

First: You're explicitly compiling against version 20220320, which might or might not be bundled within Liferay. Typically (due to 7.4's original release date in 2021) I wouldn't expect a 2022 dependency within the product, but if you compile against a newer version, you might need to bring it with you.

That said: Here are some of your options:

  • In Liferay's license/versions.html file you can figure out the exact bundled json version of the Liferay version that you're using
  • Through use of the "target platform" you could omit the version in your build.gradle, and use the platform's version
  • You could compileInclude the version that you'd like to use
  • You could deploy the version that you'd like to use, if it's an OSGi bundle (I didn't check that)
  • You could use Liferay's wrappers, eg com.liferay.portal.kernel.json.JSONFactoryUtil
  • I'm not sure if bnd's dependency resolution finds a dependency in a JSP, to declare it correctly in the generated Manifest. If it doesn't, you might need to reference org.json.* somewhere in your java code. I'd consider it best practice to remove as much code from JSPs anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM