Liferay Portlet Issue - liferay

Im new with liferay have a problem with portlet deployment using the plugins sdk,
Platform:
liferay-portal-tomcat-5.5-5.1.2,
liferay-plugins-sdk-5.2.2,
windows vista.
Problem:
I have successfully created a sample portlet with ant and deployed it into the hot-deploy folder. It is automatically picked up by the server but the console messages say that the portlet has been copied successfully and never registers it.. and i cant find it in the add application drop-down menu.. pls your help will be very appreciated.

I don't know if anything important changed in these versions, but you say you're using Liferay 5.1.2 with the plugin environment 5.2.2 - try with matching versions - at least on the second digit.
also, make sure that all required files are available - among them are WEB-INF/web.xml, WEB-INF/portlet.xml.
Create a new sample portlet with "create.bat" in the plugin SDK's portlet folder and deploy this - it should succeed. Then make sure that all config files from the new one are present in your current one.
How did you create your current portlet? What did you do/change?

Related

Liferay7 - module (portlet-provider) not refreshing

Im working with Liferay 7 and module development.
I created a module of type "portlet-provider" for can change the view of personalBar.
When I deploy it first time, it deploys ok, but after that, new deploys are not refreshing jsp files.
Is important to said that when I deploy the module, via blade or via gradle in Intellij, it deploys ok and also change the OSGI related folder, deleting old version and creating a new one with new jsp ok.
Even with that in a clear browser (recent removed all cache and temp) does no not refresh the personalBar view, related to new jsp file.
I saw this thread: https://web.liferay.com/community/forums/-/message_boards/message/88515142 , and tested the following.
1) Changed the tomcat timeZone, put the same timezone that I had in my desktop. (GMT-3 ) , it didn't work .
2) The only thing that seems to work is to clear all osgi state content and $liferay_home/work content and restart server as David said in above post.
But I need a way to can deploy theses modules without having to restart the server
Any help on this?
Thanks in advance
About my problem, I had a problem with the priority of the module so the module been deployed were not the same showed in portal.
At the beginning I set the "service.ranking:Integer="+Integer.MAX_VALUE , but I don't know why it was removed and for that the portlet showed was the portal default personal bar.

Unable to change runtime environment on server in Liferay Developer Studio

In Liferay Developer Studio, I am try to set the Runtime Environment for my local server. After selecting a runtime environment from the drop down, I then try to save the change and get the following message:
The server cannot be saved for the following reasons: [Overview] Changing runtime base directories is not supported.
Is this a change I need to do manually in a configuration file, or should I going elsewhere to change the runtime environment?
It seems to be a known issue in Liferay IDE, check the issue.
You may have a clean version of the Liferay-Tomcat bundle given along with the Liferay IDE. What I recommand you is to create a new server that refers to this runtime environnement.
If you don't have a clean version of the Liferay-Tomcat bundle you can download new one from Liferay official site.
I found a way to get the existing runtime evironment changed.
I first had to go to the server properties and select "Switch Location". This moved the server properties from "[workspace metadata] to my workspace/servers/ directory.
Inside the .server file, I just had to change the runtime-id property to one of my predefined runtimes, in my case...
runtime-id="Liferay v6.2 EE (Tomcat 7)"
My Liferay server is now working as expected.

Portlet not getting deployed

