My Oracle Support Banner

Jspc Failed With Errors :weblogic.servlet.jsp.CompilationException: CompareTo Must Override (Doc ID 1455479.1)

Last updated on APRIL 04, 2018

Applies to:

Oracle WebLogic Server - Version 10.3.1 to 12.1.1.0
Information in this document applies to any platform.

Symptoms

A class implements Comparable (if @Override is removed, the problem doesn’t happen)

 

public class ClinHtmlField implements Comparable<ClinHtmlField> {
...
@Override
public int compareTo(ClinHtmlField other) {
...
}
...
}

 

2) A jsp page uses this class

 

<%
ntwxclinmod.dto.ClinHtmlField fd = (ntwxclinmod.dto.ClinHtmlField)pageContext.getAttribute("fd");
%>

 

3) The class source file is in current directory (if this java source file is not in classpath, the problem doesn’t happen)

 

.\ntwxclinmod\dto\ClinHtmlField.java

 

4) current directory is in classpath of the weblogic.appc ant script

 

<project name="ntwxclinmod" default="compile-jsp" basedir=".">

<target name="compile-jsp" description="pre-compile jsps">
<copy file="ntwxclinmod.war.orig" tofile="ntwxclinmod.war"/>
<java classname="weblogic.appc" fork="yes">
<classpath>
<pathelement location="D:/bea/WLS1211/wlserver_12.1/server/lib/weblogic.jar"/>
<pathelement path="."/>
</classpath>
<arg line="ntwxclinmod.war"/>
</java>
</target>

</project>

 

Here’s the stack trace:

 

compile-jsp:
[java]
[java]
[java] There are 1 nested errors:
[java]
[java] weblogic.utils.compiler.ToolFailureException: jspc failed with errors :weblogic.servlet.jsp.CompilationExcep
tion: test.jsp:2:2: The method compareTo(ClinHtmlField) of type ClinHtmlField must override a superclass method
[java] ntwxclinmod.dto.ClinHtmlField fd = (ntwxclinmod.dto.ClinHtmlField)pageContext.getAttribute("fd");
[java] ^-----------------------------------------------------------------------------------------------^
[java]
[java]
[java] at weblogic.servlet.jsp.jspc20.runBodyInternal(jspc20.java:468)
[java] at weblogic.servlet.jsp.jspc20.runJspc(jspc20.java:229)
[java] at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:141)
[java] at weblogic.servlet.tools.WARModule.compileWAR(WARModule.java:665)
[java] at weblogic.servlet.tools.WARModule.compile(WARModule.java:271)
[java] at weblogic.application.compiler.ToolsModuleWrapper.compile(ToolsModuleWrapper.java:107)
[java] at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.jav
a:25)
[java] at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:63)
[java] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
[java] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
[java] at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
[java] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:27)
[java] at weblogic.application.compiler.BaseCompiler.compile(BaseCompiler.java:19)
[java] at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:101)
[java] at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:35)
[java] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
[java] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
[java] at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
[java] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:27)
[java] at weblogic.application.compiler.Appc.runBody(Appc.java:203)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:158)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:115)
[java] at weblogic.application.compiler.Appc.main(Appc.java:263)
[java] at weblogic.appc.main(appc.java:14)
[java]
[java]
[java] <27/04/2012 10:29:23 PM CST> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile the application. R
ecompile with the -verbose option for more details about the issue.>
[java] Java Result: 1

Changes

 Upgraded from WLS 10.3.0 to WLS 12.1.1.0

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.