Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.repository?
P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.repository? [message #119268] Fri, 10 October 2008 16:19 Go to next message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
I am working with a P2 enabled RCP app with the "Automatically find new
updates and notify me" + "Look for updates each time platform is started"
preferences selected.

On start up of the app these actions are not taking place. However, if I
go to the Help -> Software Updates... Available Software tab and do a
Refresh, the updates are being found and install properly so there is
nothing wrong with the update site or the connectivity.

Carefully watching netstat on startup of the RCP app reveals that no
communication with the update site server is taking place on startup.

I've noticed that if I go to the
p2\org.eclipse.equinox.p2.metadata.repository\cache there is a file named
content-1974464048.xml. If I delete this file, the selected preferences
do trigger and work on subsequent start up of the RCP app.

The timestamp and contents within file content-1974464048.xml do get
updated when I install updates using the refresh option described above.
However, the file name never changes. Shouldn't an entirely new file be
created with a new name?

No errors in the log of my RCP app.

I've build this RCP app with Ganymede 3.4.1

The plugins in my bundle pool are as follows...

javax.servlet.jsp_2.0.0.v200806031607.jar
javax.servlet_2.4.0.v200806031604.jar
org.apache.ant_1.7.0.v200803061910
org.apache.commons.el_1.0.0.v200806031608.jar
org.apache.commons.logging_1.0.4.v20080605-1930.jar
org.apache.jasper_5.5.17.v200806031609.jar
org.apache.lucene.analysis_1.9.1.v20080530-1600.jar
org.apache.lucene_1.9.1.v20080530-1600.jar
org.eclipse.ant.core_3.2.0.v20080529.jar
org.eclipse.core.commands_3.4.0.I20080509-2000.jar
org.eclipse.core.contenttype_3.3.0.v20080604-1400.jar
org.eclipse.core.databinding_1.1.1.M20080827-0800b.jar
org.eclipse.core.expressions_3.4.0.v20080603-2000.jar
org.eclipse.core.filesystem.win32.x86_1.1.0.v20080604-1400.j ar
org.eclipse.core.filesystem_1.2.0.v20080604-1400.jar
org.eclipse.core.jobs_3.4.0.v20080512.jar
org.eclipse.core.net.win32.x86_1.0.0.I20080521.jar
org.eclipse.core.net_1.1.0.I20080604.jar
org.eclipse.core.resources.compatibility_3.4.0.v20080604-140 0.jar
org.eclipse.core.resources.win32.x86_3.4.0.v20071204.jar
org.eclipse.core.resources_3.4.1.R34x_v20080902.jar
org.eclipse.core.runtime.compatibility.auth_3.2.100.v2007050 2.jar
org.eclipse.core.runtime.compatibility.registry_3.2.200.v200 80610
org.eclipse.core.runtime.compatibility_3.2.0.v20071008.jar
org.eclipse.core.runtime_3.4.0.v20080512.jar
org.eclipse.core.variables_3.2.100.v20080529-1300.jar
org.eclipse.debug.core_3.4.0.v20080612.jar
org.eclipse.ecf.filetransfer_2.0.0.v20080611-1715.jar
org.eclipse.ecf.identity_2.0.0.v20080611-1715.jar
org.eclipse.ecf.provider.filetransfer_2.0.0.v20080611-1715.j ar
org.eclipse.ecf_2.0.0.v20080611-1715.jar
org.eclipse.emf.codegen_2.4.0.v200808251517.jar
org.eclipse.emf.common.ui_2.4.0.v200808251517.jar
org.eclipse.emf.common_2.4.0.v200808251517.jar
org.eclipse.emf.ecore.change_2.4.0.v200808251517.jar
org.eclipse.emf.ecore.xmi_2.4.1.v200808251517.jar
org.eclipse.emf.ecore_2.4.1.v200808251517.jar
org.eclipse.emf.edit.ui_2.4.1.v200808251517.jar
org.eclipse.emf.edit_2.4.1.v200808251517.jar
org.eclipse.emf_2.4.0.v200808251517.jar
org.eclipse.equinox.app_1.1.0.v20080421-2006.jar
org.eclipse.equinox.common_3.4.0.v20080421-2006.jar
org.eclipse.equinox.frameworkadmin.equinox_1.0.2.R34x_v20080 911.jar
org.eclipse.equinox.frameworkadmin_1.0.2.R34x_v20080910.jar
org.eclipse.equinox.http.jetty_1.1.0.v20080425.jar
org.eclipse.equinox.http.registry_1.0.100.v20080427-0830.jar
org.eclipse.equinox.http.servlet_1.0.100.v20080427-0830.jar
org.eclipse.equinox.jsp.jasper.registry_1.0.0.v20080427-0830 .jar
org.eclipse.equinox.jsp.jasper_1.0.100.v20080427-0830.jar
org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v2 0080731
org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
org.eclipse.equinox.p2.artifact.repository_1.0.2.R34x_v20080 808-1156.jar
org.eclipse.equinox.p2.console_1.0.0.v20080514-1900.jar
org.eclipse.equinox.p2.core_1.0.0.v20080530-1237.jar
org.eclipse.equinox.p2.director.app_1.0.1.R34x_v20080729.jar
org.eclipse.equinox.p2.directorywatcher_1.0.2.v20080806-1619 .jar
org.eclipse.equinox.p2.director_1.0.0.v20080604.jar
org.eclipse.equinox.p2.engine_1.0.1.R34x_v20080827.jar
org.eclipse.equinox.p2.exemplarysetup_1.0.0.v20080427-2136.j ar
org.eclipse.equinox.p2.extensionlocation_1.0.2.R34x_v2008082 5.jar
org.eclipse.equinox.p2.garbagecollector_1.0.1.R34x_v20080818 .jar
org.eclipse.equinox.p2.jarprocessor_1.0.0.v20080514-1900.jar
org.eclipse.equinox.p2.metadata.generator_1.0.1.R34x_v200808 19.jar
org.eclipse.equinox.p2.metadata.repository_1.0.0.v20080604.j ar
org.eclipse.equinox.p2.metadata_1.0.0.v20080514-1900.jar
org.eclipse.equinox.p2.reconciler.dropins_1.0.2.R34x_v200809 09.jar
org.eclipse.equinox.p2.touchpoint.eclipse_1.0.2.R34x_v200809 10.jar
org.eclipse.equinox.p2.touchpoint.natives_1.0.0.v20080505-18 50.jar
org.eclipse.equinox.p2.ui.admin.rcp_1.0.0.v20080604.jar
org.eclipse.equinox.p2.ui.admin_1.0.0.v20080522-1735.jar
org.eclipse.equinox.p2.ui.sdk_1.0.1.R34x_v20080818.jar
org.eclipse.equinox.p2.ui_1.0.1.R34x_v20080909.jar
org.eclipse.equinox.p2.updatechecker_1.0.0.v20080427-2136.ja r
org.eclipse.equinox.p2.updatesite_1.0.1.R34x_v20080808-1156. jar
org.eclipse.equinox.preferences_3.2.201.R34x_v20080709.jar
org.eclipse.equinox.registry_3.4.0.v20080516-0950.jar
org.eclipse.equinox.security.ui_1.0.0.v20080603-1810.jar
org.eclipse.equinox.security.win32.x86_1.0.0.v20080529-1600. jar
org.eclipse.equinox.security_1.0.1.R34x_v20080721.jar
org.eclipse.equinox.simpleconfigurator.manipulator_1.0.2.R34 x_v20080911.jar
org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar
org.eclipse.help.appserver_3.1.300.v20080507.jar
org.eclipse.help.base_3.3.101.M20080728_34x.jar
org.eclipse.help.ui_3.3.101.M20080715_34x.jar
org.eclipse.help.webapp_3.3.101.M20080805_34x.jar
org.eclipse.help_3.3.101.v20080702_34x.jar
org.eclipse.jdt.compiler.apt_1.0.100.v20080513-1235.jar
org.eclipse.jdt.compiler.tool_1.0.100.v_883_R34x.jar
org.eclipse.jdt.core_3.4.2.v_883_R34x.jar
org.eclipse.jdt.debug_3.4.0.v20080604
org.eclipse.jdt.launching_3.4.1.v20080729_r341.jar
org.eclipse.jface.databinding_1.2.1.M20080827-0800a.jar
org.eclipse.jface.text_3.4.1.r341_v20080827-1100.jar
org.eclipse.jface_3.4.1.M20080827-2000.jar
org.eclipse.osgi.services_3.1.200.v20071203.jar
org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
org.eclipse.pde.runtime_3.4.0.v20080723-1000.jar
org.eclipse.swt.win32.win32.x86_3.4.1.v3449c.jar
org.eclipse.swt_3.4.1.v3449c.jar
org.eclipse.text_3.4.0.v20080605-1800.jar
org.eclipse.ui.forms_3.3.101.v20080708_34x.jar
org.eclipse.ui.ide_3.4.1.M20080903-2000.jar
org.eclipse.ui.navigator.resources_3.3.101.M20080910-0800.ja r
org.eclipse.ui.navigator_3.3.101.M20080827-0800.jar
org.eclipse.ui.net_1.0.0.I20080605.jar
org.eclipse.ui.views.log_1.0.0.v20080803-1700.jar
org.eclipse.ui.views.properties.tabbed_3.4.1.M20080730-0800. jar
org.eclipse.ui.views_3.3.0.I20080509-2000.jar
org.eclipse.ui.win32_3.2.100.v20080408-0800.jar
org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-110 0.jar
org.eclipse.ui.workbench_3.4.1.M20080827-0800a.jar
org.eclipse.ui_3.4.1.M20080910-0800.jar
org.eclipse.update.configurator_3.2.201.R34x_v20080819.jar
org.mortbay.jetty_5.1.14.v200806031611.jar
org.sat4j.core_2.0.0.v20080602.jar
org.sat4j.pb_2.0.0.v20080602.jar
Re: P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.reposit [message #119335 is a reply to message #119268] Sat, 11 October 2008 02:01 Go to previous messageGo to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
This rather surprising since there is code checking if the file is
up-to-date against the server. Is your repository completely p2 enabled?
You may want to put a breakpoint in
SimpleMetadataRepositoryFactory#validateAndLoad() to see what is
happening.
Re: P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.reposit [message #119438 is a reply to message #119335] Mon, 13 October 2008 13:41 Go to previous messageGo to next message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
In the Eclipse Product export wizard there is an option to generate a
metadata repository, this is how I've been creating the contents for my
update site.
Re: P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.reposit [message #119449 is a reply to message #119335] Mon, 13 October 2008 14:52 Go to previous messageGo to next message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
I'm deploying this P2 enabled RCP app with:

* empty org.eclipse.equinox.p2.metadata.repository\cache
* empty org.eclipse.equinox.p2.core\cache
* empty org.eclipse.equinox.p2.director\rollback
* a profile in org.eclipse.equinox.p2.engine\profileRegistry
* eclipse.equinox.p2.artifact.repository.prefs and
org.eclipse.equinox.p2.metadata.repository.prefs so that the update site
will be set up without any user action.
* with update preferences set as described in my initial post

On first launch of the RCP app a connection is made with the update site
server and content-1974464048.xml is cached in
org.eclipse.equinox.p2.metadata.repository\cache Also, the "Updates
Available" pop is presented. When clicked users are taken to Available
Updates and are able to click Next > and install the updates without
incident.

I'll make some changes in the RCP app code and build new repository
contents using the Eclipse Product export wizard option to "Generate
metadata repository" and replace what is on the update site with the newly
generated repository artifacts.

Next, I launch the RCP app expecting to be notified of "Updates Available"
but it never happens. If I navigate to the Help -> Software Updates...
Available Software tab and do a refresh, the updates I've put on the
server are listed and I'm able to install them with no problems.

I'm considering a hack to clean out these cache directories on start up
since that seems to correct the problem.

I'd love to debug SimpleMetadataRepositoryFactory#validateAndLoad(),
attaching the source was easy, however I need more information on how to
set up my debug configuration to work with a P2 enabled application.
Re: P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.reposit [message #119462 is a reply to message #119335] Mon, 13 October 2008 16:30 Go to previous messageGo to next message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
After looking at the code in ECFMetadataTransport#doGetLastModified I
tried doing a recursive touch on the server's update site folder. Didn't
work. Although, I'm not sure doGetLastModified is getting called.
Re: P2 Automatic Updates - problem with org.eclipse.equinox.p2.metadata.reposit [message #119475 is a reply to message #119335] Mon, 13 October 2008 18:45 Go to previous messageGo to next message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
May be related to bug 214816
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214816
Re: P2 Automatic Updates - temp solution [message #119498 is a reply to message #119335] Mon, 13 October 2008 22:29 Go to previous message
Matthew Trees is currently offline Matthew TreesFriend
Messages: 16
Registered: July 2009
Junior Member
This is a temporary hack I but in my RCP application's Activator which is
solving my Automatic Updates problem. It's also solving a problem with my
P2 repository growing quite large due to caching of launcher executables in
/p2/org.eclipse.equinox.p2.core/cache


/**
* This is a hack to remove P2 caches. Needed to ensure that
* Automatic Updates will recognize new content on the update site.
* May be able to remove this after P2 infrastructure hardens.
*
* A complete description may be found at
* http://www.eclipse.org/newsportal/article.php?id=5309&
* group=eclipse.technology.equinox#5309
*
* TODO: Revisit
*
*/
private void delP2Caches() {
File p2Dir = null;
IPath p2Path =
ResourcesPlugin.getWorkspace().getRoot().getLocation()
.append("../p2/org.eclipse.equinox.p2.metadata.repository/cache ");

p2Dir = p2Path.toFile();

if (p2Dir.exists()) {
Activator.deleteDirs(p2Dir);
}

p2Path = ResourcesPlugin.getWorkspace().getRoot().getLocation()
.append("../p2/org.eclipse.equinox.p2.core/cache");

p2Dir = p2Path.toFile();

if (p2Dir.exists()) {
Activator.deleteDirs(p2Dir);
}
}

private static void deleteDirs(File directory) {
if (directory.isDirectory()) {
String[] subdirs = directory.list();
for (int i=0; i < subdirs.length; i++) {
File f = new File(directory, subdirs[i]);
Activator.deleteDirs(f);
f.delete();
Logger.log(Activator.PLUGIN_ID, "deleteDirs",
"Deleting " + f, null, IStatus.INFO);//$NON-NLS-1$
}
}
}
Previous Topic:P2 update sites
Next Topic:ASM Dependency Issue
Goto Forum:
  


Current Time: Fri Apr 26 01:38:00 GMT 2024

Powered by FUDForum. Page generated in 0.03633 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top