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

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.

Related

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.

Replacing/deploying only the changes in the already depolyed ear in Jboss 7

I am deploying the ear file each time when i making a changes as my project is multi-module and it is really tedious to upload/deployed the entire ear again in Jboss 7.Is there any way to replace only the changed jar/war/files in the already deployed ear in jboss without deploying the entire ear file again.
Thanks.
You should consider using JRebel - it allows reloading changes. After you compile any class it will automaticaly reload it, supporting modern frameworks (like reloading spring beans, etc) and application servers (JBoss included). It works as a java agent. You will find more details on producent site: http://zeroturnaround.com/software/jrebel/features/
To introduce JRebel in Maven project you just need to add jrebel-maven-plugin

IBM Worklight 6.0 - Deploying Worklight to external Apache Tomcat

I'm developing a Worklight (v6.0) application. I have added Tomcat server in Eclipse server perspective. With that I have deployed my application, and it is working fine.
I want know, how can we deploy our application in an external apache server? i.e without adding Tomcat server in Eclipse.
You need to have another instance of Apache Tomcat installed on your computer - simply download and extract it somewhere in your hard disk.
You need to then "install" to it the Worklight framework files and prepare databases based on your worklight.properties setup.
Then you need to simply deploy your project's .war file to it (can be found in the bin folder in your Worklight project), followed by deploying your .adapter files and application .wlapp files (also found in the bin folder).
Assuming you are an IBM Worklight customer, then after extracting Tomcat in your HD, you can and should use the IBM Installation Manager and Ant task scripts to handle the rest (deploying Worklight framework, setting up the database, deploying the .war file).
See this topic in the IBM Worklight 6.0 Information Center:
Installing Worklight Server
If you prefer to work manually...:
Deploying a project WAR file and configuring the application server manually
Note that the Worklight framework .jar file is available ONLY to customers of IBM Worklight.

How to deploy Liferay portlets using WAS Administration Console

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.

Resources