Hello Steven. I finally made it work ! In fact, I've uninstalled first my bundle, groovy-json and spifly. Then I've reinstalled in this order spifly, groovy-json and my bundle. This didn't change my bundle's resolution... But this morning, after restarting my Karaf, like a "magical mystery tour", it was working : the Fast String service is handled by spifly, groovy-json is resolved, and its classes are available inside my bundle.
I'm almost sure this is related to the start level of spifly : the Karaf feature starts it with the default start level 80. I didn't have not enough time to test changing it with a lower value... Later if I can. Perhaps Karaf should change the feature to ensure its bundle is started before concerned services. I hope my problem also helps others... Thanks for your help. Regards. Le jeu. 23 janv. 2025 à 13:45, Steven Huypens <[email protected]> a écrit : > Hi, > > The FastString Service is indeed listed as exposed by groovy-json: > > [org.apache.groovy.json.FastStringServiceFactory] > .org.apache.aries.spifly.provider.discovery.modeSERVICELOADER_CAPABILITIES > > .org.apache.aries.spifly.provider.implclassorg.apache.groovy.json.DefaultFastStringServiceFactory > service.bundleid635 > service.scopebundle > serviceloader.mediator > > And this is the groovy-json info: > > Exported Packages > groovy.json,version=4.0.13 > org.apache.groovy.json,version=4.0.13 > org.apache.groovy.json.internal,version=4.0.13 > > Imported Packages > groovy.io,version=4.0.13 from groovy (634) > groovy.lang,version=4.0.13 from groovy (634) > groovy.transform,version=4.0.13 from groovy (634) > groovy.transform.stc,version=4.0.13 from groovy (634) > groovy.util,version=4.0.13 from groovy (634) > org.apache.groovy.internal.util,version=4.0.13 from groovy (634) > org.apache.groovy.io,version=4.0.13 from groovy (634) > org.codehaus.groovy.reflection,version=4.0.13 from groovy (634) > org.codehaus.groovy.runtime,version=4.0.13 from groovy (634) > org.codehaus.groovy.runtime.memoize,version=4.0.13 from groovy (634) > > Importing Bundles > io.rest-assured (642) > io.rest-assured.json-path (644) > > Service > ID 675Types: org.apache.groovy.json.FastStringServiceFactory > > > Kind regards, > Steven > > On Tue, Jan 21, 2025 at 7:36 PM Ephemeris Lappis > <[email protected]> wrote: > > > > Hello Steven. > > > > In fact, our software stack has been defined quite a long time ago, and > we're just testing (trying to test in reality) some failing cases. This is > why we're still using Camel 3.22.1 and Groovy 3.0.19. > > > > Groovy JSON was not a requirement for our applications and is not > included in our Karaf features. > > > > I'm just trying to deploy some temporary "single use" bundles with some > groovy code to analyze and detect possible ActiveMQ messages delivery > issues. > > > > I'm not sure to understand the actual role of "spifly" that you also > include in your feature. On my side, I've tried installing the built-in > Karaf feature that provides the version 1.3.6. But it has no effect on the > groovy-json bundle that seems to require more : its single bundle is > started but it doesn't intercept the groovy json bundle requirements to > create the service. > > > > I've read the bundle's manifest, but I'm sincerely unable to explain > what's mssing to provide its requirements. The bundle indeed needs some > ServiceLoader to create and expose for its own usage the "Fast String" > service factory that is defined as a common Java SPI (that is not properly > handled in an OSGi context). > > > > We've no other bundles in such a case... > > > > On your side, could you verify that the Fast String service appears in > the OSGi services as expected with some properties provided by spifly ? > > > > Thanks again. > > > > Le mar. 21 janv. 2025 à 18:16, Steven Huypens <[email protected]> > a écrit : > >> > >> Hi, > >> > >> Any reason why you are using Groovy 3.x instead of 4.x ? > >> > >> I needed Groovy to be able to use Rest Assured in my Pax Exam Tests > >> and this is my feature, which is working for me > >> > >> <feature name="myFeature" version="x.y.z"> > >> <feature prerequisite="true">wrap</feature> > >> <bundle>mvn:a.b.io.rest-assured/common-fragment/1.0.2</bundle> > >> (just a simple fragment bundle to fix a Rest Assured issue) > >> <bundle>mvn:io.rest-assured/json-path/5.5.0</bundle> > >> <bundle>mvn:io.rest-assured/xml-path/5.5.0</bundle> > >> <bundle>mvn:io.rest-assured/rest-assured/5.5.0</bundle> > >> <bundle>mvn:io.rest-assured/rest-assured-common/5.5.0</bundle> > >> > > <bundle>mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.4</bundle> > >> <bundle>mvn:org.apache.groovy/groovy-json/4.0.13</bundle> > >> <bundle>mvn:org.apache.groovy/groovy-xml/4.0.13</bundle> > >> <bundle>mvn:org.apache.groovy/groovy/4.0.13</bundle> > >> <bundle>wrap:mvn:org.ccil.cowan.tagsoup/tagsoup/1.2.1</bundle> > >> </feature> > >> > >> > >> Kind regards, > >> Steven > >> > >> On Tue, Jan 21, 2025 at 5:49 PM Ephemeris Lappis > >> <[email protected]> wrote: > >> > > >> > Hello again ! > >> > > >> > I've been looking for solutions, but I didn't find anything that > works... > >> > > >> > I've tried installing the feature "spifly" that, if I'm not mistaken, > should support the ServiceLoader that's needed for groovy-json Fast String > service. > >> > But the groovy json bundle still refuses to resolve :( > >> > > >> > No more ideas at this time. Waiting for any help. > >> > > >> > Thanks again. > >> > > >> > Le mar. 21 janv. 2025 à 09:08, Ephemeris Lappis < > [email protected]> a écrit : > >> >> > >> >> Hello. > >> >> > >> >> I'm trying to install groovy-json for some Camel tests on a Karaf > that already has Groovy features installed and working. > >> >> > >> >> karaf@root()> la | grep groovy > >> >> 236 | Active | 50 | 3.22.1 | camel-groovy > >> >> 248 | Resolved | 80 | 3.0.19 | groovy-dateutil, Hosts: > 233 > >> >> 249 | Resolved | 80 | 3.0.19 | groovy-xml, Hosts: 233 > >> >> 275 | Installed | 80 | 3.0.19 | groovy-json > >> >> > >> >> As you can see the groovy-json is in "Installed" state. The diag > command gives missing requirements that I don't understand. > >> >> > >> >> diag 275 > >> >> groovy-json (275) > >> >> ----------------- > >> >> Status: Installed > >> >> Unsatisfied Requirements: > >> >> [groovy-json [275](R 275.1)] osgi.wiring.package; > (&(osgi.wiring.package=groovy.json)(version>=3.0.0)(!(version>=4.0.0))) > >> >> [groovy-json [275](R 275.1)] osgi.wiring.package; > (&(osgi.wiring.package=org.apache.groovy.json)(version>=3.0.0)(!(version>=4.0.0))) > >> >> [groovy-json [275](R 275.1)] osgi.wiring.package; > (&(osgi.wiring.package=org.apache.groovy.json.internal)(version>=3.0.0)(!(version>=4.0.0))) > >> >> [groovy-json [275](R 275.1)] osgi.extender; > (osgi.extender=osgi.serviceloader.registrar) > >> >> [groovy-json [275](R 275.1)] osgi.extender; > (osgi.extender=osgi.serviceloader.processor) > >> >> [groovy-json [275](R 275.1)] osgi.serviceloader; > (osgi.serviceloader=org.apache.groovy.json.FastStringServiceFactory) > >> >> > >> >> The missing packages are exported and imported by the bundle itself : > >> >> > >> >> Export-Package = > >> >> groovy.json; > >> >> uses:="groovy.io, > >> >> groovy.lang, > >> >> groovy.transform.stc, > >> >> groovy.util, > >> >> org.apache.groovy.json.internal"; > >> >> version=3.0.19, > >> >> org.apache.groovy.json;version=3.0.19, > >> >> > org.apache.groovy.json.internal;uses:=groovy.json;version=3.0.19 > >> >> Import-Package = > >> >> groovy.io;resolution:=optional, > >> >> groovy.json;resolution:=optional;version="[3.0,4)", > >> >> groovy.lang;resolution:=optional, > >> >> groovy.transform.stc;resolution:=optional, > >> >> groovy.util;resolution:=optional, > >> >> org.apache.groovy.internal.util;resolution:=optional, > >> >> org.apache.groovy.io;resolution:=optional, > >> >> > org.apache.groovy.json;resolution:=optional;version="[3.0,4)", > >> >> > org.apache.groovy.json.internal;resolution:=optional;version="[3.0,4)", > >> >> org.codehaus.groovy.runtime;resolution:=optional, > >> >> org.codehaus.groovy.runtime.memoize;resolution:=optional > >> >> > >> >> And I don't understand what are the other missing elements. > >> >> > >> >> Could someone help me, please ? > >> >> > >> >> Thanks in advance. > >> >> > >> >> Regards. > >> >> > >> >> >
