Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » P2 check for updates doesn't work
P2 check for updates doesn't work [message #1711851] Tue, 20 October 2015 07:18 Go to next message
Eclipse UserFriend
Hi,

I'm trying to update my application using P2 following this online tutorial.

I have a p2 repository hosted on a local Apache server and my application doesn't seems to detect updates on it. There is also no P2 request logged in the access.log of the Apache server.

So I have two problems :
- When my p2 repo does not exist, update service doesn't throw an error or a warning.
- When my p2 repo is up and contains update, the update service tells me that there is no available update.

Do you have any advice to debug it simply ? or help me with some example code?

Here the code of my update handler :
public class UpdateHandler {
	
	/** The Logger */
	private static final Logger LOG = Logger.getLogger(UpdateHandler.class);
	
	/** The Repository URL */
	private static final String REPOSITORY_LOC = "http://localhost/repository";
	
	@Inject
	UISynchronize sync;
	
	@Execute
	public void execute(IProvisioningAgent agent, UpdateService updateService, IWorkbench workbench) {
		LOG.debug("execute: " + this.getClass().getName());
		
		LOG.debug("Adding P2 repository : " + REPOSITORY_LOC);
		P2Util.addRepository(agent, REPOSITORY_LOC);
		final CancelableOperation<Optional<UpdatePlan>> check = updateService.checkUpdate(ProgressReporter.NULLPROGRESS_REPORTER);
		
		check.onCancel(() -> showInformation("Operation cancelled"));
		check.onException(t -> showError(t.getStatus().getMessage()));
		check.onComplete(updatePlan -> {
			
			if (!updatePlan.isPresent()) {
				showInformation("Nothing to update");
			}
			else {
				if (showConfirmation("Updates available", "There are updates available. Do you want to install them now?")) {
					
					final CancelableOperation<UpdateResult> result = updatePlan.get().runUpdate(ProgressReporter.NULLPROGRESS_REPORTER);
					
					result.onCancel(() -> showInformation("Operation cancelled"));
					result.onException(t -> showError(t.getLocalizedMessage()));
					result.onComplete(r -> {
						if (showConfirmation("Updates installed, restart?", "Updates have been installed successfully, do you want to restart?")) {
							sync.syncExec(() -> workbench.restart());
						}
					});
				}
			}
		});
	}
}


And my P2Util used to add the repository location :
public class P2Util {
	
	/** The Logger */
	private static final Logger LOG = Logger.getLogger(P2Util.class);
	
	public static boolean addRepository(IProvisioningAgent agent, String repo) {
		
		IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
		IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
		
		if (metadataManager == null) {
			LOG.error("metadataManager is null!!!");
			return false;
		}
		if (artifactManager == null) {
			LOG.error("artifactManager is null!!!");
			return false;
		}
		try {
			URI uri = new URI(repo);
			metadataManager.addRepository(uri);
			artifactManager.addRepository(uri);
			
			return true;
		} catch (Exception e) {
			return false;
		}
	}
}
Re: P2 check for updates doesn't work [message #1711861 is a reply to message #1711851] Tue, 20 October 2015 07:54 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Are you executing it from the IDE or the exported product? IIRC p2 doesn't work well if the application is started from within the IDE.

If started from the IDE you might want to test if enabling Software Installation Support in the Run Configurations -> Configuration tab has any effect on this. But I never tested that one and verified the p2 updates on exported products.
Re: P2 check for updates doesn't work [message #1711905 is a reply to message #1711861] Tue, 20 October 2015 09:33 Go to previous messageGo to next message
Eclipse UserFriend
When executing it from the IDE ('Support software installation' is disabled), I got the error 'No provisioning job available', so that's what I expect.
But when executing it from the exported product (or enabling 'Support software installation'), I always got the message 'Nothing to update'. Even if the update repository exists or not, contains available updates or not...
Re: P2 check for updates doesn't work [message #1711920 is a reply to message #1711905] Tue, 20 October 2015 10:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Are you sure that your P2Util is working as intended? Have you tried using a p2.inf?
Re: P2 check for updates doesn't work [message #1711923 is a reply to message #1711905] Tue, 20 October 2015 10:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I guess you need to connect with a remote debugger to see what is going
wrong.

