Foren

deploy task of plugin ext and service jar [SOLVED]

Lirone75 M., geändert vor 12 Jahren.

deploy task of plugin ext and service jar [SOLVED]

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
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 ?
thumbnail
Tomas Polesovsky, geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
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 ?
thumbnail
Tomas Polesovsky, geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
ok thanks.

I'll try to do all that I want without ext plugin but thank you still.
Lirone75 M., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
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 ?
thumbnail
Tomas Polesovsky, geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
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
thumbnail
Tomas Polesovsky, geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
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.
thumbnail
Tomas Polesovsky, geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Liferay Master Beiträge: 676 Beitrittsdatum: 13.02.09 Neueste Beiträge
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:
Packages.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
Lirone75 M., geändert vor 12 Jahren.

RE: deploy task of plugin ext and service jar

Regular Member Beiträge: 118 Beitrittsdatum: 19.03.07 Neueste Beiträge
Thank you very much.

I like it, it's clear, elegant and it works perfectly.
Van Sinh, geändert vor 10 Jahren.

RE: deploy task of plugin ext and service jar

New Member Beiträge: 4 Beitrittsdatum: 05.08.11 Neueste Beiträge
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:
Packages.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?