I have been handed an application which is almost 10 years old, for maintenance. A customer (internal) has a requirement change. The app was built and maintained in Eclipse to this point. I need to import it into IntelliJ (the current company "standard") to implement the requirements change.
The app is running on a Websphere server in production, so the local debug environment is Jetty in the project which allows developers to open the app for debugging using localhost:(portNumber). The application will run and debug using Eclipse - I've taken the time to verify this. When I attempt to run or debug it (exact same code on the local harddrive) using IntelliJ, the application will start up, but as soon as I hit a certain JSP and it attempts to load an included JSP, I get the following error message (formatted for legibility):
org.apache.jasper.JasperException: Unable to compile class for JSP||
An error occurred at line: 6 in the jsp file:
/lookupFiles/myCodes.jsp|Generated servlet error:|
The type java.lang.CharSequence cannot be resolved.
It is indirectly referenced from required .class files||
I have done the code searches that I can think to do, and I don't have CharSequence anywhere in the application. I have been through the Google searches and numerous recommended solutions (most of which say to roll back from Java version 8 to 7). I am using JDK 1.8.0 build 102 with my environment set to source compatibility for Java 6 (what's on the server). So, I don't think the default methods are the issue.
Here is the code in the included file (line 6 is the opening JSP tag):
<jsp:useBean class="commands.CommandReciever" id="receiver"></jsp:useBean>
<%@page import="my.json.JSONObject,my.json.HTTP"%>
<%@page import="org.json.JSONArray" %>
<%@page import="commands.AjaxCommand" %>
<%
JSONObject obj = HTTP.toJSONObject(request);
obj.put("operation","select");
obj.put("index",3);
obj.put("tableNumber",100);
AjaxCommand command = new AjaxCommand("username", obj);
receiver.executeCommandSQL(command);
JSONArray jArray = command.getResults();
String keyCodes = "";
String keyValues = "";
if(jArray.length() > 0){
int ctr = 0;
out.println("<option value=\"\"> - </option>");
while(ctr < jArray.length()){
obj = (JSONObject)jArray.getJSONObject(ctr);
keyCodes = obj.optString("KEY_ID");
keyValues = obj.optString("LONG1_TX");
out.println("<option value=\"" + keyCodes.substring(1) + "\">" + keyCodes + " - " + keyValues + "</option>");
ctr++;
}
}
%>
I have checked the dependencies, the local classes which are imported don't implement any of the CharSequence implementation classes.
Finally, I know there are a lot of things which can be done to make this code "better" but I'm not needing that, I just need to figure out what is causing this JasperException and get past it so I can get the application to debug in IntelliJ.