Tom

On 20.10.15 11:33, Thibault Pensec wrote:
> When executing it from the IDE ('Support software installation' is
> disabled), I got the error 'No provisioning job available', so that's
> what I expect. But when executing it from the exported product (or
> enabling 'Support software installation'), I always got the message
> 'Nothing to update'. Even if the update repository exists or not,
> contains available updates or not...
Re: P2 check for updates doesn't work [message #1711973 is a reply to message #1711920] Tue, 20 October 2015 13:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On first sight if looks ok - I guess we should ship such API/Helper as
part of e(fx)clipse on day ;-)

Tom

On 20.10.15 12:01, Dirk Fauth wrote:
> Are you sure that your P2Util is working as intended? Have you tried
> using a p2.inf?
Re: P2 check for updates doesn't work [message #1711974 is a reply to message #1711973] Tue, 20 October 2015 13:47 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Maybe, but AFAIK p2.inf has more functionality. And I prefer configuration over implementation in that case. If the URL ever changes I don't want to search the whole code for that URL. Also p2 provides the ability to host the metadata repository and the artifact repository at different locations (although I don't know how often that feature is really used).

Did you try to connect to your local update site via the Eclipse Installation Manager? It should be able to connect and to show the IUs in the installation dialog. Just to ensure that everything is ok with your update site.
Re: P2 check for updates doesn't work [message #1711976 is a reply to message #1711905] Tue, 20 October 2015 13:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you by chance forgot to increment the product-version?

Tom

On 20.10.15 11:33, Thibault Pensec wrote:
> When executing it from the IDE ('Support software installation' is
> disabled), I got the error 'No provisioning job available', so that's
> what I expect. But when executing it from the exported product (or
> enabling 'Support software installation'), I always got the message
> 'Nothing to update'. Even if the update repository exists or not,
> contains available updates or not...
Re: P2 check for updates doesn't work [message #1711987 is a reply to message #1711974] Tue, 20 October 2015 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Are you sure that your P2Util is working as intended? Have you tried using a p2.inf?

Yes, I've tried Wink But I really need to change P2 repository location at runtime.

Quote:
Did you try to connect to your local update site via the Eclipse Installation Manager?

Yes, it works perfectly.

I added some code in P2Util to check the repo when adding it to the IProvisioningAgent :
public class P2Util {
	
	/** The Logger */
	private static final Logger LOG = Logger.getLogger(P2Util.class);
	
	/**
	 * Add a repository to declared updates repositories.
	 * @return
	 */
	public static boolean addRepository(IProvisioningAgent agent, URI uri) {
		boolean added = true;
		
		IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
		IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
		
		if (metadataManager == null) {
			LOG.error("metadataManager is null!!!");
			return false;
		}
		if (artifactManager == null) {
			LOG.error("artifactManager is null!!!");
			return false;
		}
		
		try {
			
			metadataManager.addRepository(uri);
			metadataManager.loadRepository(uri, new NullProgressMonitor()); // HERE
			
			artifactManager.addRepository(uri);
			artifactManager.loadRepository(uri, new NullProgressMonitor()); // AND HERE
			
		} catch (Exception e) {
			LOG.error("An error occurred while adding repository from URI['" + uri + "']. Cause : ", e);
			added = false;
		}
		
		return added;
	}
}


Du to this code, the following error is thrown :
!ENTRY org.eclipse.ecf.provider.filetransfer.httpclient4 4 0 2015-10-20 16:46:33.222
!MESSAGE org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.provider.filetransfer.httpclient4;code=4;message=Warning: Platform proxy API not available;severity2;exception=java.lang.NoClassDefFoundError: org/eclipse/core/net/proxy/IProxyService;children=[]]
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/core/net/proxy/IProxyService
	at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.setupProxies(HttpClientRetrieveFileTransfer.java:316)
	at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:884)
	at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
	at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
	at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:426)
	at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(FileReader.java:358)
	at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:101)
	at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:156)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:735)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
	at dp.fast.app.update.util.P2Util.addRepository(P2Util.java:45)
	at dp.fast.app.update.handler.UpdateHandler.execute(UpdateHandler.java:49)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.fx.ui.workbench.renderers.base.BaseItemRenderer.executeAction(BaseItemRenderer.java:210)
	at org.eclipse.fx.ui.workbench.renderers.base.BaseMenuItemRenderer$1.run(BaseMenuItemRenderer.java:50)
	at org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:137)
	at org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:1)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.control.MenuItem.fire(MenuItem.java:462)
	at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1405)
	at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$343(ContextMenuContent.java:1358)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
	at com.sun.glass.ui.View.notifyMouse(View.java:937)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.net.proxy.IProxyService cannot be found by org.eclipse.ecf.provider.filetransfer_3.2.200.v20150810-1719
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 72 more


