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

FileTargetDefinitionContent: Improve exception message #2728

Conversation

cedric780
Copy link
Contributor

Improve exception message when BundlesAction.createBundleArtifactKey(...) fails with the below stack trace, to at least know which .jar file couldn't be read.

[ERROR] Could not resolve content of rcp.target
[ERROR] org.eclipse.core.runtime.AssertionFailedException: null argument:
[ERROR] 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:88)
[ERROR] 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:76)
[ERROR] 	at org.eclipse.equinox.internal.p2.metadata.ArtifactKey.<init>(ArtifactKey.java:79)
[ERROR] 	at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleArtifactKey(BundlesAction.java:134)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.readBundles(FileTargetDefinitionContent.java:162)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.preload(FileTargetDefinitionContent.java:87)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.query(FileTargetDefinitionContent.java:71)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContentWithExceptions(TargetDefinitionResolver.java:159)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetDefinitionResolver.resolveContent(TargetDefinitionResolver.java:102)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.resolveFromArguments(TargetDefinitionResolverService.java:93)
[ERROR] 	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetDefinitionResolverService.getTargetDefinitionContent(TargetDefinitionResolverService.java:68)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.resolveTargetDefinitions(TargetPlatformFactoryImpl.java:214)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:164)
[ERROR] 	at org.eclipse.tycho.p2resolver.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:137)
[ERROR] 	at org.eclipse.tycho.p2resolver.P2ResolverImpl.resolveMetadata(P2ResolverImpl.java:165)
[ERROR] 	at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.validateTarget(TPValidationMojo.java:225)
[ERROR] 	at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.execute(TPValidationMojo.java:155)
[ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
[ERROR] 	at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
[ERROR] 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
[ERROR] 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
[ERROR] 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
[ERROR] 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
[ERROR] 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)

Stack trace made with tycho 4.0.0 .

Improve exception message when BundlesAction.createBundleArtifactKey(...) fails with the below stack trace, to at least know which .jar file couldn't be read.

[ERROR] Could not resolve content of rcp.target
[ERROR] org.eclipse.core.runtime.AssertionFailedException: null argument:
[ERROR] 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:88)
[ERROR] 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:76)
[ERROR] 	at org.eclipse.equinox.internal.p2.metadata.ArtifactKey.<init>(ArtifactKey.java:79)
[ERROR] 	at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleArtifactKey(BundlesAction.java:134)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.readBundles(FileTargetDefinitionContent.java:167)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.preload(FileTargetDefinitionContent.java:89)
[ERROR] 	at org.eclipse.tycho.p2.resolver.FileTargetDefinitionContent.query(FileTargetDefinitionContent.java:73)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetDefinitionResolver.resolveContentWithExceptions(TargetDefinitionResolver.java:170)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetDefinitionResolver.resolveContent(TargetDefinitionResolver.java:110)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.resolveFromArguments(TargetDefinitionResolverService.java:86)
[ERROR] 	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.getTargetDefinitionContent(TargetDefinitionResolverService.java:59)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.resolveTargetDefinitions(TargetPlatformFactoryImpl.java:209)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:161)
[ERROR] 	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:134)
[ERROR] 	at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveMetadata(P2ResolverImpl.java:174)
[ERROR] 	at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.validateTarget(TPValidationMojo.java:223)
[ERROR] 	at org.eclipse.tycho.extras.tpvalidator.TPValidationMojo.execute(TPValidationMojo.java:152)
[ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

looks good, thanks for the patch!

@laeubi
Copy link
Member

laeubi commented Aug 23, 2023

@cedric780 can you please make sure that you sign the ECA?

@laeubi laeubi added the backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change label Aug 23, 2023
@github-actions
Copy link

Test Results

   561 files  ±0     561 suites  ±0   4h 48m 33s ⏱️ + 58m 55s
   361 tests ±0     355 ✔️ ±0    6 💤 ±0  0 ±0 
1 083 runs  ±0  1 064 ✔️ ±0  19 💤 ±0  0 ±0 

Results for commit 6bdc453. ± Comparison against base commit b42ace3.

@cedric780
Copy link
Contributor Author

can you please make sure that you sign the ECA?

Done, I updated the ECA .

@laeubi laeubi merged commit af2b6be into eclipse-tycho:master Aug 24, 2023
11 checks passed
@github-actions
Copy link

💚 All backports created successfully

Status Branch Result
tycho-4.0.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants