# Bnd Bundle Path of all workspace projects seemingly empty after deleting LocalIndexedRepo

**URL:** <https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451>\
**Category:** GENERAL\
**Created:** [May 29, 2024, 12:59pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451 "2024-05-29T12:59:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 29, 2024, 12:59pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/1 "2024-05-29T12:59:30Z")

</div>

I had a LocalIndexedRepo to resolve our platform dependencies.  
The last weeks I wrote a Bulk Deploy tool to deploy all these bundles to our nexus, because they were structurally inconsistent.  
Now I wanted to replace said LocalIndexedRepo with my MavenBndRepository.  
I unfortunately deleted the folders containing the bundles before deleting the plugin from the build.bnd.  
Now every project, for every external type throws an error that it can’t resolve the respective type to a variable.  
While said types are in the buildpath and resolvable through the maven repo.  
I’ve deleted the cache multiple times, so that didn’t help.  
Any pointers?

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 29, 2024, 3:15pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/3 "2024-05-29T15:15:56Z")

</div>

OK, I just found out my precise question: Is it possible to replace one repository of type A with a Repository of type B, given that they contain the same depencies?

Precisely: Can I replace a LocalIndexedRepo with a MavenBndRepo containing the same artifacts?

---

<div class="post-metadata">

**Author:** ![rotty3000](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rotty3000/32/16_2.png) [@rotty3000](https://bnd.discourse.group/u/rotty3000)\
**Post date:** [May 29, 2024, 3:36pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/4 "2024-05-29T15:36:21Z")

</div>

The contract for repositories is exactly the same. So yes, you should be able to completely substitute one type for another assuming it provides the minimum set of capabilities needed.

In the end a repository is mostly the index file, which is standardized (which then points at artifact/resource URIs.)

---

<div class="post-metadata">

**Author:** ![juergen-albert](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/juergen-albert/32/20_2.png) [@juergen-albert](https://bnd.discourse.group/u/juergen-albert)\
**Post date:** [May 29, 2024, 3:58pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/5 "2024-05-29T15:58:26Z")

</div>

From what you describe I would venture a guess:

Do you have `-runrepos:` defined in your bndrun? This is a whitelist, that if set at any point in time, will not change automatically. I stumbled upon this from time to time.

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 30, 2024, 7:28am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/6 "2024-05-30T07:28:54Z")

</div>

> [@juergen-albert](#):
>
> Do you have `-runrepos:` defined in your bndrun? This is a whitelist, that if set at any point in time, will not change automatically. I stumbled upon this from time to time.

Yes they are defined in the workspace projects’ .bnd files, but I had previously thought this only affects runtime-, not `-buildpath`-resolution and the errors I got were at buildtime. Further suggesting `-runrepos` don’t affect buildtime is that I had renamed multiple repositories, also the commented-out LocalIndexedRepo and the renaming is not reflected in the workspace projects’ .bnd files, yet the `-buildpath`s still seem to get resolved correctly when the LocalIndexedRepo that originally supplied the dependencies is there.  
Yesterday, after commenting out the LocalIndexedRepo plugin in `build.bnd`, the errors in eclipse’s Problems view indicated, that the dependencies were still expected to be at the physical location of the LocalIndexedRepo.  
I’ll quickly set the `-runrepos` to the repos I’d like to resolve the `-buildpath` from and report back if the `-buildpath` gets resolved with the old LocalIndexedRepo commented out.

---

<div class="post-metadata">

**Author:** ![juergen-albert](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/juergen-albert/32/20_2.png) [@juergen-albert](https://bnd.discourse.group/u/juergen-albert)\
**Post date:** [May 30, 2024, 7:46am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/7 "2024-05-30T07:46:10Z")

</div>

> **[\-runrepos REPO-NAME ( ‘,’ REPO-NAME )\*](https://bnd.bndtools.org/instructions/runrepos.html)**
>
> The -runrepos instruction is used to restrict or order the available repositories. A bndrun file can be based on a workspace or can be standalone. In the workspace case the, the repositories are defined in build.bnd or in a \*.bnd file in the cnf/ext...

My understanding is, that runrepos only have an effect on runbundles and runrequires .

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [May 30, 2024, 11:40am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/8 "2024-05-30T11:40:49Z")

</div>

Have you tried hitting the various refresh buttons like this one:  
 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/8a3f62c3c330e9bd819a4f7dbb038028a39ba771.png)

I often need this button when I change something related to repos (e.g. adding / removing a repo plugin in build.bnd).

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 30, 2024, 11:59am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/9 "2024-05-30T11:59:45Z")

</div>

Frantically all the time.

Where in bnd’s sources do I need to step into in order to see if there is something wrong with the Maven repo?  
It is a really weird overall situation.  
My maven repo contains all the bundles that the LocalIndexedRepo previously contained.  
The repositories view lists them all, doubleclicking each (at least the few I tried) correctly opens the jar editor and its output is good.  
I get no further errors anywhere, the only thing that happens is that for every non-locally provided external type anywhere, I simply only get many errors like `[ClassName] cannot be resolved to a type` or `[ClassName] cannot be resolved to a variable`.  
Each projects’ buildpath is set and correct.  
When inspecting the build path (Right-click project → Properties → Java Build Path → Libraries → Classpath → Bnd Bundle Path → Edit), for every dependency I see `$USER_HOME\.m2\repository\..\filename.jar (exists)`.  
Still somehow they seem to not get resolved for the build.

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [May 30, 2024, 4:26pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/10 "2024-05-30T16:26:59Z")

</div>

> [@jkoerkel](#):
>
> Where in bnd’s sources do I need to step into in order to see if there is something wrong with the Maven repo?

`MavenBndRepository.java` e.g. `aQute.bnd.repository.maven.provider.MavenBndRepository.getArchive(Object...)` could be a starting point to set a breakpoint.

Could you maybe check how your `.project` file in a bundle looks like? e.g. mine looks like this and have the `javabuilder` and `bndtoolsbuilder`

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/f90fcdc276c5f2110cef581accce0cdb95987b1f.jpeg)

Also what do you see when you right-click on a bundle and go to “Configure”? Do you see a “Add Bndtools nature” or a “Remove Bndtools nature”?

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/c3d0dc06f153aff829af97815e747ec9ca3edb4d.png)

> [@jkoerkel](#):
>
> Each projects’ buildpath is set and correct.

Can you maybe show a `.bnd` file of a project where you see the errors?  
e.g. do you have any exclamation marks shown in the `-buildpath` section?

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/e28b19e84ea7b682c1b246c76026ace8c22b8783.jpeg)

> [@jkoerkel](#):
>
> I’ve deleted the cache multiple times, so that didn’t help.

Which one?  
I know of the following caches:

- `cnf` folder in your bnd workspace  
 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/fec88709d68b6e56de0daade95e5ec393ee0eeba.png)

Not sure if Eclipse Workspace `.metadata` also caches some stuff.

This is all which comes to mind. Sorry for not being more helful. I’m just digging in the dark. But just remember I had some weird caching issues.

Aahh one more thing:  
Which Eclipse do you use?

I had a issue with Eclipse **2024-03** and did not get it working.  
Thus I am still one **2023-12** for that reason. A colleague had it too. Basically our bndtools workspace did not work anymore… Here is the github where I reported something:

> <https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1842#issuecomment-2003362958>
>
> Today I got a quite strange error in the IDE
> 
> \> The type java.lang.invoke.Stri…ngConcatFactory cannot be resolved. It is indirectly referenced from required .class files
> 
> but I never use that anywhere in my code.
> 
> The only "special" think seems be that my code is using java 1.8 JVM, I already cleaned the project but the project still persist.

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 31, 2024, 2:15pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/11 "2024-05-31T14:15:27Z")

