Unable to successfully deploy liferay portlet - liferay

I have been following the tutorial in https://dev.liferay.com/develop/learning-paths/mvc/-/knowledge_base/6-2/writing-your-first-liferay-application and built the portlet for liferay as described. I have a working liferay environment and can add and remove all of the standard portlets.
When trying to push the porlet that I've made to the server I can see that it has correctly deployed to the server. See log below.
INFO: Deploying web application directory /Users/marc.thomas/Downloads/liferay/bundles/tomcat 7.0.62/webapps/guestbook-portlet
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /Users/marc.thomas/Downloads/liferay/bundles/tomcat-7.0.62/webapps/guestbook-portlet has finished in 900 ms
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.HostConfig deployDirectory
I have put the full log and the code in my github account here: https://github.com/marcthomas2013/liferay-portlet
In this log there is no presence of liferay picking up the portlet and deploying it, even though it is deployed to tomcat.
I can't see what else I can check now. Can anyone help?

When you deploy your portlet plugin, copy the WAR file to Liferay's deploy folder (find it in /Users/marc.thomas/Downloads/liferay/bundles/). Liferay will take care of injecting some required components and deploy it to tomcat itself.
Just deploying the build result to an application server typically does not work (unless you specifically change the build process to include the injected features)
Correction: According to the log file you seem to have moved your installation after the initial install:
10:49:49,077 INFO [localhost-startStop-1][AutoDeployDir:139] Auto deploy scanner started for /Users/marc.thomas/Downloads/liferay-portal-6.2-ce-ga6/deploy
That's where you need to drop your build result.

Related

Deploy standalone war file in liferay tomcat

I am trying to deploy a simple standalone war file in liferay tomcat version. It is neither a portlet nor theme. How can I configure the war file to be deployed as a standalone war in liferay tomcat.
I am getting following error
16:45:51,175 ERROR [localhost-startStop-1][HotDeployImpl:211]
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error
registering portlets for travelinsurancetravelinsurance
So, I simply want to skip this registration as a portlet and access in by the url. Is this possible?
What did you try so far? Just deployed to tomcat webapps directory? That should work. Make sure your plugin does not have any Liferay-recognized deployment descriptor, then everything should work and any complaints by Liferay can be ignored. Don't go through Liferay's deploy directory if you're not deploying a Liferay component.

Liferay portlet doesn't deploy after change from JBoss to Tomcat

I develop a portlet using Liferay, JSF and JBoss and everything is running perfect. After a time my team decided to change the container to Tomcat and my problem began. My portlet doesn't deploy anymore, but just shows me this message during deploy:
12:07:35,599 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing my-portlet-1.0.war
12:07:35,602 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:79] Copying portlets for /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war
12:07:35,624 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:859] Deploying my-portlet-1.0.war
Expanding: /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war into /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/classes
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/classes
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/jsp
12:07:36,144 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2383] Modifying Servlet 2.5 /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/web.xml
Copying 32 files to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Deleting directory /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727
12:07:36,242 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:91] Portlets for /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war copied successfully. Deployment will start in a few seconds.
Set 25, 2015 12:07:42 PM org.apache.catalina.startup.HostConfig deleteRedeployResources
INFORMAÇÕES: Undeploying context [/my-portlet-1.0]
Set 25, 2015 12:07:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/my-portlet-1.0] created a ThreadLocal with key of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMapThreadLocal] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMapThreadLocal#1848e169]) and a value of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMap] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMap#58c6c0f3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Set 25, 2015 12:07:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/my-portlet-1.0] created a ThreadLocal with key of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMapThreadLocal] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMapThreadLocal#60a5bf0d]) and a value of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMap] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMap#21a2200d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Set 25, 2015 12:07:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory /portal/liferay-core/environment 6.2-ga2/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Set 25, 2015 12:07:43 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFORMAÇÕES: validateJarFile(/portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/2-my-portlet-1.0/WEB-INF/lib/servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
12:07:45,237 INFO [StartupListener:50] Context initialized for contextPath=[/my-portlet-1.0]
12:07:45,247 INFO [StartupListener:77] Copied input-editor.jsp from LiferayFaces JAR to context path file=[/portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/2-my-portlet-1.0/resources/liferay-ui/jsp/input-editor.jsp]
12:07:45,247 INFO [BridgeSessionListener:96] Context initialized for contextPath=[/my-portlet-1.0]
I tried to resolve the problem like this already:
Downgrading tomcat to version 7
Downgrading liferay to 6.2 GA3 and GA2
Removing any managed bean calls
Removing all JBOSS configuration from portlet (pom libs and web.xml)
Removing tomcat listeners for
MemoryLeak prevention
This kind of issue is probably due to the fact that JBoss provides certain jars to the global classpath and Tomcat does not. Since you are migrating from JBoss to Tomcat, it is likely that you need to include some more jars in your war's WEB-INF/lib. Make sure that you have the JSF API and Impl, and you may need a CDI implementation such as Weld as well. Check that the appropriate dependencies are included in your war's WEB-INF/lib, and then undeploy and redeploy your portlet.

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/