Re: P2 check for updates doesn't work [message #1711988 is a reply to message #1711987] Tue, 20 October 2015 15:08 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
so there's a missing dependency?

Tom

On 20.10.15 16:57, Thibault Pensec wrote:
> Quote:
>> Are you sure that your P2Util is working as intended? Have you tried
>> using a p2.inf?
>
> Yes, I've tried ;) But I really need to change P2 repository location at
> runtime.
> Quote:
>> Did you try to connect to your local update site via the Eclipse
>> Installation Manager?
>
> Yes, it works perfectly.
> I added some code in P2Util to check the repo when adding it to the
> IProvisioningAgent :
> public class P2Util {
>
> /** The Logger */
> private static final Logger LOG = Logger.getLogger(P2Util.class);
>
> /**
> * Add a repository to declared updates repositories.
> * @return
> */
> public static boolean addRepository(IProvisioningAgent agent, URI
> uri) {
> boolean added = true;
>
> IMetadataRepositoryManager metadataManager =
> (IMetadataRepositoryManager)
> agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
> IArtifactRepositoryManager artifactManager =
> (IArtifactRepositoryManager)
> agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
>
> if (metadataManager == null) {
> LOG.error("metadataManager is null!!!");
> return false;
> }
> if (artifactManager == null) {
> LOG.error("artifactManager is null!!!");
> return false;
> }
>
> try {
>
> metadataManager.addRepository(uri);
> metadataManager.loadRepository(uri, new
> NullProgressMonitor()); // HERE
>
> artifactManager.addRepository(uri);
> artifactManager.loadRepository(uri, new
> NullProgressMonitor()); // AND HERE
>
> } catch (Exception e) {
> LOG.error("An error occurred while adding repository from
> URI['" + uri + "']. Cause : ", e);
> added = false;
> }
>
> return added;
> }
> }
>
>
> Du to this code, the following error is thrown :
> !ENTRY org.eclipse.ecf.provider.filetransfer.httpclient4 4 0 2015-10-20
> 16:46:33.222
> !MESSAGE
> org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.provider.filetransfer.httpclient4;code=4;message=Warning:
> Platform proxy API not
> available;severity2;exception=java.lang.NoClassDefFoundError:
> org/eclipse/core/net/proxy/IProxyService;children=[]]
> !STACK 0
> java.lang.NoClassDefFoundError: org/eclipse/core/net/proxy/IProxyService
> at
> org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.setupProxies(HttpClientRetrieveFileTransfer.java:316)
>
> at
> org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:884)
>
> at
> org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
>
> at
> org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
>
> at
> org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:426)
>
> at
> org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(FileReader.java:358)
>
> at
> org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:101)
>
> at
> org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:156)
>
> at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:735)
>
> at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657)
>
> at
> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
>
> at
> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
>
> at dp.fast.app.update.util.P2Util.addRepository(P2Util.java:45)
> at
> dp.fast.app.update.handler.UpdateHandler.execute(UpdateHandler.java:49)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:497)
> at
> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
>
> at
> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
>
> at
> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
> at
> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
>
> at
> org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
>
> at
> org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
>
> at
> org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
>
> at
> org.eclipse.fx.ui.workbench.renderers.base.BaseItemRenderer.executeAction(BaseItemRenderer.java:210)
>
> at
> org.eclipse.fx.ui.workbench.renderers.base.BaseMenuItemRenderer$1.run(BaseMenuItemRenderer.java:50)
>
> at
> org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:137)
>
> at
> org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:1)
>
> at
> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
>
> at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
>
> at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
>
> at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
>
> at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>
> at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
> at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
> at javafx.event.Event.fireEvent(Event.java:198)
> at javafx.scene.control.MenuItem.fire(MenuItem.java:462)
> at
> com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1405)
>
> at
> com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$343(ContextMenuContent.java:1358)
>
> at
> com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
>
> at
> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
>
> at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
>
> at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
>
> at
> com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
>
> at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
>
> at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>
> at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>
> at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>
> at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>
> at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>
> at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>
> at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>
> at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
> at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
> at javafx.event.Event.fireEvent(Event.java:198)
> at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
> at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
> at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
> at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
> at
> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
>
> at
> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388)
>
> at
> com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
>
> at
> com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
>
> at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
> at com.sun.glass.ui.View.notifyMouse(View.java:937)
> at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
> at
> com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
>
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.core.net.proxy.IProxyService cannot be found by
> org.eclipse.ecf.provider.filetransfer_3.2.200.v20150810-1719
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
>
> at
> org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 72 more
>
>
>
Re: P2 check for updates doesn't work [message #1711991 is a reply to message #1711988] Tue, 20 October 2015 15:22 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
We are simply repackaging the ecf-Feature they provide and it looks like
they don't bring "org.eclipse.core.net" with them.

