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