phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
116 stars 36 forks source link

Use ph-shematron in an OSGI container #53

Closed teo89 closed 7 years ago

teo89 commented 7 years ago

When I tried to install and start in a karaf

mvn:com.helger/ph-schematron/4.3.4

The following error occurred.

Error executing command: Error executing command on bundles: Error starting bundle 52: Unable to resolve com.helger.ph-schematron [52](R 52.0): missing requirement [com.helger.ph-schematron [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=com.helger.commons)(version>=8.6.0)(!(version>=9.0.0))) Unresolved requirements: [[com.helger.ph-schematron [52](R 52.0)] osgi.wiring.package; (&(osgi.wiring.package=com.helger.commons)(version>=8.6.0)(!(version>=9.0.0)))]

But version for ph-commons is 8.6.6. In next step, I tried to install and start

mvn:com.helger/ph-commons/8.6.6

The received error was Error executing command: Error executing command on bundles: Error starting bundle 54: Unable to resolve com.helger.ph-commons [54](R 54.0): missing requirement [com.helger.ph-commons [54](R 54.0)] osgi.extender; (osgi.extender=osgi.serviceloader.registrar) Unresolved requirements: [[com.helger.ph-commons [54](R 54.0)] osgi.extender; (osgi.extender=osgi.serviceloader.registrar)]

By searching, I tried to use the SPI Fly(http://aries.apache.org/modules/spi-fly.html) but with no chance. The ph-commons didn't start correctly.

Any extra help or information would be very helpful.

phax commented 7 years ago

I'm not at all an OSGI expert. This construct is based on a workaround to allow SPI implementations to work in OSGI. It is based on http://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html and referencing http://aries.apache.org/modules/spi-fly.html

hth

phax commented 7 years ago

Did that resolve your issues?