I have this strange problem at which I have spent stupid amount of time.
To build my portlet, I haven't used sdk and I am using my own ant script do the job. It works all well till this wierd situation.
I am basically using a lot class from portal-service.jar to change role settings etc. When I include it in my build path and deploy it again. It doesn't get deployed. On shell it shows the deployment, below is the log:
Copying 1 file to C:\liferay-portal\tomcat-6.0.29\webapps\ch1_HelloWorld
Deleting directory C:\liferay-portal\tomcat-6.0.29\temp\20121016060846753
06:08:47,887 INFO [PortletAutoDeployListener:81] Portlets for C:\liferay-portal\tomcat-6.0.29\deploy\ch1_HelloWorld.war copied successfully.
Deployment will start in a few seconds.
16 Oct, 2012 6:08:56 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ch1_HelloWorld]
That's it! Later it doesnt show (as it does normally) that the portlet is available to use. In browser, under the "add tab", the option is never shown. What can be the issue for this. The portlet is a simple hello world portlet that access role information
I am basically using a lot class from portal-service.jar to change role settings etc. When I include it in my build path and deploy it again. It doesn't get deployed. On shell it shows the deployment, below is the log:
Did you put portal-service.jar to WEB-INF/lib? If so remove it from there and add it to some other (my_project/lib) directory than add it to build path.
Also make sure that after deployment portal-service.jar is not in your deployed WEB-INF/lib.
Better yet, first undeploy than redeploy.
Is this properly set in your liferay-display.xml ?
<display>
<category name="yourCategoryUnderAddMenu">
<portlet id="yourPortletId"></portlet>
</category>
</display>
Late answer, but maybe it will help someone:
- just shutdown your server;
- delete the portlet from the "webapps" tomcat folder;
- you should delete "temp" and "work" folders content;
- restart your server and deploy your portlet.
Everything should be OK.
I do not know why this happens, but I encounter this problem many times and fix it with the same solution.
Bye!
This is normally the case when the auto.deploy.dest.dir is pointing to the wrong place. Firstly, i came to realise the common mistake is to make this point to liferay_home/deploy which is not correct. This property specifies the destination of exploded files. For tomcat, it would be the webapps directory e.g. /opt/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps
In other words, tomcat, on receiving the exploded files,carries on. In your case, tomcat was never realising any changes.
Delete the old war from the webapps, and put your new war manually in the Deploy folder.
It looks like you might be deploying by copying it to the webapps folder, instead of the deploy?
go to plugins-sdk folder.
open build.userName.properties (In my case name of file is build.asif.properties)
open it..
add the below line
auto.deploy.dir = D:\\nWorkSpace\\liferay-portal-6.2.0-ce-ga1\\deploy
"D:\nWorkSpace\liferay-portal-6.2.0-ce-ga1\deploy" is the path of my deploy direcotory.
where nWorkSpace is my workspace. My problem is resolve.
I tried all of the above solutions but my issue was not resolved on a Liferay 6.2 EE sp2 bundle.
I was finally able to resolve portlet deployment issue by cleaning all the portlet xml files except the ROOT.xml from the Tomcat home/conf/Catalina/localhost folder.
This tip above was provided on the following post - how ever the blog post no longer exits and had to find in the archives below with google search in case someone is interested. It saved me hours of effort.
https://www.liferay.com/community/forums/-/message_boards/message/2124111
http://archive-ro.com/page/754918/2012-11-26/http://blog.ropardo.ro/2010/08/09/liferay-deployment-will-start-in-a-few-seconds-and-how-to-realy-start/

Unable to view deployed Liferay portlet in the add >> more option

I have created a sample Liferay portlet and it has successfully deployed. But, the eclipse console didn't say "1 portlet is ready for use". And, I couldn't find this portlet in the Add >> More.. option on a Liferay page.
As Mark mentioned, it is undeterministic and it sometimes happen. I usually follow the following steps and after this it works normally.
Steps:
remove all the references of the portlet from webapps.
stop the server
deploy the portlet's WAR
restart the server
check the logs if the portlet is deployed.
If possible try to build the WAR again and deploy the new WAR, and follow the previous steps.
Also if this doesn't work try to clear the temp and work directory and again try the previous steps.
Hope this helps.
I have been fighting with this problem for a day. For me it was two things: wrong property of
liferay.home
inside
portal-setup-wizard.properties
Only after correction I was able too see in tomcat logs that my liferay-plugins had higher version than liferay itself. I redownload plugins with correct version and new plugin deployed correctly.
If you've done all the cleaning etc. and it still does not work, there may be another reason for not showing. If you have - for some reson - deactivated the portlet in Liferay, it will remember the setting even though you have undeployed it several times.
So, you must go to Control Panel > App Manager > All Apps > Your portlet name and activate it again!
That is undeterministc but usual error. Try to undeploy the portlet - delete portlet directory under tomcat/webapps and try to deploy again.

How to migrate Liferay portal from one windows machine to other?

Liferay migration from one server to another help required. Can anyone share there steps for migration of Liferay portal 5.2.3 from one server to another. I am using Windows + Tomcat + MySql.
I have uploaded whole tomcat folder to the new windows machine and imported the database too with the corresponding change to the configuration file like Database details.
But after starting the tomcat server it is showing some error like "Unable to load repository http://plugins.liferay.com". Any idea why I am getting this error ?
These are the steps that I have followed and able to migrate the Liferay successfully:
Take the backup of Liferay files and database from first windows machine.
Install the same version of Liferay (Say Liferay 5.2.3) on second windows machine.
Shut down Liferay.
Import the database on new system.
Add portal-ext.properties with relevant entries. (e.g Datbase Name, User Name , Pasword etc)
Add \liferay-portal-5.2.3\data\document_library files from old machine.
Start the tomcat. It will automtically do the rest.
NOTE: In the above method I have not deployed Theme and custom plugins etc, you have to deploy Theme and custom plugins also that are used on old system.
Lifery is trying to connect to plugin repository to find whether there are updates for plugins.
Does your new machine have internet conectivity?
Also you have options to ignore that message or configure liferay not to check for updates.
For later put in portal-ext.properties
plugin.repositories.trusted=
plugin.repositories.untrusted=
UPDATE:
If behind proxy create (if not existent) system-ext.properties (beside portal-ext.properties) and add
com.liferay.util.Http.proxy.host=proxy_host
com.liferay.util.Http.proxy.port=proxy_port
Change proxy_host and proxy_port with your values.
Also remove from portal-ext.properties if you want liferay to check repositories
plugin.repositories.trusted=
plugin.repositories.untrusted=

Resources