JSP not compiling due to: "Only a type can be imported. [class name] resolves to a package" (Doc ID 1510199.1)

Last updated on JANUARY 01, 2016

Applies to:

Oracle WebCenter Sites - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

A custom JSP does not compile, and the following type of error is seen in the logs:

"[fatwire.logging.cs.request] Exception including resource /jsp/cs_deployed/<jsp_path_and_file_name>.jsp
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [line #] in the generated java file
Only a type can be imported. [class name] resolves to a package"


For example:

[fatwire.logging.cs.request] Exception including resource /jsp/cs_deployed/Sample/Test/Example.jsp
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 29 in the generated java file
Only a type can be imported. com.test.examples.SampleClass resolves to a package


Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms