Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Lirone75 M.
deploy task of plugin ext and service jar [SOLVED]
June 9, 2011 2:12 AM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Hello,

I created my service in plugin ext, but in the ant task "deploy" it doesn't seem to put the ext-service.jar file in my app lib folder : tomcat/lib/ext.
According to this page : http://www.liferay.com/community/wiki/-/wiki/Main/Deploying+an+EXT+WAR+file;jsessionid=FF4108046838210493A2414149DE722A.node-1
This should be done :

2. Deploys that .jar to the global class path. You should know where this is for your application server.


Why the ant task doesn't make it ?
Tomas Polesovsky
RE: deploy task of plugin ext and service jar
May 26, 2011 1:17 PM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 610

Join Date: February 13, 2009

Recent Posts

Hello,

the wiki page describes old extension environment, not Ext Plugin.

Ant task in Ext Plugin doesn't copy the ext-service.jar file. It's the ExtHotDeployListener, who takes you xxx-ext and deploy your ext-service.jar as tomcat/lib/ext/ext-xxx-ext-service.jar.

-- tom
Lirone75 M.
RE: deploy task of plugin ext and service jar
May 26, 2011 2:24 PM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Tomas Polesovsky:
Hello,

the wiki page describes old extension environment, not Ext Plugin.

Ant task in Ext Plugin doesn't copy the ext-service.jar file. It's the ExtHotDeployListener, who takes you xxx-ext and deploy your ext-service.jar as tomcat/lib/ext/ext-xxx-ext-service.jar.

-- tom


In fact, when I click on the ant deploy task of build.xml of the ext plugin, the ext war is put in the deploy folder of liferay, and it's taken into account by liferay that deploys it (I suppose it's the hot deploy you talking about), but after that I don't see any ext-xxx-ext-service.jar in the tomcat lib/ext folder.

I don't know why. here http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/developing-an-ext-plugin explanations, it seems that there is difference between first deploy and redeploy.

As I already deploy a first time the ext plugin and I have this problem trying to make a redeployement, I need to follow special steps ?
Tomas Polesovsky
RE: deploy task of plugin ext and service jar
May 27, 2011 12:54 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 610

Join Date: February 13, 2009

Recent Posts

First of all - please always look into tomcat's logs what's happening.

For the first time you can use ant deploy. For the next time (and all times until you reinstall portal) you should use ant direct-deploy task, which overwrites existing ext plugin in the portal. When you use ant deploy after first deploy, portal won't reinstall the plugin.

There's also option to use https://github.com/topolik/Extlet6 which is my patch for redeployment and merging of Ext Plugins. It's now in testing phase, but you can try it if you want. With this you should be able to do standard redeploy (with war file copied into /deploy directory).

--tom
Lirone75 M.
RE: deploy task of plugin ext and service jar
May 30, 2011 12:01 PM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

ok thanks.

I'll try to do all that I want without ext plugin but thank you still.
Lirone75 M.
RE: deploy task of plugin ext and service jar
June 1, 2011 4:03 AM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Tomas Polesovsky:
For the first time you can use ant deploy. For the next time (and all times until you reinstall portal) you should use ant direct-deploy task, which overwrites existing ext plugin in the portal. When you use ant deploy after first deploy, portal won't reinstall the plugin.



Do you know/understand the reason why ?
Tomas Polesovsky
RE: deploy task of plugin ext and service jar
June 1, 2011 1:13 PM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 610

Join Date: February 13, 2009

Recent Posts

Lirone75 M.:
Do you know/understand the reason why ?


Yes, it's simple. It is implemented this way emoticon But this is not the answer you are waiting for emoticon

The main reason is that in current implementation the ExtHotDeployListener doesn't backup files that Ext plugin changes => it can't return to point before you deployed your Ext Plugin. This means that portal can't undeploy Ext plugin, i.e. perform full redeploy.

-- tom
Lirone75 M.
RE: deploy task of plugin ext and service jar
June 2, 2011 1:06 PM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Humm, if it's like that's OK.

But the new ext services that we developped are exactly one of the only thing that are obviously not present originally in liferay.

Such a way that "ext service deploy" and "ext service undeploy" should be in theory fully supported by Liferay.

So I feel it paradoxal, that the service "deploy" only works the first time, while I guess the overwriting of classes for example will always work with the deploy ant task.

For my side I'm interested to make a ext service because I need to access core liferay classes (that are in WEB-INF/lib/portal-impl.jar).
More exactely : I need the code that serializes a portlet request into a XML string, but this code is not in lib/ext/portal-service.jar but in the portal-impl.jar

At the end the deployement in production of ext is not clear as, we don't know exactely what the "deploy" and "direct-deploy" do exactely.
And we cannot consider removing/reinstalling liferay each time we need to put "ext plugin" modifications into the production environnement.

