P2 Director Install of New Plugin

What Trunk or Branches to use and mix? Which is the Official version? How to survive growth?
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are moved to the same sub-forum. Language will be corrected for readability.

P2 Director Install of New Plugin

Postby red1 » Wed Dec 12, 2012 4:52 am

This is a continuation from How to migrate your module to iDempiere. The method used here is the Headless P2 Director installation which should automatically handle install, uninstall of the new features.

The plugin project is put into a feature project and then exported. (Screens below).

p21.gif
p21.gif (26.96 KiB) Viewed 17829 times

Above at the Plugins tab, the plugin module is added.

P22.gif
P22.gif (24.63 KiB) Viewed 17829 times

The dependencies are listed by clicking on the Compute button.

P23.gif
P23.gif (46.6 KiB) Viewed 17829 times

Back to the Main Overview tab, you click on the Export Wizard link on the bottom right. This carries you to the screens below.

P24.gif
P24.gif (33.84 KiB) Viewed 17829 times

A local directory is used for testing this.

P25.gif
P25.gif (41.42 KiB) Viewed 17829 times

Ensure that Generate Metadata Respository is checked. It produced this in my repository (Applications/POSIntegration):

Folder.gif
Folder.gif (12.35 KiB) Viewed 17822 times

Then at the local adempiere-client instance a new InstallPOS.sh is used:

Code: Select all
#!/bin/sh
#
cd $(dirname "${0}")
DESTINATION=$(pwd)
java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profile DefaultProfile -profileProperties org.eclipse.update.install.features=true -repository $1 -i POSIntegration


This gives a positive result:

Code: Select all
sh-3.2# ./installPOS.sh file:/Applications/POSIntegration/                 
!SESSION 2012-12-11 19:15:24.229 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_09
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -application org.eclipse.equinox.p2.director -profile DefaultProfile -profileProperties org.eclipse.update.install.features=true -repository file:/Applications/POSIntegration/ -i POSIntegration
Command-line arguments:  -application org.eclipse.equinox.p2.director -consoleLog -profile DefaultProfile -profileProperties org.eclipse.update.install.features=true -repository file:/Applications/POSIntegration/ -i POSIntegration

!ENTRY org.eclipse.core.net 1 0 2012-12-11 19:15:24.903
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Installing POSIntegration 1.0.0.201212111854.
Operation completed in 1904 ms.


And a List Installed Roots check produced:

Code: Select all
<i_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -lir                                        !SESSION 2012-12-12 04:34:36.723 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_09
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -application org.eclipse.equinox.p2.director -lir
Command-line arguments:  -application org.eclipse.equinox.p2.director -consoleLog -lir

!ENTRY org.eclipse.core.net 1 0 2012-12-12 04:34:40.766
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
POSIntegration/1.0.0.201212111854
org.adempiere.ui.swing.product/1.0.0
org.idempiere.eclipse.platform.feature.group/1.0.0.v20121203-2305
Operation completed in 3846 ms.


However the plugin or feature does not appear in the adempiere-client instance. Investigations ongoing..

For uninstalling, here is the UnInstall.sh

Code: Select all
#!/bin/sh
#
cd $(dirname "${0}")
DESTINATION=$(pwd)
java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profile DefaultProfile -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u POSIntegration
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Wed Dec 12, 2012 5:13 am

Investigating inside adempiere-client shows the plugin's presence at its p2/org.eclipse.equinox.p2.engine/profileRegistry/DefaultProfile.profile/1355224526737.profile:

profile.gif
profile.gif (17.53 KiB) Viewed 17825 times

But it does not show up in the features nor plugins folders nor any other suspected contents of adempiere-client. Scouting the help sites turned up certain clues but none point to a final remedy. Now there is some setting in iDempiere's P2. Under its p2/org.eclipse.equinox.p2.engine/settings/org.eclipse.equinox.p2.artifact.repository.prefs:

Code: Select all
repositories/file\:_Users_redhuan_buckminster.output_org.adempiere.ui.swing_1.0.0-eclipse.feature_adempiere.*.*.*_adempiere-client/provider=
...
...

Which is where the new artifacts ended up at. But why there and not in my <App-Home>(/Applications/adempiere-client)? The prefs from Jenkins binary gives another location:
Code: Select all
repositories/file\:_var_lib_jenkins_jobs_iDempiereDaily_workspace_buckminster.output_org.adempiere.ui.swing_1.0.0-eclipse.feature_adempiere.cocoa.macosx.x86_adempiere-client_p2_org.eclipse.equinox.p2.core_cache/version=1.0.0

