Community
Participate
Working Groups
Build Identifier: 20100917-0705 The failure behavior of prestartupdate differs based on whether the URI to the repository is specified with http:// or file:///. This can make debugging particularly difficult. Here is a summary of my experience: 1. Check out fresh prestartupdate example from: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.equinox/p2/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate/?root=RT_Project 2. Edit repository URLs in p2.inf to point to my planned update site: instructions.configure=\ addRepository(type:0,location:http${#58}//10.1.1.44/psu);\ addRepository(type:1,location:http${#58}//10.1.1.44/psu); 3. Export version 1.0.0.qualifier of the prestartupdate.product to C:\psu-1.0.0. The "Generate metadata repository" option is checked. 4. Update version numbers to 1.0.1.qualifier in plugin.xml and prestartupdate.product. Export version 1.0.1.qualifier to C:\psu-1.0.1. 5. Move C:\psu-1.0.1\repository into place such that the web server serves it at http://10.1.1.44/psu. 6. Launch the application at C:\psu-1.0.0\eclipse\prestartupdate.exe. 7. The application launches and shows "No updates were found", even though an update exists. C:\psu-1.0.0\eclipse\workspace\.metadata\.log does not show any errors (in fact, it doesn't exist), making troubleshooting difficult. 8. Update p2.inf to use file:/// access instead of http://. p2.inf now looks like: instructions.configure=\ addRepository(type:0,location:file${#58}///C:/psu);\ addRepository(type:1,location:file${#58}///C:/psu); 9. Update version numbers to 1.0.2.qualifier in plugin.xml and prestartupdate.product. Export to C:\psu-1.0.2. 10. Update version numbers to 1.0.3.qualifier in plugin.xml and prestartupdate.product. Export to C:\psu-1.0.3. 11. Move C:\psu-1.0.3\repository to C:\psu. 12. Launch C:\psu-1.0.2\eclipse\prestartupdate.exe. 13. Again, the application shows "No updates were found" but this time the .log at C:\psu-1.0.2\eclipse\workspace\.metadata\.log shows an error: !ENTRY org.eclipse.equinox.p2.engine 4 4 2011-02-17 16:00:54.921 !MESSAGE An error occurred while collecting items to be installed !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2011-02-17 16:00:54.921 !MESSAGE session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). !SUBENTRY 1 org.eclipse.equinox.p2.repository 4 1002 2011-02-17 16:00:54.921 !MESSAGE Unable to read repository at file:/C:/psu/plugins/org.eclipse.equinox.p2.examples.rcp.prestartupdate_1.0.3.201102171559.jar. !STACK 0 org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:359) at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:1540) at org.eclipse.swt.graphics.GC.<init>(GC.java:166) at org.eclipse.swt.graphics.GC.<init>(GC.java:132) at org.eclipse.jface.dialogs.Dialog.shortenText(Dialog.java:349) at org.eclipse.jface.dialogs.ProgressMonitorDialog$ProgressMonitor.subTask(ProgressMonitorDialog.java:234) at org.eclipse.core.runtime.SubMonitor$RootInfo.subTask(SubMonitor.java:280) at org.eclipse.core.runtime.SubMonitor.subTask(SubMonitor.java:578) at org.eclipse.core.runtime.ProgressMonitorWrapper.subTask(ProgressMonitorWrapper.java:156) at org.eclipse.core.runtime.SubProgressMonitor.subTask(SubProgressMonitor.java:174) at org.eclipse.core.runtime.SubMonitor$RootInfo.subTask(SubMonitor.java:280) at org.eclipse.core.runtime.SubMonitor.subTask(SubMonitor.java:578) at org.eclipse.equinox.internal.p2.repository.FileReader.handleTransferEvent(FileReader.java:180) at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.fireTransferReceiveDataEvent(AbstractRetrieveFileTransfer.java:388) at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.handleReceivedData(AbstractRetrieveFileTransfer.java:288) at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer$1.performFileTransfer(AbstractRetrieveFileTransfer.java:173) at org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:74) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) ... 14. The error provides a lead by which to troubleshoot with and leads to the following resources: http://www.eclipse.org/forums/index.php?t=msg&goto=128821& https://bugs.eclipse.org/bugs/show_bug.cgi?id=321350 15. Update ApplicationWorkbenchWindowAdvisor.java to pass a NullProgressMonitor to P2Utils.checkForUpdates(): public void postWindowOpen() { final IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper .getService(Activator.bundleContext, IProvisioningAgent.SERVICE_NAME); if (agent == null) { LogHelper .log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No provisioning agent found. This application is not set up for updates.")); } // XXX if we're restarting after updating, don't check again. final IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore(); if (prefStore.getBoolean(JUSTUPDATED)) { prefStore.setValue(JUSTUPDATED, false); return; } // XXX check for updates before starting up. // If an update is performed, restart. Otherwise log // the status. IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // ================================ // MADE CHANGE HERE // ================================ // IStatus updateStatus = P2Util.checkForUpdates(agent, monitor); IStatus updateStatus = P2Util.checkForUpdates(agent, new NullProgressMonitor()); // ================================ if (updateStatus.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) { PlatformUI.getWorkbench().getDisplay() .asyncExec(new Runnable() { public void run() { MessageDialog.openInformation(null, "Updates", "No updates were found"); } }); } else if (updateStatus.getSeverity() != IStatus.ERROR) { prefStore.setValue(JUSTUPDATED, true); PlatformUI.getWorkbench().restart(); } else { LogHelper.log(updateStatus); } } }; try { new ProgressMonitorDialog(null).run(true, true, runnable); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InterruptedException e) { } } 16. Update versions and export version 1.0.4.qualifier to C:\psu-1.0.4. 17. Update versions and export version 1.0.5.qualifier to C:\psu-1.0.5. 18. Move C:\psu-1.0.5\repository to C:\psu. 19. Launch C:\psu-1.0.4\eclipse\prestartupdate.exe. The application now finds the update, installs it, and restarts successfully. 20. Revert p2.inf to use http:// in repository URLs (see step 2). 21. Update versions and export version 1.0.6.qualifier to C:\psu-1.0.6. 22. Update versions and export version 1.0.7.qualifier to C:\psu-1.0.7. 23. Move C:\psu-1.0.7\repository into place such that the web server serves it at http://10.1.1.44/psu. 24. Launch C:\psu-1.0.6\eclipse\prestartupdate.exe. The application finds the update, installs it, and restarts successfully. Aside from the issue raised in bug 321350, why does the error behavior differ for http:// (step 7) vs. file:/// (step 13) repository access? More specifically, why does http:// fail silently? Reproducible: Always
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.