I've update our target to ship core.net now as well and started a new
build. You should try adding core.net to your feature and check if
things now work with an exception?

Tom

On 20.10.15 17:08, Tom Schindl wrote:
> so there's a missing dependency?
>
> Tom
>
> On 20.10.15 16:57, Thibault Pensec wrote:
>> Quote:
>>> Are you sure that your P2Util is working as intended? Have you tried
>>> using a p2.inf?
>>
>> Yes, I've tried ;) But I really need to change P2 repository location at
>> runtime.
>> Quote:
>>> Did you try to connect to your local update site via the Eclipse
>>> Installation Manager?
>>
>> Yes, it works perfectly.
>> I added some code in P2Util to check the repo when adding it to the
>> IProvisioningAgent :
>> public class P2Util {
>>
>> /** The Logger */
>> private static final Logger LOG = Logger.getLogger(P2Util.class);
>>
>> /**
>> * Add a repository to declared updates repositories.
>> * @return
>> */
>> public static boolean addRepository(IProvisioningAgent agent, URI
>> uri) {
>> boolean added = true;
>>
>> IMetadataRepositoryManager metadataManager =
>> (IMetadataRepositoryManager)
>> agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
>> IArtifactRepositoryManager artifactManager =
>> (IArtifactRepositoryManager)
>> agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
>>
>> if (metadataManager == null) {
>> LOG.error("metadataManager is null!!!");
>> return false;
>> }
>> if (artifactManager == null) {
>> LOG.error("artifactManager is null!!!");
>> return false;
>> }
>>
>> try {
>>
>> metadataManager.addRepository(uri);
>> metadataManager.loadRepository(uri, new
>> NullProgressMonitor()); // HERE
>>
>> artifactManager.addRepository(uri);
>> artifactManager.loadRepository(uri, new
>> NullProgressMonitor()); // AND HERE
>>
>> } catch (Exception e) {
>> LOG.error("An error occurred while adding repository from
>> URI['" + uri + "']. Cause : ", e);
>> added = false;
>> }
>>
>> return added;
>> }
>> }
>>
>>
>> Du to this code, the following error is thrown :
>> !ENTRY org.eclipse.ecf.provider.filetransfer.httpclient4 4 0 2015-10-20
>> 16:46:33.222
>> !MESSAGE
>> org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.provider.filetransfer.httpclient4;code=4;message=Warning:
>> Platform proxy API not
>> available;severity2;exception=java.lang.NoClassDefFoundError:
>> org/eclipse/core/net/proxy/IProxyService;children=[]]
>> !STACK 0
>> java.lang.NoClassDefFoundError: org/eclipse/core/net/proxy/IProxyService
>> at
>> org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransfer.setupProxies(HttpClientRetrieveFileTransfer.java:316)
>>
>> at
>> org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:884)
>>
>> at
>> org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
>>
>> at
>> org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
>>
>> at
>> org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:426)
>>
>> at
>> org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(FileReader.java:358)
>>
>> at
>> org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:101)
>>
>> at
>> org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:156)
>>
>> at
>> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:735)
>>
>> at
>> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657)
>>
>> at
>> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
>>
>> at
>> org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
>>
>> at dp.fast.app.update.util.P2Util.addRepository(P2Util.java:45)
>> at
>> dp.fast.app.update.handler.UpdateHandler.execute(UpdateHandler.java:49)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:497)
>> at
>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
>> at
>> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
>>
>> at
>> org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
>>
>> at
>> org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
>> at
>> org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
>>
>> at
>> org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
>>
>> at
>> org.eclipse.fx.ui.workbench.renderers.base.BaseItemRenderer.executeAction(BaseItemRenderer.java:210)
>>
>> at
>> org.eclipse.fx.ui.workbench.renderers.base.BaseMenuItemRenderer$1.run(BaseMenuItemRenderer.java:50)
>>
>> at
>> org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:137)
>>
>> at
>> org.eclipse.fx.ui.workbench.renderers.fx.DefMenuItemRenderer$MenuItemImpl$2.handle(DefMenuItemRenderer.java:1)
>>
>> at
>> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
>>
>> at
>> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
>>
>> at
>> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
>>
>> at
>> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
>>
>> at
>> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>>
>> at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
>> at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
>> at javafx.event.Event.fireEvent(Event.java:198)
>> at javafx.scene.control.MenuItem.fire(MenuItem.java:462)
>> at
>> com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1405)
>>
>> at
>> com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$343(ContextMenuContent.java:1358)
>>
>> at
>> com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
>>
>> at
>> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
>>
>> at
>> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
>>
>> at
>> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
>>
>> at
>> com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
>>
>> at
>> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
>>
>> at
>> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>>
>> at
>> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>>
>> at
>> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>>
>> at
>> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>>
>> at
>> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>>
>> at
>> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
>>
>> at
>> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
>>
>> at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
>> at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
>> at javafx.event.Event.fireEvent(Event.java:198)
>> at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
>> at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
>> at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
>> at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
>> at
>> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
>>
>> at
>> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
>>
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388)
>>
>> at
>> com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
>>
>> at
>> com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
>>
>> at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
>> at com.sun.glass.ui.View.notifyMouse(View.java:937)
>> at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
>> at
>> com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
>>
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: java.lang.ClassNotFoundException:
>> org.eclipse.core.net.proxy.IProxyService cannot be found by
>> org.eclipse.ecf.provider.filetransfer_3.2.200.v20150810-1719
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
>>
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
>>
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
>>
>> at
>> org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
>>
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>> ... 72 more
>>
>>
>>
>
Re: P2 check for updates doesn't work [message #1711998 is a reply to message #1711991] Tue, 20 October 2015 16:30 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
You should try adding core.net to your feature and check if things now work with an exception?


