How to solve JSP Error unable to find class on Liferay Portal’s ext environment

My friend had a little problem when he developed portlet using ext-environment with Liferay 5.0.0 and tomcat 6.0. The problem is, after deploying all files to tomcat ( using ant deploy on ext ), the jsp files seem unable to find the classes. The error message is this :

An error occured at line: 195 in the generated java file
Only a type can be imported. com.ext.portlet.firm.model.Firm resolves to a package

Stractrace:11:12:07,206 ERROR [IncludeTag:52] org.apache.jasper.JasperException: Unable to compile class for JSP:

(As you can see from the image above as well).

This is how to solve it :

1. Open $tomcat_home/conf/catalina.properties

2. Fine a line which is like this :

common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext/*.jar

and change it to become like this.


common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext/*.jar,${catalina.home}/common/lib/ext/*.jar

We need to modify build-parent.xml (line 79) under ext-impl folder to become like this

               <copy todir="classes">
                       <fileset dir="src">
                               <include name="*/dependencies/**" />
                               <include name="content/**" />
                               <include name="META-INF/.xml" />
                       </fileset>
               </copy>

to make sure that folder content and META-INF/*.xml copied to ext-impl.jar. (Credit to Abdul Malik for build-parent.xml modification)
Tested on Liferay 5.0.0 with Tomcat 6.0. Thanks to Abdul Malik for the image.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: