留言板

Liferay 7 - cannot deploy

Ionut Negoita,修改在7 年前。

Liferay 7 - cannot deploy

New Member 帖子: 10 加入日期: 12-8-27 最近的帖子
Part 1
I work for a company that has been building apps (portlets) on Liferay 6.0.x, we use spring+hibernate and a couple of months ago we decided to investigate the possibility of switching to Liferay 7.

The version was not officially released at that point and after 3 weeks of hard work we managed to get a portlet to work on the new platform. However, after updating to the official release we found out that it's not possible anymore to use .war files for packaging/deploy

We've been struggling for another 3 weeks with BND trying to manually configure the portlet's dependencies but failed. We eventually gave up as it was becoming way too expensive for us having already a couple of people working on this for weeks just to get something to deploy.

I don't understand Liferay's decision to go with OSGI since JSR-286 goes down the drain, the building tools are not mature at all and developers should focus on developing NOT configuring dependencies manually.

Part 2 - details

The first issue we have encountered was with the Liferay IDE plugin for Eclipse. The thing is that up to a certain beta version, we could deploy a standard portlet project on the Liferay Server using the IDE as before in Liferay 6. However, at some point this was no longer supported and the project had to be an OSGI module.

As the online documentation (incomplete at that point) was stating clearly that OSGI is the future and was urging everyone to convert their legacy projects into OSGI bundles, we set on to do that. But our set of applications are quite complex and depend on a lot of frameworks that are also used by Liferay itself, but with different versions (Spring, Hibernate, Vaadin - even though Vaadin is no longer part of Liferay 7 - and others). Also they were conceived as interdependent maven projects, so the job of creating manifest files for everything became quite tedious pretty fast.

Bndtools was unable to properly set up the required dependencies just by using the Eclipse project settings and the Gradle classpath (maven was not yet supported, I don't know if that changed meanwhile) so we ended with a lot of runtime problems. In the end we had to heavily modify the manifest files ourselves, discovering new dependency issues more and more after each step. That is without mentioning the fact that Gradle and / or Bndtools were unable to properly deal with the dependencies declared as "optional" in some of the maven pom files.

In the end we tried to deploy a standard war by just dropping it in the deploy folder of Liferay 7. According to the docs, that should have been indeed been possible, the server being in charge to convert it automatically to a WAB and eventually as such in an OSGI module. All we have obtained was an OutOfMemory error.. We will probably investigate some more by adjusting the startup parameters and the allocated memory for the server.

The overall impression was though that upgrading to Liferay 7, at least at that point (a month or two ago) would be for us a terrible hassle. We have our own development schedule and we already had to change a lot of code to adjust to the new API, but we have done it. However, this building and deploying process seems right now very uncomfortable. Previously we were doing that on our development machines very easy from Eclipse + Liferay IDE plugin and having auto-redeploy enabled. Even if the WAR to WAB automatic conversion would work out of the box, it will still be a disruption in our development workflow to rely on an external script to do that heavy processing and wait so long before seeing the result of changing a simple line of code. That was previously as simple as hitting Ctrl+S in Eclipse and F5 in the browser about 10 seconds later.


Question

Are we missing something? How should we develop and deploy such portlets that have complex dependencies (spring+hibernate+vaadin)?
thumbnail
Juan Gonzalez,修改在7 年前。

RE: Liferay 7 - cannot deploy

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Hi Ionut.

Java EE portlets "should" work as they are, as you said, there are automatic processes taking care of generating the right bundle.

Can you post here the logs whenever your WAR portlets are deployed (with those OutOfMemory exceptions)?

Thanks.
thumbnail
John Schulz,修改在7 年前。

RE: Liferay 7 - cannot deploy

New Member 帖子: 22 加入日期: 16-7-29 最近的帖子
Hello, we are upgrading to Liferay 7 or DXP (which I believe works like 7, correct? Haven't had a chance to play with it yet). In any case, we have existing 6.2 JSR-286 portlets that we need to deploy in 7. So far I've been unsuccessful in getting 7 to recognize the apps that I've packaged just like we always have with Maven to output a .war file. We then deposit the .war file in the "deploy" folder and it does seem to get picked up as it did in 6.2 but it never makes it to the Tomcat "webapps" folder and likewise does not show up in the Applications menu when trying to Add an app to a page. I tried updating the "liferay-portlet.xml" DTDs to be 7_0_0, even though I read that it was not necessary, re-packaged and saw no change when trying to deploy. I also get no errors while packaging and I don't see anything telling in the Tomcat logs. I read that the existing portlets from 6.2 should just work in 7, what am I missing?

Please advise - thanks.
thumbnail
Juan Gonzalez,修改在7 年前。

RE: Liferay 7 - cannot deploy

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
John Schulz:
Hello, we are upgrading to Liferay 7 or DXP (which I believe works like 7, correct? Haven't had a chance to play with it yet). In any case, we have existing 6.2 JSR-286 portlets that we need to deploy in 7. So far I've been unsuccessful in getting 7 to recognize the apps that I've packaged just like we always have with Maven to output a .war file. We then deposit the .war file in the "deploy" folder and it does seem to get picked up as it did in 6.2 but it never makes it to the Tomcat "webapps" folder and likewise does not show up in the Applications menu when trying to Add an app to a page. I tried updating the "liferay-portlet.xml" DTDs to be 7_0_0, even though I read that it was not necessary, re-packaged and saw no change when trying to deploy. I also get no errors while packaging and I don't see anything telling in the Tomcat logs. I read that the existing portlets from 6.2 should just work in 7, what am I missing?

Please advise - thanks.


Can you post the server log when deploying your portlet?

Additionally, can you connect to gogo shell console, execute "lb", then start <bundleId> and paste here what it says?
John Plaschke,修改在7 年前。

RE: Liferay 7 - cannot deploy

New Member 帖子: 8 加入日期: 14-11-6 最近的帖子
Any luck on this? I have the exact same problem.
Thanks
thumbnail
David H Nebinger,修改在7 年前。

RE: Liferay 7 - cannot deploy

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Folks, 6.2 wars are not going to just work under 7.0. The APIs have changed at the very least so they do require some work to get them to be 7.0 compatible.

For the OP, you said:

Ionut Negoita:
I don't understand Liferay's decision to go with OSGI since JSR-286 goes down the drain, the building tools are not mature at all and developers should focus on developing NOT configuring dependencies manually.


Liferay embraces both OSGi and the portlet JSRs. The only thing not used in a pure OSGi portlet is the portlet.xml file. In all other ways the JSRs are satisfied. Some folks believe the JSRs mandate building and packaging and deploying as wars, but the specifications are actually mum on that. The specs talk about the interfaces that a portlet container must implement but leaves implementation details to the vendor. Just because Liferay (and others) used war deployments to Java Servlet-compliant containers does not mean the spec required that, it just was a means towards the ends of implementing the specs.

As far as tools go, blade and gradle have been rock-solid for me since building for initial RCs. Yes there have been bugs, but those bugs have been addressed. The Liferay IDE team is working hard to add more features and functionality to support Liferay 7 OSGi, but the tools in their current state are still very useful. We will, in fact, be demonstrating a lot of these tools at the LSNA next week.

And finally, dependency management was still required for 6.2 development. Should you use your own jar or pull in from ROOT using the liferay-plugin-package.properties file? How do reconcile the difference in jar versions between ROOT and your plugin? All of these issues existed before, there's nothing new here.






Come meet me at the LSNA!