I conclude that making services to expose core liferay functionnality through ext services in ext, is not "recommended" (at least almost forbidden if you don't understand how liferay deals with "ext" stuff).

Do you know other solution to access classes and code of portal-impl.jar from a portlet ?

For example that is better ? : http://www.liferay.com/community/wiki/-/wiki/Main/How+to+access+the+full+Liferay+API+from+a+portlet+application;jsessionid=0E08A9D536986BFF85AFA34312387F90.node-1
Tomas Polesovsky
RE: deploy task of plugin ext and service jar
June 2, 2011 2:50 PM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 610

Join Date: February 13, 2009

Recent Posts

Lirone75 M.:
Humm, if it's like that's OK.

But the new ext services that we developped are exactly one of the only thing that are obviously not present originally in liferay.

Such a way that "ext service deploy" and "ext service undeploy" should be in theory fully supported by Liferay.


Yes, but not just in theory. Extlet6 supports undeploy and I hope Liferay will merge it into the trunk.

Lirone75 M.:
At the end the deployement in production of ext is not clear as, we don't know exactely what the "deploy" and "direct-deploy" do exactely.
And we cannot consider removing/reinstalling liferay each time we need to put "ext plugin" modifications into the production environnement.


I share your pain. For now you can simulate direct-deploy, i.e.
1, create empty tomcat folders (create something like tomcat directory structure without tomcat files - on linux try "find liferay-portal-6.0.6 -type f -print0 | xargs -0 rm -f" )
2, run ant direct-deploy into empty tomcat folders
3, zip the empty folders with ext plugin files into deployment package
4, unzip deployment package in your production environment and restart tomcat

You can easily automatize this process (pre-created directories from step 1 can be zipped into something like "tomcat-empty-directories.zip" and reuse anytime you need). Thus your build process could look like: (1) unzip tomcat-empty-directories.zip (2) run "and direct-deploy" (3) zip created deployment package

Lirone75 M.:
I conclude that making services to expose core liferay functionnality through ext services in ext, is not "recommended" (at least almost forbidden if you don't understand how liferay deals with "ext" stuff).

Do you know other solution to access classes and code of portal-impl.jar from a portlet ?


I think you always need little knowledge about the Ext stuff if you want to use it. It's too powerful to use it without knowing what you really do emoticon

And deploy/redeploy has almost nothing in common with exposing functionality (or do whatever you want) via ext services, therefore I'm not sure it is (or isn't) recommended. If I need expose portal-impl functionality I would always use Ext plugin to create facade for my portlets.

-- tom
Lirone75 M.
RE: deploy task of plugin ext and service jar
June 3, 2011 12:59 AM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Tomas Polesovsky:
If I need expose portal-impl functionality I would always use Ext plugin to create facade for my portlets.



Yes It is exactelly what I am working on but how can you do this ?

Because if I just make a simple class at the end, I find it in a ext jar in webapps/ROOT/WEB-INF/lib that not accessible from portlet.
Tomas Polesovsky
RE: deploy task of plugin ext and service jar
June 3, 2011 3:56 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 610

Join Date: February 13, 2009

Recent Posts

I've attached simple implementation for you, I think this could give your good start point.

Important files to look at:
* lirone-ext/docroot/WEB-INF/ext-service/src/eu/ibacz/service/MyServiceFacade.java
* lirone-ext/docroot/WEB-INF/ext-service/src/eu/ibacz/service/MyService.java
* lirone-ext/docroot/WEB-INF/ext-impl/src/eu/ibacz/service/impl/MyServiceImpl.java
* lirone-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml

If you'd like to test it, just go to Control Panel -> Server Administration -> Script and run:
1Packages.eu.ibacz.service.MyServiceFacade().get().doSomething();


EDIT: if this won't work, try to download new liferay-tomcat bundle, unzip and copy lirone-ext/lirone-ext-6.0.5.1.war into deploy directory.

-- tom
Attachments: lirone-ext.zip (17.4k)
Lirone75 M.
RE: deploy task of plugin ext and service jar
June 3, 2011 6:14 AM
Answer

Lirone75 M.

Rank: Regular Member

Posts: 235

Join Date: March 19, 2007

Recent Posts

Thank you very much.

I like it, it's clear, elegant and it works perfectly.
Hello World
RE: deploy task of plugin ext and service jar
August 6, 2013 4:58 AM
Answer

Hello World

Rank: New Member

Posts: 4

Join Date: August 5, 2011

Recent Posts

Tomáš Polešovský:
I've attached simple implementation for you, I think this could give your good start point.

Important files to look at:
* lirone-ext/docroot/WEB-INF/ext-service/src/eu/ibacz/service/MyServiceFacade.java
* lirone-ext/docroot/WEB-INF/ext-service/src/eu/ibacz/service/MyService.java
* lirone-ext/docroot/WEB-INF/ext-impl/src/eu/ibacz/service/impl/MyServiceImpl.java
* lirone-ext/docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml

If you'd like to test it, just go to Control Panel -> Server Administration -> Script and run:
1Packages.eu.ibacz.service.MyServiceFacade().get().doSomething();


EDIT: if this won't work, try to download new liferay-tomcat bundle, unzip and copy lirone-ext/lirone-ext-6.0.5.1.war into deploy directory.

-- tom


Hi, i am a new, i don't understand what does "deploy directory" mean. Where is it in liferay tomcat bundle?