Foros de discusión

Liferay 6.0.6/Jboss 5.1 to Liferay 6.1.1/Jboss 7 Migration Issues

Justin Fleming, modificado hace 10 años.

Liferay 6.0.6/Jboss 5.1 to Liferay 6.1.1/Jboss 7 Migration Issues

New Member Mensajes: 2 Fecha de incorporación: 2/08/13 Mensajes recientes
Hi, I'm new to Liferay but have been tasked with helping the migration team move one of our portlets over to the new version of liferay and jboss 7.

We have modified our ant scripts to deploy directly to the jboss deployments folder to avoid the issue of liferay changing the order of our listeners in web.xml. This also prevents us from needing to start jboss twice to properly deploy.

For this particular portlet we have the following listeners:

 <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.liferay.portal.kernel.servlet.PluginContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener</listener-class>
    </listener>


The problem is that when starting liferay this portlet tries to call a liferay's PortletProps during a spring bean initialization (The Bean's constructor requires this call). So this results in a call to PortletProps that fails. After downloading liferay source and debugging I was able to determine the issue is a null portlet classloader on the following call.
PortletClassLoaderUtil.getClassLoader(), "portlet"


So temporarily I decided to hard code in the values we were trying to pull from the properties file to see if I could get any further. Now, during initialization of this bean, we also make calls liferay services for company and organization information etc. Calls like:

CompanyLocalServiceUtil.getCompanyByWebId(companyWebId)

&
OrganizationLocalServiceUtil.getOrganization(companyId, organizationName)

&
DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, folderName)
etc

So I end up with this root exception (BeanLocatior has not been set) while starting the server when any of these calls above are made. This particular one is for DlFolderLocalServiceUtil:

Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set
	at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:72) [portal-service.jar:]
	at com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil.getService(DLFolderLocalServiceUtil.java:525) [portal-service.jar:]
	at com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil.getFolder(DLFolderLocalServiceUtil.java:348) [portal-service.jar:]
	at mil.jpmis.dss.scenarioplayerportlet.DLExternalFileHelper.findFolder(DLExternalFileHelper.java:207) [classes:]
	at mil.jpmis.dss.scenarioplayerportlet.DLExternalFileHelper.<init>(DLExternalFileHelper.java:55) [classes:]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_38]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_38]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_38]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_38]
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) [org.springframework.beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	... 23 more</init>


So the problem seems to be I do not have the portlet context? BeanLocator is null for every liferay service util service we call. These services work in other portlets but they are NOT called during spring bean initialization. This code worked worked fine in LR6.0.6 with Jboss 5.1.0. So what do I have configured improperly or is this a configuration that is no longer supported?

Perhaps the PortletContextListener isn't doing it's job? I see this has been depricated but have not been able to find an alternative listener that will work. Now I'm diving into this project, jboss 7, and liferay head first so if I asked a bad question please bear with me, this is not my preferred approach to learning something as complex as liferay and jboss 7 but such is the way of things.

Thanks, Justin
Justin Fleming, modificado hace 10 años.

RE: Liferay 6.0.6/Jboss 5.1 to Liferay 6.1.1/Jboss 7 Migration Issues

New Member Mensajes: 2 Fecha de incorporación: 2/08/13 Mensajes recientes
If anyone needs additional information to help me resolve this please let me know.
thumbnail
Richard Oliver Legendi, modificado hace 10 años.

RE: Liferay 6.0.6/Jboss 5.1 to Liferay 6.1.1/Jboss 7 Migration Issues

Junior Member Mensajes: 35 Fecha de incorporación: 30/11/09 Mensajes recientes
Justin,

I'm facing a very similar issue, were you able to find any solutions? A hint would be highly appreciated.

Thanks in advance!