While deploying the portlets that throws the class cast exception, do the following:
- deploy the application in the liferay/deploy.
- shutdown the liferay
- move the service jar from the WEB-INF/lib from the portlet to the /lib/ext of the tomcat
- remove the temp and work folder from the tomcat
- restart the tomcat.
OR ...what worked for me was
- change the package name while building the service.xml in the service.xml file
Or if you have already built the service, do these steps
Just delete the 5 packages that are created from the service builder,
i.e
model.impl
service.base
service.http
service.impl
service.persistence
delete the .xml generated in the META-INF folder except for the file ext-spring.xml
- delete the XX-service.jar from the docroot/lib folder
- delete the service folder in the docroot folder.
- change the package name in the service.xml and build the path.