Problem deploying my application to Azure

I just created a Windows Azure account. When I try to deploy from VS2010 I get the following messages that just keep repeating on and on:
2:17:43 PM - Warning: All role instances have stopped
2:18:23 PM - Instance 0 of role MvcApplication1 is busy
2:18:59 PM - Instance 0 of role MvcApplication1 is stopped
2:18:59 PM - Warning: Instance 0 of role MvcApplication1 appears to be cycling and unable to start.
2:32:44 PM - Warning: All role instances have stopped
2:33:17 PM - Warning: All role instances have stopped
2:33:49 PM - Instance 0 of role MvcApplication1 is busy
Does anyone know how I can debug or find out what's wrong? I don't know what to do at this point.
I ran into this problem myself. Mine had to do with not having the assemblies packaged in my service when publishing. Use the following steps to resolve this:
1-Get all of the Deployable Dependencies into your project
Use the "Add Deployable Dependencies" feature from VS2010 SP1 and alluded to here in Scott Hanselman's blog post about BIN Deploying (see "Interesting Note" at the bottom of the post).
Essentially, right click on your project and you'll see it within the "Add" section. A dialog box will pop up with 3 choices (in my case 2 were accessible). After selecting them, a new folder will be added to your project called "_bin_deployableAssemblies" which will contain any assemblies your project needs to run in the cloud which the References you have are dependent upon.
If you don't have VS2010 SP1, then go ahead and follow the advice in Scott's blog post (which essentially does what the feature does, just you're doing it).
2-Check your References for Copy Local = true
Once you've done this, if you still have problems, start checking your reference assemblies for any References you have which are not expected in the cloud OS you are targeting, and make sure to set Copy Local = true.
3-Check your References for the Windows Azure assemblies
Because I created my Web Project first, I had to manually add the Windows Azure assemblies to my Web Project that was the target of the Web Role. (Microsoft.WindowsAzure.Diagnostics, Microsoft.WindowsAzure.ServiceRuntime, Microsoft.WindowsAzure.StorageClient)
4-If you're using MVC 3, use the workaround
Take David Makogon's advice and follow the steps on Steve Marx' blog post.
Debugging Azure apps which get stuck in this loop is hard.
The cause is normally that your role simply won't start because of a build problem.
In this particular case, I'd guess that maybe you haven't included one or more of the MVC assemblies inside your package - check that the MVC references are marked with Copy Local - e.g. see http://msdn.microsoft.com/en-us/library/dd410407.aspx (and other links depending on which MVC release you are using!)
If your MVC application is MVC3, the newest MVC libraries are not installed in the Windows Azure guest OS image yet. See Steve Marx' blog post for two easy ways to install the MVC3 libraries.

Liferay Portlet Issue

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?

Resources