Hi,
in some cases serviceMix is not able to start correctly due to a wrong maven
resolution.
If i have understand how it works it does the following :
The Bundle OPS4J Pax Url - mvn: (start level 5) starts and allows
resolution of mvn protocol (but it is not configured with the dedicated
properties file (org.ops4j.pax.url.mvn.cfg).
...
The Bundle Apache Felix Configuration Admin Service (start level 10) :
offers a service to do the configuration of managed services (the
configuration process of mvn will be done here).
...
The Bundle Apache Karaf :: Features Core : (start level 30) reads
org.apache.karaf.features.cfg for features
But with the default configuration Bundle Apache Karaf :: Features Core can
start before the Bundle Apache Felix Configuration Admin Service have
processed the maven configuration so it fails like this.
java.io.IOException: URL
[mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.3.0-fuse-00-00/xml/features]
could not be resolved. :
mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.3.0-fuse-00-00/xml/features
at
org.apache.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:191)
at
org.apache.karaf.features.internal.FeaturesServiceImpl.internalAddRepository(FeaturesServiceImpl.java:168)
at
org.apache.karaf.features.internal.FeaturesServiceImpl.getFeatures(FeaturesServiceImpl.java:704)
at
org.apache.karaf.features.internal.FeaturesServiceImpl.getFeature(FeaturesServiceImpl.java:674)
at
org.apache.karaf.features.internal.FeaturesServiceImpl$1.run(FeaturesServiceImpl.java:751)
Caused by: java.lang.RuntimeException: URL
[mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.3.0-fuse-00-00/xml/features]
could not be resolved.
at
org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:195)
at
org.apache.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:92)
... 4 more
The fastest Way to reproduce the behavior is the following :
In your favorite EDI add a breakpoint in the run method of
org.apache.felix.cm.impl.UpdateThread
Start servicemix with the debug option to be able to attach debugger.
Attach quickly the debugger to be sure that the thread "Configuration
Updater" will be stopped at the beginning.
I have also noticed that the configuration of pax service logging is done
after mvn configuration, so in my case the file org.ops4j.pax.logging.cfg is
not yet used and i haven't logs, i should edit java.util.logging.properties.
Is there a way to ensure that at least maven and logging configuration is
done correctly before starting other bundles ?
Thanks
Hervé