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

Cannot load resource interface in OSGi context #367

Open
reckart opened this issue Feb 9, 2024 · 0 comments
Open

Cannot load resource interface in OSGi context #367

reckart opened this issue Feb 9, 2024 · 0 comments
Labels
🦟 Bug Something isn't working
Milestone

Comments

@reckart
Copy link
Member

reckart commented Feb 9, 2024

Describe the bug
When injecting a resource into a UIMA component and the resource manager's classloader has access to the implementation class of the resources but not to the interface required by the UIMA component, then an exception is thrown. This was observed in an OSGi context.

To Reproduce
Steps to reproduce the behavior:

  1. Create an interface my.app.ResourceInterface
  2. Create an implementation of that interface, e.g. my.app.Resource
  3. Set up a resource manager that has a classloader that can instantiate my.app.Resource but cannot get the class for my.app.ResourceInterface
  4. Create instantiating a UIMA component that uses a my.app.Resource but via the my.app.ResourceInterace

Expected behavior
No exception. I guess UIMA should use the classloaded used for my.app.Resource to locate the interface or should alternatively avoid using the interface at all.

Screenshots

Caused by: org.apache.uima.resource.ResourceInitializationException: The class my.app.ResourceInterface could not be found. (Descriptor: <unknown>)
        at org.apache.uima.resource.impl.ResourceManager_impl.resolveAndValidateResourceDependencies(ResourceManager_impl.java:750)
        at org.apache.uima.resource.Resource_ImplBase.initialize(Resource_ImplBase.java:239)
        at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.initialize(AnalysisEngineImplBase.java:175)
        at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:128)
        at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:97)
        at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:64)
        at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:284)
        at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:334)
        at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:449)
        at org.apache.uima.fit.factory.AnalysisEngineFactory.createEngine(AnalysisEngineFactory.java:213)
        at org.apache.uima.fit.factory.AnalysisEngineFactory.createEngine(AnalysisEngineFactory.java:289)

Please complete the following information:

  • Version: 3.5.0

Additional context
Add any other context about the problem here.

@reckart reckart added the 🦟 Bug Something isn't working label Feb 9, 2024
@reckart reckart added this to the 3.5.1 milestone Feb 9, 2024
@reckart reckart changed the title Cannot load resource interface in OSGi context. Cannot load resource interface in OSGi context Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦟 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant