>>>>> Steinar Bang <s...@dod.no>: > What happens if I put the dependencies in <scope>compile</scope>? > Will this mess up the pax exam OSGi runtime startup?
> What I would like to do, is to add the dependencies in > <scope>compile</scope> and let karaf-maven-plugin generate a feature > file from the compile dependencies, and then use that feature file in > the pax exam karaf config. > Is this possible? > Or will, as asked above, using the compile scope on dependencies mess > up the pax exam OSGi startup somehow? I tried adding mockrunner-server as a compile target: <dependency> <groupId>com.mockrunner</groupId> <artifactId>mockrunner-servlet</artifactId> <version>1.1.2</version> <scope>compile</scope> </dependency> This created a feature file that looks ok: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="fildele.tests"> <feature name="mockrunner" description="filedele pax exam integration tests" version="1.0.0.SNAPSHOT"> <feature prerequisite="true" dependency="false">wrap</feature> <bundle start-level="80">wrap:mvn:com.mockrunner/mockrunner-servlet/1.1.2</bundle> </feature> </features> The feature installs fine in a regular karaf console: karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.tests/1.0.0-SNAPSHOT/xml/features Adding feature url mvn:no.priv.bang.fildele/fildele.tests/1.0.0-SNAPSHOT/xml/features karaf@root()> feature:install mockrunner karaf@root()> bundle:list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version | Name ---+--------+-----+---------+----------------------------------------------------------------------------------------------------------- 28 | Active | 80 | 4.1.2 | Apache Karaf :: OSGi Services :: Event 52 | Active | 80 | 0 | wrap_file__C__Users_sb_.m2_repository_com_mockrunner_mockrunner-servlet_1.1.2_mockrunner-servlet-1.1.2.jar karaf@root()> bundle:capabilities 52 wrap_file__C__Users_sb_.m2_repository_com_mockrunner_mockrunner-servlet_1.1.2_mockrunner-servlet-1.1.2.jar [52] provides: ------------------------------------------------------------------------------------------------------------------------- osgi.wiring.bundle; wrap_file__C__Users_sb_.m2_repository_com_mockrunner_mockrunner-servlet_1.1.2_mockrunner-servlet-1.1.2.jar 0.0.0 [UNUSED] osgi.wiring.host; wrap_file__C__Users_sb_.m2_repository_com_mockrunner_mockrunner-servlet_1.1.2_mockrunner-servlet-1.1.2.jar 0.0.0 [UNUSED] osgi.identity; wrap_file__C__Users_sb_.m2_repository_com_mockrunner_mockrunner-servlet_1.1.2_mockrunner-servlet-1.1.2.jar 0.0.0 [UNUSED] osgi.wiring.package; com.mockrunner.base 0.0.0 [UNUSED] osgi.wiring.package; com.mockrunner.example.servlet 0.0.0 [UNUSED] osgi.wiring.package; com.mockrunner.mock.web 0.0.0 [UNUSED] osgi.wiring.package; com.mockrunner.servlet 0.0.0 [UNUSED] karaf@root()> But karaf in pax exam (that now has a <scope>compile</scope> dependency to mockrunner), fails during startup. If I remove the compile dependency pax exam karaf starts fine. Is there a workaround to this issue? Here's the error message from the karaf.log: 2017-10-14T22:08:32,391 | INFO | FelixStartLevel | fileinstall | 6 - org.apache.felix.fileinstall - 3.6.0 | Creating configuration from jmx.acl.cfg 2017-10-14T22:08:34,172 | ERROR | FelixStartLevel | BootFeaturesInstaller | 7 - org.apache.karaf.features.core - 4.1.2 | Error installing boot feature repository mvn:org.apache.karaf.features/spring/4.1.2/xml/features java.io.IOException: This DocumentBuilder, "org.apache.xerces.jaxp.DocumentBuilderImpl", does not support the reset functionality. Specification "null" version "null" : mvn:org.apache.karaf.features/spring/4.1.2/xml/features at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:91) ~[7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.service.FeaturesServiceImpl.loadRepository(FeaturesServiceImpl.java:460) ~[7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:476) ~[7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:471) ~[7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:98) [7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:87) [7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:269) [7:org.apache.karaf.features.core:4.1.2] at org.apache.karaf.util.tracker.BaseActivator.start(BaseActivator.java:78) [7:org.apache.karaf.features.core:4.1.2] at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) [?:?] at org.apache.felix.framework.Felix.activateBundle(Felix.java:2239) [?:?] at org.apache.felix.framework.Felix.startBundle(Felix.java:2145) [?:?] at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1372) [?:?] at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?] Caused by: java.lang.UnsupportedOperationException: This DocumentBuilder, "org.apache.xerces.jaxp.DocumentBuilderImpl", does not support the reset functionality. Specification "null" version "null" at javax.xml.parsers.DocumentBuilder.reset(DocumentBuilder.java:92) ~[?:?] at org.apache.karaf.util.XmlUtils.parse(XmlUtils.java:62) ~[?:?] at org.apache.karaf.features.internal.model.JaxbUtil.unmarshalValidate(JaxbUtil.java:113) ~[?:?] at org.apache.karaf.features.internal.model.JaxbUtil.unmarshal(JaxbUtil.java:101) ~[?:?] at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:88) ~[?:?] ... 13 more -- -- ------------------ OPS4J - http://www.ops4j.org - ops4j@googlegroups.com --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.