So i suspect this originates from where and how your binary was compiled.
But testing update.sh at idempiere-server which has the same prefs does not pose any issue. Plugins do get updated as expected. Will test the POSIntegration install there.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Wed Dec 12, 2012 8:14 am

Swtiching to idempiere-server works:

Code: Select all
160   RESOLVED    org.adempiere.webstore.resource_1.0.0.v20121211-2317
               Master=159
161   RESOLVED    org.adempiere.webstore.servlet_1.0.0.v20121211-2317
162   ACTIVE      org.apache.ecs_1.0.0.v20121211-2317
163   <<LAZY>>    org.compiere.db.oracle.provider_1.0.0.v20121211-2317
164   ACTIVE      org.compiere.db.postgresql.provider_1.0.0.v20121211-2317
165   ACTIVE      org.idempiere.hazelcast.service_1.0.0.v20121211-2317
               Fragments=166
166   RESOLVED    org.idempiere.hazelcast.service.config_1.0.0
               Master=165
167   RESOLVED    org.idempiere.webservices_1.0.0.v20121211-2317
168   ACTIVE      org.zkoss.zk.library_6.0.0.v20121211-2317
169   ACTIVE      POSIntegration_1.0.0.201212111854

The new plugin appears and could be started manually via the OSGi console which triggers the 2Pack installation!
Image below confirms its initial successful birth.

POSinstalled.gif
POSinstalled.gif (19.39 KiB) Viewed 17819 times

What is learnt here? From what i suspect after reading the Web, it has to do with the first update from originating site. Since idempiere-server ran a successful update first as ./update.sh http://jenkins.idempiere.com/job/iDempi ... e/site.p2/, the subsequent local or different repo install follows suit.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Wed Dec 12, 2012 11:22 am

After doing a Role Access Update, we get the full module items to show. This shows the 2Pack on the fly works!:

POSinServer.gif
POSinServer.gif (21.71 KiB) Viewed 17817 times


Later i will update the iDempiereMigrationGuide.pdf to explain how to get this working for the Java Client too. Steps will be:
1. Export a trial p2 site of the whole adempiere-client to a local buckminster location.
2. Update from the local p2 site.
3. Then update from another new plugin site.

However the initial issue now is that after reupdating back from idempiere-server, the POSIntegration plugin is gone. A re-update of the new plugin is needed.This may mean that it has to be in its own feature-group to persist.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Wed Dec 12, 2012 6:54 pm

My hunch above is right. HengSin advised that it should be POS-Integration.feature.group and it worked. So now i have placed the p2 artifacts at http://sourceforge.net/projects/red1/files/p2/ for remote online access. The installer scripts are also uploaded there. Run them in your adempiere-server folder to get the intended plugins.
The PDF guide is also updated http://sourceforge.net/projects/red1/fi ... f/download
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Sun Dec 16, 2012 7:07 pm

And it can be hot deployed! No need to stop the apps server, call up the source and put in customization.jar, recompile, redeploy, plus download and apply migration scripts in DB, run again apps server. Just 2 line action while app server is running hot!



To let it run in the adempiere-client:

1. In your adempiere-client home directory start your instance with ./adempeire-client.sh (add in -console argument in the shell to get the OSGi console running)

2. Type in the complete script (you may need to change the jar numbering if it has changed by checking the online location:

Code: Select all
install http://downloads.sourceforge.net/project/red1/p2/POSIntegration/plugins/POSIntegration_1.0.0.201301171115.jar
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby red1 » Sat Feb 16, 2013 10:00 am

If you love the good old GUI, now we have the much easier Felix way:

red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby collazosc » Fri Apr 05, 2013 10:41 am

I imported posIntegration plugin into Eclipse, run the 2packin and the migration sql script. However, after updating the eclipse workspace there are errors in Export2Queue.java file saying that [b]
MStorage cannot be resolved to a type
. I checked org.compiere.model and the MStorage class is not present. I have idempiere update up to now in my eclipse installation.

What is wrong?
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: P2 Director Install of New Plugin

Postby red1 » Fri Apr 05, 2013 12:42 pm

That is due to change in the MStorage code by iDempiere team. I have already upgraded that and put them in here http://sourceforge.net/p/red1/small/167 ... rePlugins/. Just check out via SVN the POSIntegration plugin (feature is optional and not necessary).
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby collazosc » Tue Apr 09, 2013 4:37 am

Ok. I svn checkout the update and updated my eclipse installation. However, I could not run the plugin. I got no error when I used START 2 for activating the plugin I only got an error when running the export option in the menu:

WARNING: org.adempiere.process.Export2Queue
java.lang.ClassNotFoundException: org.adempiere.process.Export2Queue
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.adempiere.base.DefaultProcessFactory.newProcessInstance(DefaultProcessFactory.java:64)
at org.adempiere.base.Core.getProcess(Core.java:98)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:159)
at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:234)
at org.adempiere.webui.apps.WProcessCtl.process(WProcessCtl.java:158)
at org.adempiere.webui.apps.ProcessDialog$ProcessDialogRunnable.doRun(ProcessDialog.java:819)
at org.adempiere.util.ContextRunnable.run(ContextRunnable.java:38)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

