Skip to content

Conversation

@juergen-albert
Copy link

When running in OSGi, but outside of Eclipse, the missing import statement cause ClassNotFound Exceptions, when an XMI is parsed

When running in OSGi, but outside of Eclipse, the missing import
statement cause ClassNotFound Exceptions, when an XMI is parsed

Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz>
juergen-albert added a commit to eclipse-fennec/model.atlas that referenced this pull request Nov 14, 2025
Until the the PR eclipse-uml2/uml2#126 isn't
approved, we require this project in here, that contains the fix.

Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz>
@ewillink
Copy link
Contributor

ewillink commented Dec 8, 2025

This doesn't look like a UML2 bug. Surely it will occur for any EMF-based project? Certainly I would expect OCL, QVTo etc to be similarly affected and require similar fixes. For Classic OCL, I suspect my workaround for Bug 535763 and associated files might help. Sadly Bugzilla is down so I cannot find the migrated version.

At the end of the console log for successful runs of https://ci.eclipse.org/ocl/job/ocl-uml-standalone there is a classpath involving UML2. It uses spoof OSGI functionality such as the empty org.eclipse.osgi.Spoof privately supplied by the test plugins. Isn't this a solution to the spurious EMF non-optional org.eclipse.osgi dependency? I found satisfying the dependency much too hard. Providing Spoof functionality comprising empty classes was much much easier.

Perhaps the fix should therefore be in EMF.

@juergen-albert
Copy link
Author

The bundle really uses the 2 named packages. In Eclipse, they are provided via System Packages. In a standard OSGi Environment, this is not the case. With the Import statement, the resolver will find the required bundle and everything is as it should be, without the need to spoof anything here.

@ewillink
Copy link
Contributor

ewillink commented Dec 8, 2025

My spoofing may be solving a different problem. But surely the extra imports are needed by any EMF-based project that can be used outside of Eclipse?
In due course, we should have a JUnit test that demonstrates the need for, and success of, the fix. This test should make it easy to see whether it is a UML2-specific problem or a general EMF problem. Something analogous to https://ci.eclipse.org/ocl/job/ocl-uml-standalone that re-runs the regular tests in a different launch could be appropriate. For now a java command line for one of the existing tests would help. "Show Command Line" for the "org.eclipse.ocl.uml.tests (Standalone)" launch shows rather more than I care to paste here. Cutting/pasting/editing a UML2 test launch command line should provide a repro.

@juergen-albert
Copy link
Author

But surely the extra imports are needed by any EMF-based project that can be used outside of Eclipse?

Yes. You just need to run it in Felix as OSGi Framework. We had a similar issue in EMF recently as well: eclipse-emf/org.eclipse.emf#91

I'm with you, regarding the Tess. We can look into some extra tests in the future.

@ewillink
Copy link
Contributor

ewillink commented Dec 9, 2025

I don't know how to run in Felix. On the contrary given the pain Felix caused a few years ago I thought Eclipse used Felix.

Anyway, that's why a repro is needed.

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.

2 participants