AnsweredAssumed Answered

Webscripts as Portlets (Alfresco 2.1)

Question asked by efoncubierta on Jul 16, 2008
Hi All,

I'm trying to use Webscript as Portlets in Liferay Portal. I followed the Jeff Pots tutorial, but in my case I'm not using Alfresco as part/plugin of Liferay. I have Alfresco and Liferay running at separate enviroments, then when I try to execute my WebScript as Portlets, I get problems with the application context.

At the begining, I defined portlet.xml, liferay-portlet.xml and liferay-display.xml. When I launched Tomcat I got a ClassNotFoundException (org.alfresco.web.script.portlet.WebScriptPortlet). I solve it, copying alfresco-core.jar and alfresco-web-client.jar to Liferay classpath. When I relaunched Tomcat I got a NullPointerException at line 93 in org.alfresco.web.script.portlet.WebScriptPortlet class. I get WebScriptPortlet.java from the SVN (rev 929):

90        initScriptUrl = config.getInitParameter("scriptUrl");
91        PortletContext portletCtx = config.getPortletContext();
92        WebApplicationContext ctx = (WebApplicationContext)portletCtx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
93        registry = (DeclarativeWebScriptRegistry)ctx.getBean("webscripts.registry");
94        serviceRegistry = (ServiceRegistry)ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);

Problem come from ctx object. It's null. ¿Can I run Alfresco Webscript as Portlet from another execution enviroment?

I'm using Liferay Portal 4.4.2 and Alfresco 2.1 Community.

Thanks. Regards.

Outcomes