</div>

Hi Chris, thanks so much for your reply! I really appreciate all you guys here very much taking so much time out your days to help me with my shenanigans all the time!

I have fixed my problem differently and maybe it helps if I sketch out how I did that so it could help others with similar problems later.  
I had Errors in the Errors list in eclipses Problems view that indicated missing _build time_ dependencies.  
So the _build_ didn’t work. Implying stepping through the _builder_ first.  
Now I closed all workspace projects but one, cause if I just put a breakpoint in `org.bndtools.builder#build`, since it gets called asynchronously in many threads for all workspace projects, the actual debugging would have been annoying with all of them open.  
So close all but one problematic project.  
In there, the project under build gets initialized as `ourModel`. Somewhere in its fields or a field of a field (can’t remember), was an `errors` or `exceptions` collection and that contained the actual exception for one bundle in my MavenBndRepository.  
The problem was (and I should have totally realized earlier it _must_ be something like this) that in my Bulk Deployer, I have to edit the poms of some bundles before uploading them, because they are versioned as SNAPSHOTs. Nearly all our platform dependencies are signed, though, and I am officially not exactly smart 🫠, so some Exception about violated referential integrity was thrown, but that never ended up in the UI.  
My fix was to remove the signature related files from these bundles in my Bulk Deployer and with that, everything works.

