Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Milan Kostoláni
Simple portlet not working
August 7, 2012 5:25 AM
Answer

Milan Kostoláni

Rank: Junior Member

Posts: 92

Join Date: July 26, 2012

Recent Posts

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:
 1<entity name="Test" local-service="true" remote-service="false">
 2<column name="testId" type="long" primary="true"/>
 3               
 4        <column name="testName" type="String"/>
 5       
 6        <column name="companyId" type="long" />
 7        <column name="groupId" type="long" />
 8       
 9        <order by="asc">
10            <order-column name="testName" />
11        </order>
12       
13        <finder name="G_D" return-type="Collection">
14            <finder-column name="groupId" />
15            <finder-column name="testName" />
16        </finder>
17       
18        <finder name="GroupId" return-type="Collection">
19            <finder-column name="groupId" />
20        </finder>
21        <finder name="CompanyId" return-type="Collection">
22            <finder-column name="companyId" />
23        </finder>


impl:
 1public Test addTest(Test newTest, long userId)
 2            throws SystemException, PortalException{
 3                Test test = testPersistence.create(
 4                        counterLocalService.increment(
 5                                Test.class.getName()));
 6               
 7                resourceLocalService.addResources(
 8                        newTest.getCompanyId(),
 9                        newTest.getGroupId(),
10                        userId,
11                        Test.class.getName(),
12                        test.getPrimaryKey(),
13                        false, true, true);
14               
15                test.setCompanyId(newTest.getCompanyId());
16                test.setGroupId(newTest.getGroupId());
17                test.setTestName(newTest.getTestName());
18            
19                testPersistence.update(test, false);
20                return test;
21            }

portlet:
 1public void addTest(ActionRequest request, ActionResponse response)
 2            throws Exception{
 3                ThemeDisplay themeDisplay =
 4                        (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
 5                Test test = ActionUtil.testFromRequest(request);
 6               
 7                if(ReqValidator.validateTest(test)){            
 8                    TestLocalServiceUtil.addTest(test, themeDisplay.getUserId());            
 9                }
10                }


view.jsp:
 1<portlet:actionURL name="addTest" var="addTestURL"/>
 2
 3    <aui:form action="<%= addTestURL.toString() %>" method="post">
 4        <aui:fieldset>
 5            
 6            <aui:input name="testName" size="25" />
 7       
 8            <aui:button-row align="right">
 9                <aui:button type="submit" value="Register Dog" />
10            </aui:button-row>
11        </aui:fieldset>
12    </aui:form>
David H Nebinger
RE: Simple portlet not working
August 7, 2012 7:59 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6269

Join Date: September 1, 2006

Recent Posts

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
RE: Simple portlet not working
October 21, 2012 11:50 PM
Answer

Christian Warmark

Rank: New Member

Posts: 6

Join Date: June 17, 2011

Recent Posts

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]][PluginPackageUtil:1033] Reading plugin package for TemplateProcessor-ext
03:06:41,853 WARN [ContainerBackgroundProcessor[StandardEngine]][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]][HotDeployImpl:178] Deploying TemplateProcessor-ext from queue
03:06:42,340 INFO [ContainerBackgroundProcessor[StandardEngine]][PluginPackageUtil:1033] Reading plugin package for TemplateProcessor-ext
03:06:42,340 WARN [ContainerBackgroundProcessor[StandardEngine]][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
Attachments: TemplateProcessor-ext.war (6.3k)
Oliver Bayer
RE: Simple portlet not working
October 22, 2012 1:20 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 867

Join Date: February 18, 2009

Recent Posts

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
RE: Simple portlet not working
October 22, 2012 2:18 AM
Answer

Christian Warmark

Rank: New Member

Posts: 6

Join Date: June 17, 2011

Recent Posts

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
RE: Simple portlet not working
October 22, 2012 5:11 AM
Answer

Siby Mathew

Rank: Expert

Posts: 259

Join Date: March 4, 2011

Recent Posts

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