I checked the plugin status using even using the felix console. Then, I used the pack in option in the Application Dictionary menu in idempiere to import manually the 2pack.zip inside the postintegration subdirectory (that's why the menu was shown) but I still got the same error.

Digging a little bit in the activator. I traced the packin code inside the activator class and also found out the following error when submiting the query:
SELECT Processing,PK_Version,CreatedDate,CreatorContact,PK_Status,Creator,UpdatedDate,Version,
Uninstall,ReleaseNo,Processed,Description,Name,AD_Package_Imp_UU,EMail,CreatedBy,
AD_Package_Imp_ID,IsActive,Created,UpdatedBy,Updated,AD_Org_ID,AD_Client_ID
FROM adempiere.AD_Package_Imp WHERE (Name='POSIntegration' AND PK_Version LIKE '1.0.0%');


ERROR: column "ad_package_imp_uu" does not exist
LINE 2: Uninstall,ReleaseNo,Processed,Description,Name,AD_Package_Im...
^


********** Error **********

ERROR: column "ad_package_imp_uu" does not exist
SQL state: 42703
Character: 143

What am I doing wrong? Everything seems to be in place.
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: P2 Director Install of New Plugin

Postby red1 » Tue Apr 09, 2013 5:25 am

From the System Menu try to run UUID Generator.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby collazosc » Tue Apr 09, 2013 5:58 am

Thank you very much for your fast answer. I run the aforemenctioned process and it showed the result for three tables not related to the AD. I've also run this process over the AD_Package_Imp table but situation kept the same.

Any other suggestion?
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: P2 Director Install of New Plugin

Postby red1 » Tue Apr 09, 2013 6:17 pm

Did you start from a fresh iDempiere 1.0 database (with all its migration scripts applied?) and if you use PG, there is a peculiar special script for UUID constraint to be applied first. If you can check just google for "Postgres iDempiere UUID script" etc.
When you use the new 2Pack in the link i gave above it should work as i synch here my source to SVN and i find no changes. The POSIntegration_1.0.0.201301171115.jar in the SF site is same as my own which i tested fully just yesterday has no errors.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby swiki » Tue Aug 20, 2013 7:41 pm

Hi,

I created Feature Project in Eclipse as you recommended at the top of this topic, because i am trying to install new features. My problem is that i cannot export feature project. When i click on Export Wizard the "Finish" button is disabled and i dont know how to make it enabled. Maybe some settings needs to be fixed, but i dont have any idea which settings, because i did all previous steps...i attached screenshot of export wizard.
Attachments
Screen Shot 2013-08-20 at 1.40.35 PM.png
Export wizard could not be finished
Screen Shot 2013-08-20 at 1.40.35 PM.png (98.2 KiB) Viewed 16201 times
Screen Shot 2013-08-20 at 1.25.22 PM.png
Export wizard could not be finished 2
Screen Shot 2013-08-20 at 1.25.22 PM.png (118.53 KiB) Viewed 16201 times
swiki
 
Posts: 2
Joined: Tue Aug 13, 2013 6:03 pm

Re: P2 Director Install of New Plugin

Postby red1 » Tue Aug 20, 2013 8:53 pm

Try exporting a normal plugin first, not a feature. In my latest approach i preferred normal plugins.
Also when faced with such problems, it is better to Google for Eclipse community that knows more than me here, which is quite focused on certain iDempiere work. I am not a total expert to know every tool used in this project.
But do share back once you found out! :)
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: P2 Director Install of New Plugin

Postby swiki » Wed Aug 21, 2013 7:08 pm

I woke up with fresh head, set up new workspace, created new plugin via extensions, created feature project and export it via wizard and now, everything is working perfectly. :shock: Maybe when i was experimenting with iDempiere and Eclipse at the begining, i made some bad setups.
swiki
 
Posts: 2
Joined: Tue Aug 13, 2013 6:03 pm


Return to Building ADempiere

Who is online

Users browsing this forum: No registered users and 1 guest