留言板

Marketplace and shared code between portlet and ext-plugin

thumbnail
Florencia Gadea,修改在9 年前。

Marketplace and shared code between portlet and ext-plugin

Regular Member 帖子: 146 加入日期: 12-3-27 最近的帖子
Hi Everyone,

I developed a portlet and an ext plugin that I want to share in the Marketplace (for Liferay 6.1.1). I needed the ext plugin to use some code from the portlet, so I added the portlet-service.jar as a dependency in the ext plugin (in WEB-INF/ext-lib/global). If I deploy both, I get a classloading issue (because both load the same jar). The way I fixed this, was deleting the portlet-service.jar from the portlet and restarting the server, and everything worked fine. The problem is that when I upload these plugins to the Marketplace, they get rejected, because of "Console errors on deployment". I tried deploying the ext-plugin first, then the portlet without the portlet-services.jar in it, but I get exceptions (BeanLocator is null for servlet context).

So, is there any "clean" way to deploy these two plugins, so they get accepted in the Marketplace?

Regards,

Florencia.
thumbnail
David H Nebinger,修改在9 年前。

RE: Marketplace and shared code between portlet and ext-plugin

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
I would not use an EXT from the marketplace...

Most of the time I've seen that I need an EXT plugin myself internally to work around issues that I have with the core. Since I can't use two EXT plugins, I couldn't use yours no matter how good it is.

That said, your issue is going to be timing. If the service code gets invoked before the plugin providing the service is deployed, you get the bean locator error.

You want to control timing and save usage of the service jar until it is needed (i.e. during an action phase or render phase, but never during initialization).
thumbnail
Florencia Gadea,修改在9 年前。

RE: Marketplace and shared code between portlet and ext-plugin

Regular Member 帖子: 146 加入日期: 12-3-27 最近的帖子
Hi David,

Thanks for you answer. I'll assume you are not a typical Liferay user, so I'll stick to the ext plugin emoticon

I'm really sorry to hear that, because the service code will get invoked during initilization.

This application I developed allows language display customization on the fly. It works by storing all the Liferay core and portlets language.properties keys and values in the database and then the portal reads those properties from the database directly. It has a user interface, so existing entries in different languages can be easily modified, without the need to restart the server.

If anyone has a different idea about what to do about this, I'm all ears.

Regards,

Flor.
thumbnail
David H Nebinger,修改在9 年前。

RE: Marketplace and shared code between portlet and ext-plugin

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
Yeah language stuff comes very early in Liferay startup. Perhaps (although it is deprecated) you could try an EXT service implementation.
Mark Stevens,修改在9 年前。

RE: Marketplace and shared code between portlet and ext-plugin

New Member 发布: 1 加入日期: 14-11-18 最近的帖子
Hi,

Were you able to share your portlets @ the marketplace? Even I am trying to do that but not aware of the next steps, any help would be much appreciated!

Thanks!
thumbnail
Florencia Gadea,修改在9 年前。

RE: Marketplace and shared code between portlet and ext-plugin

Regular Member 帖子: 146 加入日期: 12-3-27 最近的帖子
Hi Mark!

In short: No, it is not possible to upload these plugins to the Marketplace, there is no current solution to this problem.

Answer from Liferay Staff: "The solution would definitely be to try to avoid using an Ext Plugin or at least make it small enough to avoid the dependency."

Another option would be to develop an OSGi plugin: https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/developing-osgi-plugins-for-liferay

This is in an early stage, so you can't be sure that your plugin will actually work.

Regards,

Flor.