Great ! Things seem to work better, now I can see P2 requests in my Apache server access.log.

But the problem remains the same, no updates are found even if the repository contains available updates Confused

Could you tell me more about Remote RCP debugging ?
Re: P2 check for updates doesn't work [message #1712001 is a reply to message #1711998] Tue, 20 October 2015 16:45 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You've not responded to my initial question have you ugraded the .product version this crucial to make p2 detect updates! The feature version is not enough!
Re: P2 check for updates doesn't work [message #1712002 is a reply to message #1712001] Tue, 20 October 2015 16:52 Go to previous messageGo to next message
Eclipse UserFriend
Quote:

You've not responded to my initial question have you ugraded the .product version this crucial to make p2 detect updates!

Sorry !! In fact it works very well when upgrading the .product version Cool

Thank you very much.
Re: P2 check for updates doesn't work [message #1712003 is a reply to message #1712002] Tue, 20 October 2015 17:05 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I'll Investigate in the next few days what needs to happen to make upgrades possible without that
Re: P2 check for updates doesn't work [message #1712008 is a reply to message #1712002] Tue, 20 October 2015 17:35 Go to previous messageGo to next message
Eclipse UserFriend
A last thing Smile To make the update visible, I need to manually delete the workspace/ folder at the root of my exported product...
And calling the workbench.restart() method simply close the application but don't restart it.

