Skip to content

Conversation

@trancexpress
Copy link
Contributor

@trancexpress trancexpress commented Nov 14, 2025

When running UpdateUnitVersionsCommandTests in Eclipse, the test fails. An error is logged before the fail:

!ENTRY org.eclipse.pde.genericeditor.extension 2 0 2025-11-14 12:34:50.660
!MESSAGE Cannot invoke "org.eclipse.equinox.internal.p2.repository.Transport.download(java.net.URI, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)" because the return value of "org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.getTransport()" is null
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.equinox.internal.p2.repository.Transport.download(java.net.URI, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)" because the return value of "org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.getTransport()" is null
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.handleRemoteIndexFile(AbstractRepositoryManager.java:797)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:791)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:727)
	at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:107)
	at org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager.loadRepository(IMetadataRepositoryManager.java:101)
	at org.eclipse.pde.internal.genericeditor.target.extension.p2.P2Fetcher.fetchAvailableUnits(P2Fetcher.java:63)
	at org.eclipse.pde.internal.genericeditor.target.extension.model.RepositoryCache.lambda$11(RepositoryCache.java:106)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:187)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

If I restore defaults in the launch config, this code finds the service for Transport in the bundle org.eclipse.equinox.p2.transport.ecf: org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.lookupServiceRegistrations(String, Filter)

				/* services registered under the class name */
				result = publishedServicesByClass.get(clazz);

filter has contents:

(|(p2.agent.service.name=org.eclipse.equinox.internal.p2.repository.Transport)(p2.agent.servicename=org.eclipse.equinox.internal.p2.repository.Transport))

Should be defined in this file I guess:

https://github.com/eclipse-equinox/p2/blob/master/bundles/org.eclipse.equinox.p2.transport.ecf/OSGI-INF/ecfTransport.xml

@trancexpress
Copy link
Contributor Author

trancexpress commented Nov 14, 2025

This doesn't fix anything in #666, but I can debug at least.

It makes me wonder if some other dependency is missing... mainly due to not failing in Jenkins. Maybe we should add some other plug-in, that depends on org.eclipse.equinox.p2.transport.ecf...

See also comment from @merks : #666 (comment)

@eclipse-pde-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

ui/org.eclipse.pde.genericeditor.extension.tests/META-INF/MANIFEST.MF
ui/org.eclipse.pde.genericeditor.extension.tests/pom.xml

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 53be7fbeb38bf98d9f94f865c2d53c669f4e71c5 Mon Sep 17 00:00:00 2001
From: Eclipse PDE Bot <[email protected]>
Date: Fri, 14 Nov 2025 11:27:34 +0000
Subject: [PATCH] Version bump(s) for 4.38 stream


diff --git a/ui/org.eclipse.pde.genericeditor.extension.tests/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.genericeditor.extension.tests/META-INF/MANIFEST.MF
index 9807583418..eaf513d980 100644
--- a/ui/org.eclipse.pde.genericeditor.extension.tests/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.pde.genericeditor.extension.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tests for Generic Target Platform Editor
 Bundle-SymbolicName: org.eclipse.pde.genericeditor.extension.tests
-Bundle-Version: 1.3.100.qualifier
+Bundle-Version: 1.3.200.qualifier
 Bundle-Vendor: Eclipse.org
 Bundle-RequiredExecutionEnvironment: JavaSE-21
 Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
diff --git a/ui/org.eclipse.pde.genericeditor.extension.tests/pom.xml b/ui/org.eclipse.pde.genericeditor.extension.tests/pom.xml
index 2f8d41039c..f680559b39 100644
--- a/ui/org.eclipse.pde.genericeditor.extension.tests/pom.xml
+++ b/ui/org.eclipse.pde.genericeditor.extension.tests/pom.xml
@@ -18,7 +18,7 @@
     <relativePath>../../</relativePath>
   </parent>
   <artifactId>org.eclipse.pde.genericeditor.extension.tests</artifactId>
-  <version>1.3.100-SNAPSHOT</version>
+  <version>1.3.200-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

org.eclipse.pde.genericeditor.extension,
org.eclipse.pde.core,
org.eclipse.equinox.p2.metadata,
org.eclipse.equinox.p2.transport.ecf,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring a concrete implementation her is likely wrong in many ways.

Instead the provider needs to provide approciate capbilty (service or implementor) and the consumer (where NPE occures) require appropriate requirement (either service or implementor capabilty)

A consumer bunlde like this should not need any of those!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. I should be opening a ticket for org.eclipse.equinox.p2.repository?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't get too fussed out about the best, proper, correct way for a test; it's only an opinion. There aren't so many folks writing new p2-based application that will benefit from improved ways to specify dependencies; it's an assumption with not statistical basis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if I run the code from the stack trace in any launch, it will fail unless I have a dependency like the one here? Something must be missing either in the launch configuration or in the dependencies. If this can be fixed centrally or if the launch configuration code has errors, best to do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. I should be opening a ticket for org.eclipse.equinox.p2.repository?

If you like to solve it yes it would be the right place but be prepared that you likely need to drive that on your own (but we can help).

To see how it work in general you can look at this recent PR:

eclipse-equinox/equinox#1206

or how SWT handle the svg requirements, we also have examples for declarative services.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @laeubi , lets continue here then: eclipse-equinox/p2#972

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that all the tests pass seems like a good thing. Future improvement could be saved for the future...

@trancexpress trancexpress marked this pull request as draft November 14, 2025 11:45
@github-actions
Copy link

Test Results

   771 files  ±0     771 suites  ±0   1h 1m 28s ⏱️ + 3m 28s
 3 648 tests ±0   3 594 ✅ +2   54 💤 ±0  0 ❌  - 2 
10 878 runs  ±0  10 715 ✅ +2  163 💤 ±0  0 ❌  - 2 

Results for commit 1ce9856. ± Comparison against base commit 85b502b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants