Foros de discusión

Simple portlet not working

Milan Kostoláni, modificado hace 11 años.

Simple portlet not working

Junior Member Mensajes: 92 Fecha de incorporación: 26/07/12 Mensajes recientes
Hello everyone,

I have done one bigger portlet, which for some reason isnt working, so I tried to make smaller one, here is the main code of portlet, but for some reason even this one is not working and even show error "BeanLocator is null for servlet context test2-portlet"
"BeanLocator has not been set for servlet context test2-portlet"


and while deploying "WARN [pool-2-thread-2][PluginPackageUtil:1131] Plugin package on context test2 cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file" warning

service.xml:
<entity name="Test" local-service="true" remote-service="false"> 
<column name="testId" type="long" primary="true" />
				
		<column name="testName" type="String" />
		
		<column name="companyId" type="long" />
		<column name="groupId" type="long" /> 
		
		<order by="asc"> 
			<order-column name="testName" />
		</order>
		
		<finder name="G_D" return-type="Collection">
			<finder-column name="groupId" />
			<finder-column name="testName" />
		</finder>
		
		<finder name="GroupId" return-type="Collection">
			<finder-column name="groupId" />
		</finder>
		<finder name="CompanyId" return-type="Collection">
			<finder-column name="companyId" />
		</finder></entity>


impl:
public Test addTest(Test newTest, long userId)
			throws SystemException, PortalException{
				Test test = testPersistence.create(
						counterLocalService.increment(
								Test.class.getName()));
				
				resourceLocalService.addResources(
						newTest.getCompanyId(), 
						newTest.getGroupId(), 
						userId,
						Test.class.getName(), 
						test.getPrimaryKey(),
						false, true, true);
				
				test.setCompanyId(newTest.getCompanyId());
				test.setGroupId(newTest.getGroupId());
				test.setTestName(newTest.getTestName());
			
				testPersistence.update(test, false);
				return test;
			}

portlet:
public void addTest(ActionRequest request, ActionResponse response)
			throws Exception{
				ThemeDisplay themeDisplay =
			            (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
				Test test = ActionUtil.testFromRequest(request);
				
				if(ReqValidator.validateTest(test)){			
					TestLocalServiceUtil.addTest(test, themeDisplay.getUserId());			
				}
				}


view.jsp:
<portlet:actionurl name="addTest" var="addTestURL" /> 

	<aui:form action="<%= addTestURL.toString() %>" method="post"> 
		<aui:fieldset>
			
			<aui:input name="testName" size="25" /> 
		
			<aui:button-row align="right"> 
				<aui:button type="submit" value="Register Dog" /> 
			</aui:button-row>
		</aui:fieldset> 
	</aui:form>
thumbnail
David H Nebinger, modificado hace 11 años.

RE: Simple portlet not working

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Milan Kostoláni:
Hello everyone,

I have done one bigger portlet, which for some reason isnt working, so I tried to make smaller one, here is the main code of portlet, but for some reason even this one is not working and even show error "BeanLocator is null for servlet context test2-portlet"
"BeanLocator has not been set for servlet context test2-portlet"


and while deploying "WARN [pool-2-thread-2][PluginPackageUtil:1131] Plugin package on context test2 cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file" warning


Again?

This would seem to be another case of not using the Liferay IDE to create your project. Manually creating your project is prone to error in that you end up missing required stuff.

So it would seem that test2 is incomplete and fails to deploy. The bean locator is null is due to that failed deployment (since it is not deployed, it's services are unavailable and consumers of it's service get the 'bean locator is null' exception).
Christian Warmark, modificado hace 11 años.

RE: Simple portlet not working

New Member Mensajes: 11 Fecha de incorporación: 17/06/11 Mensajes recientes
Hello.

I have the same problem. We have recently upgraded our production environment from "6.1.0 GA1 CE" to "6.1.1 GA2 CE". Everything seams to be working except we cant deploy any ext-plugins. They all work fine in the development environment but when we put them in the upgraded production environment, it feels as they are not deployed correctly.

For example I have created an ext-plugin that fixes a bug in the TemplateProcessor class. When its deployed this lines are written to catalina.out.
The war file is attached.

Any suggestions?

03:06:33,804 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:177] Processing TemplateProcessor-ext.war
03:06:33,804 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][ExtAutoDeployListener:48] Copying extension environment plugin for /opt/liferay/liferay-portal-6.1.1-ce-ga2/deploy/TemplateProcessor-ext.war
03:06:33,805 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:1674] /opt/liferay/liferay-portal-6.1.1-ce-ga2/deploy/TemplateProcessor-ext.war does not have a WEB-INF/liferay-plugin-package.xml or WEB-INF/liferay-plugin-package.properties
03:06:33,805 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:763] Deploying TemplateProcessor-ext.war
03:06:33,805 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:1674] /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/TemplateProcessor-ext does not have a WEB-INF/liferay-plugin-package.xml or WEB-INF/liferay-plugin-package.properties
Expanding: /opt/liferay/liferay-portal-6.1.1-ce-ga2/deploy/TemplateProcessor-ext.war into /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/20120928030633806
Copying 1 file to /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/20120928030633806/WEB-INF/classes
Copying 1 file to /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/20120928030633806/WEB-INF/classes
03:06:33,836 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2083] Modifying Servlet 2.4 /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/20120928030633806/WEB-INF/web.xml
Warning: META-INF/MANIFEST.MF modified in the future.
Warning: WEB-INF/classes/com/liferay/portlet/layoutconfiguration/util/velocity/TemplateProcessor.class modified in the future.
Warning: META-INF modified in the future.
Copying 9 files to /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/TemplateProcessor-ext
Copying 1 file to /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/TemplateProcessor-ext
Deleting directory /opt/liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/20120928030633806
03:06:33,856 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][ExtAutoDeployListener:55] Extension environment for /opt/liferay/liferay-portal-6.1.1-ce-ga2/deploy/TemplateProcessor-ext.war copied successfully. Deployment will start in a few seconds.
28-Sep-2012 03:06:41 org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/TemplateProcessor-ext]
03:06:41,851 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1033] Reading plugin package for TemplateProcessor-ext
03:06:41,853 WARN [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1131] Plugin package on context TemplateProcessor-ext cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
28-Sep-2012 03:06:41 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
03:06:42,339 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][HotDeployImpl:178] Deploying TemplateProcessor-ext from queue
03:06:42,340 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1033] Reading plugin package for TemplateProcessor-ext
03:06:42,340 WARN [ContainerBackgroundProcessor[StandardEngine[Catalina]]][PluginPackageUtil:1131] Plugin package on context TemplateProcessor-ext cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
28-Sep-2012 03:06:42 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oliver Bayer, modificado hace 11 años.

RE: Simple portlet not working

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
Hi Christian,

I think I've read somewhere in the forums or blogs that they've switched from "liferay-plugin-package.properties" to "liferay-plugin-package.xml".
TemplateProcessor-ext cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file

Maybe it solves this issue if you update the eclipse Liferay IDE and re-build your plugin.

HTH Oli
Christian Warmark, modificado hace 11 años.

RE: Simple portlet not working

New Member Mensajes: 11 Fecha de incorporación: 17/06/11 Mensajes recientes
I am using the latest version of eclipse, liferay IDE and Liferay plugins SDK 6.1.1 GA2. There is never any liferay-plugin-package.xml file created in my project. Could you point me in any direction on how to create liferay-plugin-package.xml?
Siby Mathew, modificado hace 11 años.

RE: Simple portlet not working

Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi Christian,
In my IDE, the liferay-plugin-package.xml is automatically created for new layout templates.
This XML is having the same configuration as the liferay-plugin-package.properties.
As per my understanding, plugins were previously relying on this xml instead of the properties file.

Thanks,
Siby