Lukas Grygar's

Personal enterprise Java web development blog.

Liferay 6.2 on Apache Tomcat 7: How to fix ClassNotFoundException

If you’re getting ClassNotFoundException while deploying Liferay portlet (mine is named Foobar) and you think your code is all right, maybe you should try to delete directories listed bellow.

I assume that you performed mvn clean install (in case you build with Apache Maven), so all classes are availabile (this applies in case if you have some classes generated through JAXB etc.).

But first of all remove portlet and stop server, bellow are steps to perform using Eclipse IDE:

  • In Eclipse Liferay’s perspective in tab Servers right click on portlet name and then click on remove.
  • Then stop server.

After that use some commander and delete contents of directories listed bellow.

Delete whole content of directories temp and work:


Delete only folder Foobar-portlet in directory webapps (don’t delete whole content of directory webapps, otherwise you have to upload portal dependencies after that and that’s not desirable in our case):


You could also delete Foobar-portlet.xml from /conf/Catalinalocalhost


Tags: liferay  liferay-portal 

Share on: Twitter  Facebook  Google+ 

Previous post: Spring REST service: GET path variable gets truncated after dot '.' and HTTP Error 406 'Not acceptable' solution

Next post: Liferay: How to create expando (custom) attributes and roles programatically

Related posts: