So according to the Liferay Compatibility Matrices, Liferay supports and works on WebLogic. In fact it’s actually certified to run on WebLogic 12. Wahoo!
In my opinion, though, there should really be an asterisk next to WebLogic in the charts, and the asterisk would read “But boy is it difficult.”
So let’s back up a little… WebLogic is a great application container. In a normal configuration, a separate administration console governs a cluster of managed nodes. Deployment, configuration, managed node add/remove, etc. are all actions performed in the admin console to affect the managed nodes in the cluster. From an administrator’s perspective, this is a clean and easy way to manage change in the cluster for web applications.
Because the individual nodes are managed under this configuration, however, the nodes cannot affect change on themselves or the other nodes in the cluster. All changes must occur within the admin console.
This poses special problems for Liferay in two forms – the Marketplace and custom development.
In Liferay the Marketplace is key to downloading and using some necessary enterprise plugins such as Solr, the Kaleo plugins, etc. This is where the problems start.
Liferay under WebLogic is running in a managed node which cannot affect change (i.e. do a deployment), yet the Liferay Marketplace plugin depends upon being able to do deployments in order to work. Liferay has gone so far as to report within the Marketplace plugin in the control panel that the deployment feature is not supported, but that doesn’t solve the problem.
You can download Marketplace plugins manually as .lpkg files from your account in Liferay.com. The .lpkg file is really a zip file with an added meta file, but this format cannot be deployed through the WebLogic administration console.
The only option is to drop the .lpkg file into Liferay’s deploy folder on one of the managed nodes. Liferay will process the .lpkg file and expands it to prepare for deployment, but since this is a managed node, it will not deploy.
After Liferay processes the .lpkg file, in your managed node’s autodeploy folder you’ll find the exploded plugin folder ready for (but not) deploying. Within this directory, you can use the command line to create a new war file like “jar cf /tmp/my-marketplace-plugin.war *” to create a new war file ready for the admin console deployment. The folder in the autodeploy folder is no longer necessary, so it can be safely deleted.
Using this new war file, you can use the WebLogic administration console to push the plugin out to all of the managed nodes in the cluster.
So this is the first example where yes, Liferay works under WebLogic, but boy is it difficult.
So as developers using the Liferay SDK or Liferay Maven archetypes, we’re used to building war files for deployment, but what many developers don’t know is the normal build process creates war files that must be dropped into Liferay’s deploy folder.
Once these war files are dropped into the Liferay deploy folder, Liferay will “massage” the artifact by adding values into web.xml, copying jar files into the WEB-INF/lib directory per the liferay-plugin-package.properties file, etc. This is generally a good thing because the wars that we have to build and distribute are much smaller than a normal web app.
Under WebLogic, however, we run into the same problem as we’ve just seen with the Marketplace deployment. On a managed node, the war must be dropped into Liferay’s deploy folder and then a new war file manually created for deployment.
Alternatively developers can create a fully-instrumented war file, one that is ready for the WebLogic admin console deployment.
As a developer, you’ll have the SDK or Maven and a Tomcat bundle (never try developing directly with WebLogic, you’ll spend time trying to solve deployment things that really aren’t a concern during development).
You’re going to use the “direct-deploy” target to build your war files.
For Ant, you’ll want to set “auto.deploy.unpack.war” to false in your build.<user>.properties file (so you don’t have to build war files yourself). Then use the command “ant direct-deploy” for your plugin. In your Tomcat bundle’s webapps directory you’ll find a war file ready for deployment.
For Maven, you just do “mvn liferay:direct-deploy -DunpackWar=false” and you’ll find the same war file in the Tomcat bundle’s webapps directory.
Either way, the war file can be deployed using WebLogic’s admin console.
So this process will work, and again it is an example where yes, Liferay works in WebLogic, but boy is it difficult.
I think it’s important to note that I’ve consistently said “difficult” and not “impossible”. Personally I see these issues as a workable pain. They’re a pain for development, they’re a pain for administration (all of the manual steps for a marketplace plugin), but they are indeed workable.
If you’re a WebLogic shop, you’ve got an investment in WebLogic, you have experienced WebLogic administrators and developers, and there’s no reason to discard all of that when you take on Liferay.
It’s just important to be aware of some of the hurdles you’ll be facing on your Liferay journey, that those hurdles can be jumped, and that Yes, Liferay works in WebLogic.