Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return value of "java.util.function.Function.apply(Object)" is null when attempting to install plugin(s) #1535

Open
jakeogh opened this issue Dec 29, 2024 · 4 comments

Comments

@jakeogh
Copy link

jakeogh commented Dec 29, 2024

Eclipse Version: 2024-12 (4.34.0)
Build id: 20241128-0757

While attempting to install PEx_for_Kinetis_3.0.0.zip I get:

An error occurred while collecting items to be installed
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Cannot invoke "java.lang.Comparable.compareTo(Object)" because the return value of "java.util.function.Function.apply(Object)" is null
Cannot invoke "java.lang.Comparable.compareTo(Object)" because the return value of "java.util.function.Function.apply(Object)" is null

This happens when I launch eclipse as root as well. The prequisite plugin freescale_updater.zip installs without issue. I suspect this problem is not related to the specific plugin, becuase there is a open issue on the old bugtracker with the same error attempting to install a different plugin: https://bugs.eclipse.org/bugs/show_bug.cgi?id=583494 (the 2nd comment on that bug is from me).

Attempting the same install on a slightly older Eclipse:
Eclipse Version: 2023-06 (4.28.0)
Build id: 20230608-1333

I get what looks like a related error:

An error occurred while collecting items to be installed
session context was:(profile=epp.package.parallel, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Cannot invoke "String.compareTo(String)" because the return value of "org.eclipse.equinox.internal.p2.metadata.InstallableUnit.getId()" is null
Cannot invoke "String.compareTo(String)" because the return value of "org.eclipse.equinox.internal.p2.metadata.InstallableUnit.getId()" is null

In both cases, I started with a empty workspace and no other non-default plugins installed. I'm on gentoo-latest. My system JRE is:

$ java --version
openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment Temurin-23.0.1+11 (build 23.0.1+11)
OpenJDK 64-Bit Server VM Temurin-23.0.1+11 (build 23.0.1+11, mixed mode, sharing)

But as the bug notes, I think Eclipse bundles it's own JRE(?)

@laeubi
Copy link
Contributor

laeubi commented Dec 29, 2024

Do you see any exceptions (e.g. error log or eclipse log) together with this? Beside this I think it is more a P2 thing than PDE.

Also where one gets this PEx_for_Kinetis_3.0.0.zip from to reproduce the problem?

@jakeogh
Copy link
Author

jakeogh commented Dec 29, 2024

Thanks! PEx_for_Kinetis_3.0.0.zip is contained within the zip file PEx_for_Kinetis_3.0.0_Install_into_Eclipse_4.4_Unzip_me.zip (sha3-256 ca9140183e522567ea1c72a4335ee7ce379d57a4a92dfa376914d463764f4014) which can be obtained from:
https://www.nxp.com/design/design-center/software/development-software/processor-expert-software/processor-expert-software-microcontroller-driver-suite:PE_DRIVER_SUITE?amp;tid=PEH

under the download header PEx-KINETIS-v3.0-PLUGIN-ECLIPSE_4.4

I followed the instructions PEx_for_Kinetis_Installation_Guide.pdf which is also contained within PEx_for_Kinetis_3.0.0_Install_into_Eclipse_4.4_Unzip_me.zip

I'm new to Eclipse, just found the debug CLI options:

$ ./eclipse -consoleLog -debug
<snip>
Starting application: 2037
Application started in : 11266ms

<plugin install attempt starts here>

!SESSION 2024-12-28 22:57:08.014 -----------------------------------------------
eclipse.buildId=4.34.0.20241128-0756
java.version=21.0.5
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Framework arguments:  -product org.eclipse.epp.package.cpp.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product -consoleLog -debug

!ENTRY org.eclipse.equinox.p2.metadata.repository 2 0 2024-12-28 22:57:28.177
!MESSAGE Error parsing metadata repository
!SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2024-12-28 22:57:28.177
!MESSAGE Error in file:/home/cfg/_priv/clients/arizona.edu/ctia/k70_application/eclipse-cpp-2024-12-R-linux-gtk-x86_64.tar.gz_dir/eclipse/p2/org.eclipse.equinox.p2.repository/cache/content-1179742082.jar at line 5213, column 45: Missing required attribute in "unit": id

!ENTRY org.eclipse.equinox.p2.engine 4 4 2024-12-28 22:58:08.909
!MESSAGE An error occurred while collecting items to be installed
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2024-12-28 22:58:08.910
!MESSAGE session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2024-12-28 22:58:08.910
!MESSAGE Cannot invoke "java.lang.Comparable.compareTo(Object)" because the return value of "java.util.function.Function.apply(Object)" is null
!STACK 0
java.lang.NullPointerException: Cannot invoke "java.lang.Comparable.compareTo(Object)" because the return value of "java.util.function.Function.apply(Object)" is null
        at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473)
        at java.base/java.util.Comparator.lambda$thenComparing$36697e65$1(Comparator.java:220)
        at org.eclipse.equinox.internal.p2.metadata.InstallableUnit.compareTo(InstallableUnit.java:129)
        at org.eclipse.equinox.internal.p2.metadata.InstallableUnit.compareTo(InstallableUnit.java:1)
        at java.base/java.util.TreeMap.put(TreeMap.java:849)
        at java.base/java.util.TreeMap.put(TreeMap.java:569)
        at java.base/java.util.TreeSet.add(TreeSet.java:259)
        at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:338)
        at java.base/java.util.TreeSet.addAll(TreeSet.java:313)
        at java.base/java.util.TreeSet.<init>(TreeSet.java:164)
        at org.eclipse.equinox.p2.engine.ProvisioningContext.getInstallableUnitSources(ProvisioningContext.java:328)
        at org.eclipse.equinox.internal.p2.engine.phases.AuthorityChecker.start(AuthorityChecker.java:87)
        at org.eclipse.equinox.internal.p2.engine.phases.Collect.completePhase(Collect.java:97)
        at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:254)
        at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:105)
        at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:65)
        at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:95)
        at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:49)
        at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:159)
        at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:76)
        at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:187)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Regarding the error: content-1179742082.jar at line 5213, column 45: Missing required attribute in "unit": id:

$ file cache/content-1179742082.jar
cache/content-1179742082.jar: Java archive data (JAR)

$ cp cache/content-1179742082.jar ~/jar
$ cd ~/jar
$ jar xf content-1179742082.jar 
$ ls
total 1.4M
   0 drwxr-xr-x 2 user user   80 2024-12-28 23:04:53 .
   0 drwxrwxrwt 9 user user  280 2024-12-28 23:04:00 ..
200K -rw-r--r-- 1 user user 200K 2024-12-28 23:04:06 content-1179742082.jar
1.2M -rw-r--r-- 1 user user 1.2M 2015-04-29 18:08:36 content.xml

Looking at line 5213 of content.xml with less there is a null id <unit>:

<unit version='0.0.0' singleton='false'>
    <touchpoint id='null' version='0.0.0'/>
</unit>                                       

Should I re-file under https://github.com/eclipse-equinox/p2?

@jakeogh
Copy link
Author

jakeogh commented Dec 29, 2024

Going back to:
Version: 2023-03 (4.27.0)
Build id: 20230309-1520

The cache/content-1179742082.jar at line 5213, column 45: Missing required attribute in "unit": id error still appears on PEx_for_Kinetis_3.0.0.zip install, but the instillation succeeds.

So the problem appeared between versions 4.27.0 and 4.28.0.

@merks
Copy link
Contributor

merks commented Dec 30, 2024

Yes, this looks like a p2 problem. Though that being said, it looks more like a problem that the update site is corrupt because it's widely assumed that the ID is non-null. Perhaps the deserializer should omit such things, or map null to "". But then what else should it all do to turn invalid input into not-so-invalid data? Better would be to fix the update site, or add id="" to that file at the point at which it complains if this is some content for which the folks have stopped providing updates.

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

No branches or pull requests

3 participants