Dear list,

I have Apache Karaf installed on a production system here at work and
I'm trying to install a bundle into it. This is fairly new to me as
previously the code was simply running as standalone applications.

I'm getting an exception when I try to load the bundle:

karaf@root()> list
START LEVEL 100 , List Threshold: 50
ID | State    | Lvl | Version  | Name
-----------------------------------------
87 | Resolved |  80 | 01.00.27 | Analyzer
karaf@root()> start 87
Error executing command: Error executing command on bundles:
        Unable to execute command on bundle 87: Activator start error in bundle
nl.redsocks.farm.analyzer [87].
karaf@root()> log:display
2015-04-23 11:48:28,700 | ERROR | h for user karaf | ShellUtil
              | 25 - org.apache.karaf.shell.console - 3.0.3 | Exception
caught while executing command
org.apache.karaf.shell.console.MultiException: Error executing command
on bundles:
        Unable to execute command on bundle 87: Activator start error in bundle
nl.redsocks.farm.analyzer [87].
        at
org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:92)
        at
org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:58)
        at
org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:50)
        at
org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:41)
        at
org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[25:org.apache.karaf.shell.console:3.0.3]
        at Proxy5f648166_9983_4f8f_acb1_23f0c1d1ea3b.execute(Unknown Source)[:]
        at Proxy5f648166_9983_4f8f_acb1_23f0c1d1ea3b.execute(Unknown Source)[:]
        at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[25:org.apache.karaf.shell.console:3.0.3]
        at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
        at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
        at
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158)[52:org.apache.karaf.shell.ssh:3.0.3]
        at
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133)
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_25]
        at
org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[26:org.apache.karaf.jaas.modules:3.0.3]
        at
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129)[52:org.apache.karaf.shell.ssh:3.0.3]
Caused by: java.lang.Exception: Unable to execute command on bundle 87:
Activator start error in bundle nl.redsocks.farm.analyzer [87].
        at
org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:55)
        ... 20 more
Caused by: org.osgi.framework.BundleException: Activator start error in
bundle nl.redsocks.farm.analyzer [87].
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
        at org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:27)
        at
org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:53)
        ... 20 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.zaxxer.hikari.HikariConfig
        at nl.redsocks.farm.common.services.MySQL.init(MySQL.java:29)
        at nl.redsocks.farm.analyzer.core.Analyzer.start(Analyzer.java:250)
        at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
        ... 25 more

karaf@root()>

sorry for the wrapping. It looks like the problem is with HikariCP;
"Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.zaxxer.hikari.HikariConfig"

I checked the jar and this class is in there. And the code also
functions without problems when run standalone.

Right now I'm creating bundles by creating one massive jar with all
dependencies packaged together. Perhaps I should try installing HikariCP
as a library inside its own bundle?

How can I solve the problem?

thanks
Jurgen

versions:

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

$ uname -a
Linux farm 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux

$ awk 'NR>=17&&NR<=20{print}NR>=21{exit}' RELEASE-NOTES

                    Apache Karaf 3.0.3
                    ==================


Reply via email to