I want to extend the users admin portlet that is located in the control panel. I hooked the jsp and wanted to use methods from the service builder that are in the same hook as the jsp.
The problem is that the jsp can not find the classes. So I copied the *-service.jar to the tomcat lib/ext folder and removed it from the hook when deploying it.
But that doesn’t work. After a while I get an exception that says Cache is not alive or this web application instance has been stopped already.
Is there a way to use methods from my custom service builder in the hooked jsp ?
The approach you have taken is correct, i.e. to put the
*-service.jarinside[TOMCAT_HOME]/lib/extand removing the jar from the hook.The error might be because the hook may not have been properly undeployed, you may get some idea from this forum post. So my suggestion would be to:
[TOMCAT_HOME]/lib/extWhenever you remove a
jarfrom a plugin-project and then just deploy without undeploying the portlet, sometimes you may notice that thejarfile may be still present in the deployedwebapps/plugin-project‘s directory, and this might be the case here as well. Also, whenever you put something in the global classpath (i.e.[TOMCAT_HOME]/lib/ext) you need to restart the server.Also, don’t forget to
importthe class in the JSP :-), just in case …