Do I have to do something else before restarting the application ? Like removing workspace/ folder manually ?
Re: P2 check for updates doesn't work [message #1712014 is a reply to message #1712008] Tue, 20 October 2015 18:01 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
It depends what the update does and what you want to happen there's the
RestartService who allows to clear the persisted state on restart.

Tom

On 20.10.15 19:35, Thibault Pensec wrote:
> A last thing :) To make the update visible, I need to manually delete
> the workspace/ folder at the root of my exported product... And calling
> the workbench.restart() method simply close the application but don't
> restart it.
> Do I have to do something else before restarting the application ? Like
> removing workspace/ folder manually ?
Re: P2 check for updates doesn't work [message #1712016 is a reply to message #1712014] Tue, 20 October 2015 18:11 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I've now added the equinox.security and core.net to the p2-feature so if
you update the target you should get core.net deployed.

Tom

On 20.10.15 20:01, Tom Schindl wrote:
> It depends what the update does and what you want to happen there's the
> RestartService who allows to clear the persisted state on restart.
>
> Tom
>
> On 20.10.15 19:35, Thibault Pensec wrote:
>> A last thing :) To make the update visible, I need to manually delete
>> the workspace/ folder at the root of my exported product... And calling
>> the workbench.restart() method simply close the application but don't
>> restart it.
>> Do I have to do something else before restarting the application ? Like
>> removing workspace/ folder manually ?
>
Re: P2 check for updates doesn't work [message #1712024 is a reply to message #1712016] Tue, 20 October 2015 19:28 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
According to https://wiki.eclipse.org/Tycho/eclipse-repository should do
the trick but when doing the export with PDE inside Eclipse this does
not work, need to test this with a tycho build.

Tom

On 20.10.15 20:11, Tom Schindl wrote:
> I've now added the equinox.security and core.net to the p2-feature so if
> you update the target you should get core.net deployed.
>
> Tom
>
> On 20.10.15 20:01, Tom Schindl wrote:
>> It depends what the update does and what you want to happen there's the
>> RestartService who allows to clear the persisted state on restart.
>>
>> Tom
>>
>> On 20.10.15 19:35, Thibault Pensec wrote:
>>> A last thing :) To make the update visible, I need to manually delete
>>> the workspace/ folder at the root of my exported product... And calling
>>> the workbench.restart() method simply close the application but don't
>>> restart it.
>>> Do I have to do something else before restarting the application ? Like
>>> removing workspace/ folder manually ?
>>
>
Previous Topic:efxclipse AdapterService vs e4 IAdapterManager
Next Topic:Application title bar with extra options
Goto Forum:
  


Current Time: Thu Mar 28 16:03:35 GMT 2024

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

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

Back to the top