I mean, in hindsight it is absolutely clear my BulkDeployer must have been the issue, because since starting my project to convert our PDE workspace to BndTools, I constantly messed around with supplying dependencies from changing repos and it always worked smoothly, but I was honestly way too stressed out with over 100k errors in my eclipse to realize my mistake earlier because everything _looked_ so correct superficially, so without debugging my workspace out of bndtools’ sources I wouldn’t have found it. Still, next time I know to start single-stepping bndtools earlier.

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [May 31, 2024, 2:36pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/12 "2024-05-31T14:36:46Z")

</div>

Great to hear 🙂

> [@jkoerkel](#):
>
> some Exception about violated referential integrity was thrown, but that never ended up in the UI.

Do you by any chance remember the place in bnd codebase where you have seen this exception? I ask because, maybe we can see we could do something so it really gets to the UI.

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [May 31, 2024, 2:43pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/13 "2024-05-31T14:43:33Z")

</div>

I’ll check that on monday, weekends are strictly non-coding for me 🙂

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [June 3, 2024, 8:04am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/14 "2024-06-03T08:04:53Z")

</div>

This is seemingly happening only for one of our dependencies. It is in `org.bndtools.builder.BndtoolsBuilder#build:109`. After initializing `ourModel`, the errors collection (inherited from `aQute.bnd.osgi.Processor`) contains:

[0]:

```auto
Exception: java.lang.SecurityException: SHA-384 digest error for META-INF/maven/REDACTED/REDACTED/pom.xml
	at java.base/sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:256)
	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:252)
	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
	at java.base/java.util.jar.JarInputStream.read(JarInputStream.java:199)
	at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:142)
	at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:120)
	at java.base/java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:129)
	at java.base/java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:166)
	at org.bndtools.utils.jar.PseudoJar.nextEntry(PseudoJar.java:93)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.getJarInfo(BndContainerInitializer.java:514)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainerAccessRules(BndContainerInitializer.java:596)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainersClasspath(BndContainerInitializer.java:372)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateProjectClasspath(BndContainerInitializer.java:311)
	at aQute.bnd.build.WorkspaceLock.locked(WorkspaceLock.java:168)
	at aQute.bnd.build.Workspace.readLocked(Workspace.java:1500)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.updateClasspathContainer(BndContainerInitializer.java:248)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:120)
	at org.bndtools.builder.classpath.BndContainerInitializer.lambda$1(BndContainerInitializer.java:103)
	at org.osgi.util.promise.DeferredPromiseImpl$ThenAccept.accept(DeferredPromiseImpl.java:433)
	at org.osgi.util.promise.DeferredPromiseImpl.result(DeferredPromiseImpl.java:151)
	at org.osgi.util.promise.DeferredPromiseImpl$ThenAccept.run(DeferredPromiseImpl.java:426)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

```

[1]:

```auto
Unexpected error during classpath calculation: SHA-384 digest error for META-INF/maven/REDACTED/REDACTED/pom.xml

```

[2]:

```auto
Exception: java.lang.SecurityException: SHA-384 digest error for META-INF/maven/REDACTED/REDACTED/pom.xml
	at java.base/sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:256)
	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:252)
	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
	at java.base/java.util.jar.JarInputStream.read(JarInputStream.java:199)
	at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:142)
	at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:120)
	at java.base/java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:129)
	at java.base/java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:166)
	at org.bndtools.utils.jar.PseudoJar.nextEntry(PseudoJar.java:93)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.getJarInfo(BndContainerInitializer.java:514)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainerAccessRules(BndContainerInitializer.java:596)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainersClasspath(BndContainerInitializer.java:372)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateProjectClasspath(BndContainerInitializer.java:311)
	at aQute.bnd.build.WorkspaceLock.locked(WorkspaceLock.java:168)
	at aQute.bnd.build.Workspace.readLocked(Workspace.java:1500)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.updateClasspathContainer(BndContainerInitializer.java:248)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:120)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:168)
	at org.bndtools.builder.classpath.BndContainerInitializer.modelChanged(BndContainerInitializer.java:137)
	at bndtools.central.Central.refreshProjects(Central.java:608)
	at bndtools.central.Central.refreshPlugins(Central.java:578)
	at bndtools.views.repository.RepositoriesView$6.runInWorkspace(RepositoriesView.java:456)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

```

[3]:

```auto
Exception: java.lang.SecurityException: SHA-384 digest error for META-INF/maven/REDACTED/REDACTED/pom.xml
	at java.base/sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:256)
	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:252)
	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
	at java.base/java.util.jar.JarInputStream.read(JarInputStream.java:199)
	at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:142)
	at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:120)
	at java.base/java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:129)
	at java.base/java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:166)
	at org.bndtools.utils.jar.PseudoJar.nextEntry(PseudoJar.java:93)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.getJarInfo(BndContainerInitializer.java:514)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainerAccessRules(BndContainerInitializer.java:596)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainersClasspath(BndContainerInitializer.java:372)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateProjectClasspath(BndContainerInitializer.java:311)
	at aQute.bnd.build.WorkspaceLock.locked(WorkspaceLock.java:168)
	at aQute.bnd.build.Workspace.readLocked(Workspace.java:1500)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.updateClasspathContainer(BndContainerInitializer.java:248)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:120)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:168)
	at org.bndtools.builder.classpath.BndContainerCompilationParticipant.aboutToBuild(BndContainerCompilationParticipant.java:19)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.initializeBuilder(JavaBuilder.java:632)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean(JavaBuilder.java:312)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1029)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:254)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:400)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:403)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:362)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:624)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:571)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2380)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:609)
	at org.eclipse.core.internal.resources.Project.build(Project.java:121)
	at bndtools.editor.project.BuildOperationsPart$RebuildJob.runInWorkspace(BuildOperationsPart.java:106)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

```

[4]:

```auto
Exception: java.lang.SecurityException: SHA-384 digest error for META-INF/maven/REDACTED/REDACTED/pom.xml
	at java.base/sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:256)
	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:252)
	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
	at java.base/java.util.jar.JarInputStream.read(JarInputStream.java:199)
	at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:142)
	at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:120)
	at java.base/java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:129)
	at java.base/java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:166)
	at org.bndtools.utils.jar.PseudoJar.nextEntry(PseudoJar.java:93)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.getJarInfo(BndContainerInitializer.java:514)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainerAccessRules(BndContainerInitializer.java:596)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateContainersClasspath(BndContainerInitializer.java:372)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.calculateProjectClasspath(BndContainerInitializer.java:311)
	at aQute.bnd.build.WorkspaceLock.locked(WorkspaceLock.java:168)
	at aQute.bnd.build.Workspace.readLocked(Workspace.java:1500)
	at org.bndtools.builder.classpath.BndContainerInitializer$Updater.updateClasspathContainer(BndContainerInitializer.java:248)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:120)
	at org.bndtools.builder.classpath.BndContainerInitializer.requestClasspathContainerUpdate(BndContainerInitializer.java:168)
	at org.bndtools.builder.classpath.BndContainerCompilationParticipant.aboutToBuild(BndContainerCompilationParticipant.java:19)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.initializeBuilder(JavaBuilder.java:632)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:182)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1024)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:254)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:400)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:403)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:514)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:462)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:544)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

```

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [June 3, 2024, 11:03am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/15 "2024-06-03T11:03:43Z")

</div>

Thanks.  
From looking at the source of `org.bndtools.builder.BndtoolsBuilder#build:109` it looks like calls to

`markers.setMarkers(processor, BndtoolsConstants.MARKER_BND_PROBLEM);`

are responsible for bringing the errors in the UI (Eclipse Problems view). A few thoughts:

- Do you see this specific error in the Eclipse Problems view somewhere? If yes, then the error is actually already in the UI but maybe you didn’t see it among the hundreds of other errors… is this possible?

- if not: could you debug once more and see if any of the `markers.setMarkers(processor, BndtoolsConstants.MARKER_BND_PROBLEM);` are called? If not we should think about adding one a bit earlier, e.g. after line _109_ where you discovered the error in the

> [@jkoerkel](#):
>
> errors collection (inherited from `aQute.bnd.osgi.Processor`)

… because `setMarkers()` seems to do this:

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/353cef2e12639cf9f4c5dd844d8b949f65707159.png)

the model.getErrors() should actually contain the

> [@jkoerkel](#):
>
> the errors collection (inherited from `aQute.bnd.osgi.Processor`)

Another question is maybe also: How would you have expected to see the error?

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [June 13, 2024, 4:10pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/16 "2024-06-13T16:10:02Z")

</div>

Hello and sorry for the late reply, I had to do product dev work and couldn’t do any bndtools stuff in the last two weeks.

> [@chrisrueger](#):
>
> Do you see this specific error in the Eclipse Problems view somewhere? If yes, then the error is actually already in the UI but maybe you didn’t see it among the hundreds of other errors… is this possible?

No. It is not in the Problems View. I’m not sure whether I might have gotten an Error Dialog weeks ago that I might have clicked away too fast. But I can’t remember if it was connected to this problem chain.

> [@chrisrueger](#):
>
> if not: could you debug once more and see if any of the `markers.setMarkers(processor, BndtoolsConstants.MARKER_BND_PROBLEM);` are called? If not we should think about adding one a bit earlier, e.g. after line _109_

Yes, at #214. But for my project, it first goes into the next try block and in the `callable` lambda of `Central#bndCall` on #191 calls `Processor#clear` with `model.clear()`, which clears the errors list.

Adding following code starting from #162 adds the error description to the Problems view, but I think ideally it would need some decision making whether something is bad enough to throw an Exception in a dialog.

```auto
else if (ourModel != null && !ourModel.getErrors()
	.isEmpty()) {
	List<String> showableErrors = ourModel.getErrors()
		.stream()
		.filter(errorString -> !errorString.startsWith("Exception"))
		.toList();
	if (!showableErrors.isEmpty()) {
		for (String showableError : showableErrors) {
			markers.createMarker(null, IMarker.SEVERITY_ERROR, showableError,
				BndtoolsConstants.MARKER_BND_PATH_PROBLEM);
		}
	}
}

```

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [June 13, 2024, 5:54pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/17 "2024-06-13T17:54:50Z")

</div>

> [@jkoerkel](#):
>
> I had to do product dev work and couldn’t do any bndtools stuff in the last two weeks.

No problem, much appreciated that you took the time 🙂

> [@jkoerkel](#):
>
> Adding following code starting from #162 adds the error description to the Problems view.
> 
> ```auto
> else if (ourModel != null && !ourModel.getErrors()
> .isEmpty()) {
> List<String> showableErrors = ourModel.getErrors()
> .stream()
> .filter(errorString -> !errorString.startsWith("Exception"))
> .toList();
> if (!showableErrors.isEmpty()) {
> for (String showableError : showableErrors) {
> markers.createMarker(null, IMarker.SEVERITY_ERROR, showableError,
> BndtoolsConstants.MARKER_BND_PATH_PROBLEM);
> }
> }
> }
> 
> ```

This is great. Do you mind creating a PR? I think this is useful.

> [@jkoerkel](#):
>
> but I think ideally it would need some decision making whether something is bad enough to throw an Exception in a dialog.

Probably, but maybe this is even an improvement over the current situation where you don’t see this anywhere… and maybe not as “aggressive” as an Exception. at least I don’t feel in the position to decide that. But I think a problem view marker might be fine.

@pkriens What do you think?

---

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [June 14, 2024, 8:21am UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/18 "2024-06-14T08:21:46Z")

</div>

We probably need a specific marker type for this, these markers should be applied at the Bnd Classpath container. The `BndContainerInitializer` can then maintain it.

The life cycle of these errors are very different from normal build errors. bnd has a design flaw that it conflates the data and the run. Processor should have been separated in a static part and a part you can use for execution (errors/warnings/progress).

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [June 14, 2024, 5:05pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/19 "2024-06-14T17:05:55Z")

</div>

> [@pkriens](#):
>
> We probably need a specific marker type for this, these markers should be applied at the Bnd Classpath container. The `BndContainerInitializer` can then maintain it.
> 
> The life cycle of these errors are very different from normal build errors. bnd has a design flaw that it conflates the data and the run. Processor should have been separated in a static part and a part you can use for execution (errors/warnings/progress).

Hmm. `org.eclipse.core.resources.IncrementalProjectBuilder#build`’s javadoc states

> [@](#):
>
> All builders should try to be robust in the face of trouble. In situations where failing the build by throwing `CoreException` is the only option, a builder has a choice of how best to communicate the problem back to the caller. One option is to use the {@link IResourceStatus#BUILD\_FAILED} status code along with a suitable message; another is to use a {@link MultiStatus} containing finer-grained problem diagnoses.

and the Exception causing the problem is unchecked (and at that, a `SecurityException`), which I thought is unrecoverable, so I originally wanted to suggest throwing a `CoreException` from `BndContainerInitializer.Updater#calculateProjectClasspath` as is declared on the method signature, but never actually thrown, assuming it’s probably an oversight and might have thrown at some earlier point, I went ahead with

```auto
// BndContainerInitializer#Updater#calculateProjectClasspath@322
catch (SecurityException e) {
	throw new CoreException(Status.error(e.getMessage(), e));
}

```

realizing that doesn’t surface the error either, it just logs to bndtools’ console and probably ends up in the eclipse error log for my workspace, but not in the UI.

So I guess I have to do something like

```auto
// BndContainerInitializer#Updater#calculateProjectClasspath@322
catch (SecurityException e) {
	new MarkerSupport(project).createMarker(model, IMarker.SEVERITY_ERROR, e.getMessage(), BndtoolsConstants.NEW_FANCY_MARKER);
}

```

right?

---

<div class="post-metadata">

**Author:** ![jkoerkel](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/jkoerkel/32/222_2.png) [@jkoerkel](https://bnd.discourse.group/u/jkoerkel)\
**Post date:** [June 17, 2024, 3:14pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/20 "2024-06-17T15:14:32Z")

</div>

I have an implementation without a new Marker type that doesn’t introduce a lot of change, just a new private method and two else if statements.

```auto
// BndtoolsBuilder.java
private void createMarkersForModelErrors(MarkerSupport markers, Project model) throws CoreException, Exception {
	List<String> interestingErrors = model.getErrors()
		.stream()
		.filter(errorMessage -> errorMessage != null && !errorMessage.isBlank()
			&& !errorMessage.startsWith("Exception"))
		.toList();
	if (!interestingErrors.isEmpty()) {
		markers.deleteMarkers("*");
		for (String errormessage : interestingErrors) {
			markers.createMarker(model, IMarker.SEVERITY_ERROR, errormessage,
				BndtoolsConstants.MARKER_BND_PATH_PROBLEM);
		}
	}
}

```

```auto
// build method
else if (ourModel != null && ourModel.getErrors() != null && !ourModel.getErrors()
	.isEmpty()) {
	createMarkersForModelErrors(markers, ourModel);
	return null;
}

```

```auto
// clean method, but I'm not sure whether it's ok to do this, because clean
else if (model != null && model.getErrors() != null && !model.getErrors()
	.isEmpty()) {
	createMarkersForModelErrors(markers, model);
}

```

I think this is a good enough solution. Also with the marker creation in `BndContainerInitializer`, I would have needed to refactor MarkerSupport to be public and have some public methods.

Luckily for me, the existing bndtools implementation already displays these markers in the heading of the Bnd Project Editor’s Build tab, which I think is ideal for visibility without displaying an error dialog.

My remaining problem now is testing this, as I’d need to programatically

1. create a bundle (launchpad, maybe?)
2. sign it (no idea)
3. manipulate a contained file (easy)
4. put it in a repository (no clue)
5. create a project (launchpad again?)
6. add first bundle to its buildpath (launchpad?)
7. build it (launchpad?)

and then verify the marker exists and I’ll already struggle at creating the first bundle with launchpad if that’s even realistically working in `bndtools.builder`… So any pointers are very welcome.

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [June 18, 2024, 5:27pm UTC](https://bnd.discourse.group/t/bnd-bundle-path-of-all-workspace-projects-seemingly-empty-after-deleting-localindexedrepo/451/21 "2024-06-18T17:27:22Z")

</div>

Thanks a lot.  
Maybe if you somehow find the time, there is the [call on friday](https://bnd.discourse.group/t/you-wanna-be-a-bnd-developer/443) where we could discuss those things in the group with screensharing and what not.

Regarding testing I could only do some wild guesses regarding pointers:

- `aQute.bnd.deployer.repository.TestLocalIndexGeneration` shows how to use dummy repos (e.g. see line #119 `Jar dummyJar = new Jar(IO.getFile("testdata/bundles/dummybundle.jar"));`  
Just an idea how you could maybe fake it and create exactly the “broken” bundles you need
- then maybe `test.ProcessorTest` e.g. `test.ProcessorTest.testBeginEndHandleErrors()`
- and maybe `test.BuilderTest`
- and `test.JarSignerTest`

So maybe those testcases contain a bit of everything you need 🙂
