Hi folks,

After upgrading an existing karaf application to the latest karaf version (4.2.2) I ran into startup issues.

To isolate the problem I revived an old example project and tried to get that one working first. This example project WicketKaraf can be found on github: https://github.com/misl/Samples . Please discard the other 2 projects in there, they still need to be upgraded. So only WicketKaraf folder is applicable.

Unfortunately building this project yourself might not be straightforward due to: PAXWICKET-489 <https://ops4j1.jira.com/projects/PAXWICKET/issues/PAXWICKET-489> and PAXWICKET-490 <https://ops4j1.jira.com/projects/PAXWICKET/issues/PAXWICKET-490>. I have yet to get some response for these issues.

Now the funny thing is, when starting all features manually (feature:install) everything works just fin. But when trying to automatically start my features on startup (bootFeature) it fails.

On first start:

org.apache.karaf.features.core[org.apache.karaf.features.internal.service.FeaturesServiceImpl] : Unknown protocol: mvn
java.net.MalformedURLException: Unknown protocol: mvn
    at java.net.URL.<init>(URL.java:627)
    at java.net.URL.<init>(URL.java:490)
    at java.net.URL.<init>(URL.java:439)
    at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installConfigurationFile(FeatureConfigInstaller.java:230)     at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installFeatureConfigs(FeatureConfigInstaller.java:147)     at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installConfigs(BundleInstallSupportImpl.java:297)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installConfigs(FeaturesServiceImpl.java:1141)     at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:926)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
    at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)
    at java.net.URL.<init>(URL.java:622)
    ... 13 more
org.apache.karaf.features.core[org.apache.karaf.features.internal.service.BootFeaturesInstaller] : Error installing boot features
java.net.MalformedURLException: Unknown protocol: mvn
    at java.net.URL.<init>(URL.java:627)
    at java.net.URL.<init>(URL.java:490)
    at java.net.URL.<init>(URL.java:439)
    at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installConfigurationFile(FeatureConfigInstaller.java:230)     at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installFeatureConfigs(FeatureConfigInstaller.java:147)     at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installConfigs(BundleInstallSupportImpl.java:297)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installConfigs(FeaturesServiceImpl.java:1141)     at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:926)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
    at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)
    at java.net.URL.<init>(URL.java:622)
    ... 13 more

Looked this one up, but I could not find any clear resolution to solve this. I probably have to add something to the boot features section in my assembly pom.

Don't know why but tried to start the application multiple times. The strange thing is that that on a next start (bin/karaf) I got a different error

On second start:

 __      __.__        __           __   ____ __.                    _____
/  \    /  \__| ____ |  | __ _____/  |_|    |/ _|____ ____________ _/ ____\
\   \/\/   /  |/ ___\|  |/ // __ \   __\      < \__ \\_  __ \__  \\   __\
 \        /|  \  \___|    <\  ___/|  | |    |  \ / __ \|  | \// __ \|  |
  \__/\  / |__|\___  >__|_ \\___  >__| |____|__ (____  /__|  (____  /__|
       \/          \/     \/    \/             \/ \/           \/

  WicketKaraf Console (1.0.0-SNAPSHOT)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.

karaf@root()> ********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
*** ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
*** ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
org.apache.karaf.features.core[org.apache.karaf.features.internal.service.BootFeaturesInstaller] : Error installing boot features java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@63589ad6 rejected from java.util.concurrent.ThreadPoolExecutor@7bc9d882[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]     at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)     at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)     at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)     at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)     at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:681)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvisionInThread(FeaturesServiceImpl.java:963)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:808)     at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:728)     at org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:97)     at org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:87)     at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:196)     at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:292)     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Three time is a charm to I tried another restart.

Third start:

 __      __.__        __           __   ____ __.                    _____
/  \    /  \__| ____ |  | __ _____/  |_|    |/ _|____ ____________ _/ ____\
\   \/\/   /  |/ ___\|  |/ // __ \   __\      < \__ \\_  __ \__  \\   __\
 \        /|  \  \___|    <\  ___/|  | |    |  \ / __ \|  | \// __ \|  |
  \__/\  / |__|\___  >__|_ \\___  >__| |____|__ (____  /__|  (____  /__|
       \/          \/     \/    \/             \/ \/           \/

  WicketKaraf Console (1.0.0-SNAPSHOT)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.

karaf@root()> ********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
*** ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
*** ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************

karaf@root()>

Guess what, now to starts without any problems.

To me this appears to be a timing or bundle start order issue. Unfortunately I lack the Karaf experience to resolve this myself.

Any help in resolving this is highly appreciated.

Kind regards,

misl

Reply via email to