Install the jndi feature: it should provide the javax.naming packages.
Regards
JB
Sent X.x.namingmy Samsung device
-------- Original message --------
From: Jurgen Voorneveld <[email protected]>
Date: 23/04/2015 12:51 (GMT+01:00)
To: [email protected]
Subject: Re: HikariCP library load issue
Hmm.. ideas.. I noticed that I had to import javax.naming to get rid of
another error I saw before. So I wondered if there might be more imports
that Karaf doesn't provide out of the box that standard Java does.
After some looking through HikariCP source code I found several import
statements that could be a problem. And now my Import statement looks
like this:
Import-Package: org.osgi.framework, javax.naming, org.slf4j, javax.sql
, javax.management
Now I'm getting entirely new errors so I'm guessing the problem has been
solved for that class.
The error I'm getting now is:
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.pool2.impl.DefaultEvictionPolicy
I'm starting to feel that Karaf lacks so many classes that most
libraries I'm importing might be missing dependencies. Is it possible to
import all of javax? Or is there some default list that will make Karaf
provide the same list as standard Java?
Jurgen
On 04/23/2015 12:37 PM, Jurgen Voorneveld wrote:
Should have paid more attention.
karaf@root()> package:exports | grep HikariConfig
Returns empty. Which I guess makes sense; there is no library in Karaf
exporting these classes by default.
But I don't see how that could make it fail. The class is available in
the bundle itself.
For completeness this is the imports in the manifest:
Import-Package: org.osgi.framework, javax.naming
Jurgen
On 04/23/2015 12:30 PM, Jurgen Voorneveld wrote:
Helo Morgan,
I get this:
karaf@root()> packages:exports | grep HikariConfig
pipe: org.apache.felix.gogo.runtime.CommandNotFoundException: Command
not found: packages:exports
I have no idea what this means.
Jurgen
On 04/23/2015 12:18 PM, Morgan Hautman wrote:
Hello Jurgen,
What do you get when you're doing a "packages:exports | grep
HikariConfig"?
Regards
Morgan
On 23/04/2015 11:58, Jurgen Voorneveld wrote:
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
==================