How to deploy Liferay portlets using WAS Administration Console - websphere

After deploying Liferay war on WAS 7.0,
How to deploy any of the liferay plugins war?
I can deploy plugins war in a same way as I deployed Liferay portal war and it also shows that apllication is started and running but I can't see the portlet in Liferay's Add more option or any where.
Any Help is Appriciated.
Thanks.

You need to do it in two steps:
Copy the portlet WAR file into Liferay's autodeploy directory. Liferay will process the plugin configuration files and generate a new WAR into a destination directory.
Deploy this newly generated WAR using Websphere admin console.
The path where Liferay leaves the preprocessed WAR is configurable via the auto.deploy.* properties in the portal.properties file. Take a look there to see where to look for the file.

Related

I can't see my WAR file in webapps folder of Tomcat

I can't see my WAR file in webapps folder of my Tomcat server directory.
My project is portal project and I am using Liferay portal technology hosted on Tomcat server.
For deploying, I am using Maven configured goal name 'deploy'.
When I deploy the portlet module it generated the war file and I can see the file in deploy folder of my Liferay server but when I start the tomcat server it should ideally generate/move WAR file in 'webapps' folder of tomcat server directory but it is not doing that.
I have tried multiple options like deleting and re-configuring the server, setting Dynamic web-module version to 3.0 from 2.5 (as suggested in one of the post at StackOverflow) but nothing works for me.
I am stuck in this issue for long time and any help will be a great help..
Thanks
I'm assuming that you're using Liferay 7 or Liferay DXP. As these versions are built on OSGi, they're transforming the WAR files into an OSGi bundle (so called WAB, Web Application Bundle) and do not deploy them to tomcat, as you observe.
Prior versions did this, but not the current one.
As you don't state what else you'd expect: This is your answer - you're right, it's not there.
If you don't use Liferay 7 or DXP: Elaborate.

How to undeploy a portlet from Liferay 7?

I am learning how to create portlets on Liferay 7 CE GA 3 portal platform.
For this, I created few test portlets using maven, gradle, by following the tutorials given in liferay site.
But now, I need to remove those portlets from the server. Whenever I start the tomcat server given inside Liferay's bundle, those previously deployed portlets comes up on the web page. I have tried but I can't find the war files deployed inside tomcat, in order to delete them.
I tried deleting the portlets folder inside work directory of liferay and also clearing the temp directory, but that didn't helped.
PS: I was manually deploying the portlets by copying the war file to 'deploy' directory of liferay bundle.
I'm using Liferay 7.0 DXP bundled with tomcat 8.
I tried deleting/deactivating deployed modules from Control Panel using Admin credentials. That just worked for me in that instance, but If I restart the server again these modules were deployed on the server startup.
The below solution worked for me with the above-mentioned configurations.
{LIFERAY_HOME}/osgi/modules -- jar modules
{LIFERAY_HOME}/osgi/war -- war modules
{LIFERAY_HOME}/osgi/marketplace -- any .lpkg files that were downloaded from Liferay's Marketplace
As you don't state the version of Liferay that you're using:
In 6.x, you'll find the WAR files (or web applications) wherever your application server deploys them - e.g. in tomcat/webapps. You only need to undeploy them from Tomcat (or your appserver) and they will also be undeployed from Liferay.
In 7.0 and DXP, those files will be deployed to the OSGi runtime and the artifacts end up in Liferay's /osgi/ folder, most likely /osgi/war - or if you package as JAR bundles in /osgi/modules (otherwise search for known filenames in /osgi subdirectories
Go to Liferay Control panel -> App Manager -> Search 'Your portlet' and then uninstall in Liferay 7.4

How to create deployable springboot war

I am trying to create a maven spring boot application to be deployed in Tomcat. I am following what is suggested in Spring docs and other stackoverflow suggestions- war, Application.java extending SpringBootServletInitializer, removing spring-boot-maven-plugin from build plugins etc. War file is generated and is deployed in tomcat. But what I found is all static files are packaged under /WEB-INF/classes folder and I am not able to access the page. My project structure is as below:
Can anybody tell me how I can package the war properly to be deployed in Tomcat.
That doesn't change anything.
If you put your static assets in src/main/resources/static (and they end up in WEB-INF/classes/static), Spring Boot will serve them properly. So a src/main/resources/static/foo.png will be available at http://localhost:8080/your-context/foo.png if the context of your webapp is your-context.
Regarding the configuration, you can also go on start.spring.io, click advanced and chose war and you'll get an empty project pre-configured.
Or you can click this: https://start.spring.io/#!packaging=war
The issue is because of version issue. I compiled the application with Java 8 and deployed it in tomcat running under JRE 7. It may help someone facing the same issue.
I got the clue from the below post:
Spring boot war file deploy on Tomcat.

Deploying a 'JAR' file instead of 'WAR' file for Spring-MVC and Maven

I am working on a Spring-MVC application which uses Maven. In the POM.xml I noticed that I can denote the file-type in which I can select if I want to deploy the project as a JAR or WAR.
Mostly I select a WAR file and then deploy it in Apache tomcat. My question is, If the application is Spring-MVC based, with Spring-Security, Hibernate and other libraries, can I package it as JAR by simply denoting it in POM.xml and deploy it in Apache webserver instead of using Apache tomcat? Or do I need to make some modifications somewhere for this to work. Kindly let me know. Thank you.
No, you can't. Apache httpd knows nothing about how to handle jar files.
What you can do though is to provided an embedded webserver (such as jetty) in your package and define in your MANIFEST.MF file a main class that will launch it and register your application to it.
That way you can package is a an auto-executable jar, or as a war that can be run on his own or deployed in a classical webserver.

How to convert Maven War project to an EAR project in Openshift?

I have created an JEE application in Openshift using the JBOSS AS 7.1 cartridge a Maven project have been generated with the War deployment format.
I need to use EJBs into the application but the War format cannot hold EJB so I changed the from War to Ear, the problem is that when I deploy the Ear the application does not Work(404 Error when I access the home page).
Is there any simple solution in order to make this work?
Or Should I create two seperate projects(one EJB project and another JSF project) and a parent POM?
Actually it is possible to package EJBs inside a WAR archive : JEE6 Tutorial, so I decided to stick with that.
Alternatively it is also possible to convert a project from WAR to EAR by using Maven's project composition (useful link).

Resources