Hi, It's my first post on this mailing list/forum.
I've been trying to install WAR as part of the boot feature for a custom distribution. The example is here: http://github.com/boodoopl/karaf-war-problems I've found couple of bugs during trying to run this example. It looks like all problems are introduced by Karaf 3.0.x as I was able to set war as part of the boot feature in the Karaf 2.3.3. I guess the described problems are also related to other non standard protocols (blueprint:, wrap:, spring:, etc.) Those are my attempts to run the example and related bugs/questions: ** Initial attempt ** Basically I've wanted to deploy Hello World WAR in Karaf as part of the boot feature: <feature name='${project.artifactId}' version='${project.version}'> <feature>war</feature> <bundle>webbundle:mvn:org.example/example-webapp/${project.version}/war$Web-ContextPath=/sample</bundle> </feature> I was not able to do it due to mvn build failure. I reported it as [KARAF-3344] and fixed it in pull request #51 But I wonder, *Question 1*: Why is the '$' used as URL argument separator in feature descriptor. It was "?" before in Karaf 2.x.x. "?" is still proper symbol understood by Karaf when installing bundle with argument from the console. ** 2nd attempt ** I switched to local karaf-maven-plugin with my fix for [KARAF-3344], and... I was not able to start Karaf - many system bundles did not start. The reason: 3.0.2 | Error when installing feature war-feature: java.net.MalformedURLException: Unknown protocol: webbundle But it can be seen form the karaf.log that "war" feature bundles are being installed before: 3.0.2 | Error when installing feature war-feature: java.net.MalformedURLException: Unknown protocol: webbundle Detailed log <http://github.com/boodoopl/karaf-war-problems/commit/d9876571b0ded428767422e003a4edc53a14cc1a> *Question 2*: Why does it happen? "war" feature is installed before webbundle: bundle. Some bug in feature service core related to protocol discovery? ** 3rd attempt ** Ok, so If it has been not possible to install my custom war-feature as boot feature I set it as installedFeature to make manual installation tests. See: detailed console logs <http://github.com/boodoopl/karaf-war-problems/commit/4ba701517963e2110d6107fa8ed9d7886aa9149a> Briefly: When installing war-feature by feature:install the result is the same as in 2nd attempt: Error executing command: Unknown protocol: webbundle But, what is worse: When trying to install war-feature with already installed war feature: bundle:install -s webbundle:mvn:org.example/example-webapp/1.0-SNAPSHOT/war$Web-ContextPath=/sample Bundle IDs: Error executing command: Error installing bundles: Unable to install bundle webbundle:mvn:org.example/example-webapp/1.0-SNAPSHOT/war-ContextPath=/sample But when changing $ -> ? it works So the next question is same as *Question 1*: "$" or "?" ? =================== One more observation: The example I've presented is special optimistic one: The war feature is properly installed as first before the bundle -> as specified by feature descriptor. What I've observed in my other project with more complicated feature descriptor: it was impossible to make Karaf install "war" feature before the webbundle, event ensuring that webbundle star level is higher then war bundles and that war is defined before webbundle in the feature descriptor. *Question 3*: How does Karaf should process feature installation order? By contained bundles start levels or by order they are defined in feature descriptor? What I've done next - I excluded "war" from my custom feature and set as bootFeature in karaf-maven-plugin before my custom feature. It didn't work either. So I looked inside org.apache.karaf.features.cfg file. The featuresBoot order was not the same as defined in configuration for karaf-maven-plugin *Qestion 4*: Shouldn't the featuresBoot cfg order be the same as defined in configuration for karaf-maven-plugin? -- View this message in context: http://karaf.922171.n3.nabble.com/Problems-with-setting-WAR-as-part-of-boot-feature-tp4036297.html Sent from the Karaf - Dev mailing list archive at Nabble.com.
