Apache Karaf enable Gemini blueprint - spring

I've downloaded Karaf 3.0.8 and tried to enable spring 3.2 and gemini blueprint - without success
karaf#root()> feature:install spring/3.2.17.RELEASE_1
karaf#root()> feature:install gemini-blueprint
Exception in thread "EclipseGeminiBlueprintExtenderThread-25" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 22 in XML document from URL [bundle://55.0:0/OSGI-INF/blueprint/kar-deployer.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:
The matching wildcard is strict, but no declaration can be found for element 'ext:property-placeholder'.
....
karaf#root()> feature:list -i
Name | Version | Installed | Repository | Description
---------------------------------------------------------------------------------------------------------------------
spring | 3.2.17.RELEASE_1 | x | spring-3.0.8 | Spring 3.2.x support
gemini-blueprint | 1.0.0.RELEASE | x | spring-3.0.8 | Gemini Blueprint Extender
standard | 3.0.8 | x | standard-3.0.8 | Karaf standard feature
config | 3.0.8 | x | standard-3.0.8 | Provide OSGi ConfigAdmin support
region | 3.0.8 | x | standard-3.0.8 | Provide Region Support
package | 3.0.8 | x | standard-3.0.8 | Package commands and mbeans
kar | 3.0.8 | x | standard-3.0.8 | Provide KAR (KARaf archive) support
ssh | 3.0.8 | x | standard-3.0.8 | Provide a SSHd server on Karaf
management | 3.0.8 | x | standard-3.0.8 | Provide a JMX MBeanServer and a set of MBeans in K
karaf#root()> list -t 0
START LEVEL 100 , List Threshold: 0
ID | State | Lvl | Version | Name
------------------------------------------------------------------------------------------------------------
0 | Active | 0 | 4.2.1 | System Bundle
1 | Active | 5 | 2.4.7 | OPS4J Pax Url - aether:
2 | Active | 5 | 2.4.7 | OPS4J Pax Url - wrap:
3 | Active | 8 | 1.8.4 | OPS4J Pax Logging - API
4 | Active | 8 | 1.8.4 | OPS4J Pax Logging - Service
5 | Active | 10 | 3.0.8 | Apache Karaf :: Service :: Guard
6 | Active | 10 | 1.8.4 | Apache Felix Configuration Admin Service
7 | Active | 11 | 3.5.2 | Apache Felix File Install
8 | Active | 12 | 5.0.3 | ASM all classes with debug info
9 | Active | 20 | 1.1.1 | Apache Aries Util
10 | Active | 20 | 1.0.1 | Apache Aries Proxy API
11 | Active | 20 | 1.0.8 | Apache Aries Blueprint CM
12 | Active | 20 | 1.0.4 | Apache Aries Proxy Service
13 | Active | 20 | 1.0.1 | Apache Aries Blueprint API
14 | Resolved | 20 | 1.0.0 | Apache Aries Blueprint Core Compatiblity Fragment Bundle, Hosts: 15
15 | Active | 20 | 1.6.1 | Apache Aries Blueprint Core, Fragments: 14
16 | Active | 24 | 3.0.8 | Apache Karaf :: Deployer :: Spring
17 | Active | 24 | 3.0.8 | Apache Karaf :: Deployer :: Blueprint
18 | Active | 24 | 3.0.8 | Apache Karaf :: Deployer :: Wrap Non OSGi Jar
19 | Active | 25 | 3.0.8 | Apache Karaf :: Region :: Core
20 | Active | 25 | 3.0.8 | Apache Karaf :: Features :: Core
21 | Active | 26 | 3.0.8 | Apache Karaf :: Deployer :: Features
22 | Active | 30 | 2.13.0 | JLine
23 | Active | 30 | 0.2.1 | JLEdit :: Core
24 | Active | 30 | 3.0.8 | Apache Karaf :: Features :: Command
25 | Active | 30 | 3.0.8 | Apache Karaf :: Bundle :: Core
26 | Active | 30 | 3.0.8 | Apache Karaf :: Bundle :: Commands
27 | Active | 30 | 3.0.8 | Apache Karaf :: Shell :: Console
28 | Active | 30 | 3.0.8 | Apache Karaf :: JAAS :: Modules
29 | Active | 30 | 3.0.8 | Apache Karaf :: JAAS :: Config
30 | Active | 30 | 0.14.0 | Apache Mina SSHD :: Core
31 | Active | 30 | 3.0.8 | Apache Karaf :: Shell :: Help System
32 | Active | 30 | 3.0.8 | Apache Karaf :: Shell :: Table
33 | Active | 30 | 3.0.8 | Apache Karaf :: System :: Core
34 | Active | 30 | 3.0.8 | Apache Karaf :: System :: Shell Commands
35 | Active | 30 | 3.0.8 | Apache Karaf :: Shell :: Various Commands
36 | Active | 30 | 1.0.0 | Apache Aries Quiesce API
37 | Active | 30 | 3.0.8 | Apache Karaf :: ConfigAdmin :: Core
38 | Active | 30 | 3.0.8 | Apache Karaf :: ConfigAdmin :: Commands
39 | Active | 30 | 3.0.8 | Apache Karaf :: Instance :: Core
40 | Active | 30 | 3.0.8 | Apache Karaf :: Instance :: Command
41 | Active | 30 | 3.0.8 | Apache Karaf :: JAAS :: Command
42 | Active | 30 | 3.0.8 | Apache Karaf :: Diagnostic :: Core
43 | Active | 30 | 3.0.8 | Apache Karaf :: Diagnostic :: Command
44 | Active | 30 | 3.0.8 | Apache Karaf :: Log :: Core
45 | Active | 30 | 3.0.8 | Apache Karaf :: Log :: Command
46 | Active | 30 | 3.0.8 | Apache Karaf :: Service :: Core
47 | Active | 30 | 3.0.8 | Apache Karaf :: Service :: Command
48 | Active | 30 | 1.0.0.v20110524 | Region Digraph
49 | Active | 30 | 3.0.8 | Apache Karaf :: Region :: Persistence
50 | Active | 30 | 3.0.8 | Apache Karaf :: Region :: Shell Commands
51 | Active | 30 | 3.0.8 | Apache Karaf :: Package :: Core
52 | Active | 30 | 3.0.8 | Apache Karaf :: Package :: Commands
53 | Active | 30 | 3.0.8 | Apache Karaf :: KAR :: Core
54 | Active | 30 | 3.0.8 | Apache Karaf :: KAR :: Command
55 | Active | 30 | 3.0.8 | Apache Karaf :: Deployer :: Karaf Archive (.kar)
56 | Active | 30 | 2.0.7 | Apache MINA Core
57 | Active | 30 | 3.0.8 | Apache Karaf :: Shell :: SSH
58 | Active | 30 | 3.0.8 | Apache Karaf :: Management
59 | Active | 30 | 1.1.1 | Apache Aries JMX API
60 | Active | 30 | 1.1.6 | Apache Aries JMX Core
61 | Active | 30 | 1.1.0 | Apache Aries JMX Blueprint API
62 | Active | 30 | 1.1.0 | Apache Aries JMX Blueprint Core
63 | Active | 30 | 1.0.0 | Apache Aries JMX Whiteboard
64 | Active | 30 | 1.0.0.6 | Apache ServiceMix :: Bundles :: aopalliance
65 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-core
66 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-expression
67 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-beans
68 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-aop
69 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-context
70 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: spring-context-support
71 | Active | 30 | 1.0.0.RELEASE | gemini-blueprint-io
72 | Active | 30 | 1.0.0.RELEASE | gemini-blueprint-core
73 | Active | 30 | 1.0.0.RELEASE | gemini-blueprint-extender
After restart I've got following exception printed for almost every bundle
73 - org.eclipse.gemini.blueprint.extender - 1.0.0.RELEASE | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.karaf.config.command, config=OSGI-INF/blueprint/shell-config.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 25 in XML document from URL [bundle://38.0:0/OSGI-INF/blueprint/shell-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'command-bundle'.
For some bundles there's a problem with command-bundle element and for others with ext:property-placeholder
So it looks like Karaf core bundles have invalid blueprint xml? Is it a bug?

The Apache Karaf 2.x and 3.x versions use blueprint internally.
Blueprint specification is somewhat limited and does not cover any extension mechanism through namespaces. This is supported by both Aries Blueprint and Gemini Blueprint, but in different ways.
Those Karaf versions rely on Aries Blueprint, so it's a bit hard to get Gemini Blueprint working.
Karaf 4.x does not use Blueprint internally anymore, so it should be much easier to install Gemini Blueprint there.
That said, Gemini Blueprint isn't much active, so you should have a look at the Aries Blueprint implementation instead. Fwiw, Aries Blueprint also provides a full Spring compatibility layer if you need.

Related

Error running SonarQube console with brew on Mac

I am trying to run /usr/local/opt/sonarqube/bin/sonar console but getting following error:
wrapper | Launching a JVM...
jvm 1 | WrapperManager: Initializing...
jvm 1 | WrapperManager: ERROR - The version of the Wrapper which launched this JVM is "3.5.48"
jvm 1 | WrapperManager: while the version of the Wrapper jar file currently in use
jvm 1 | WrapperManager: is "3.5.49".
jvm 1 | WrapperManager:
jvm 1 | WrapperManager: ERROR - The version of the Wrapper which launched this JVM is
jvm 1 | WrapperManager: "3.5.48" while the version of the native library
jvm 1 | WrapperManager: is "3.5.49".
jvm 1 | WrapperManager:
wrapper | <-- Wrapper Stopped
Faced the same issue and it is now resolved by reinstalling sonarqube.
brew reinstall -s sonarqube

SonarQube Wrapper stopped -> Failure -> Mac OS Big Sur

SonarQube Wrapper stopped
(base) Kalidosss-MacBook-Pro:~ admin$ sh /Applications/SonarQube/bin/macosx-universal-64/sonar.sh console
Running SonarQube...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 |
jvm 1 | WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11 to run
jvm 1 | java.lang.IllegalStateException: SonarQube requires Java 11 to run
jvm 1 | at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
jvm 1 | at org.sonar.application.App.checkJavaVersion(App.java:93)
jvm 1 | at org.sonar.application.App.start(App.java:56)
jvm 1 | at org.sonar.application.App.main(App.java:97)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1 | at java.lang.Thread.run(Thread.java:748)
wrapper | <-- Wrapper Stopped

Unable to access JMX Console on ActiveMQ 5.12.0 VM

I am attempting to get JMX Console working on a Vagrant VM box with ActiveMQ 5.12.0 manually installed. I've followed the guide on
http://activemq.apache.org/jmx.html
and numerous Stackoverflow troubleshooting questions:
Apache ActiveMQ browser can't connect to JMX console
How do I turn on JMX in ActiveMQ 5.2
configure JMX for ActiveMQ for remoting access
but I am still not able to access the console from the host machine.
I've done the following steps:
added useJmx="true" onto the <broker> tag in the activemq.xml file
set the following management context in the activemq.xml file:
<managementContext createConnector="true" rmiServerPort="1098" connectorPort="1099"/>
set ACTIVEMQ_SUNJMX_START environment variable to
"\
-Dcom.sun.management.jmxremote.ssl=false\
-Dcom.sun.management.jmxremote.password.file=/usr/share/activemq/conf/jmx.password\
-Dcom.sun.management.jmxremote.access.file=/usr/share/activemq/conf/jmx.access\
"
attempting to connect on
service:jmx:rmi://192.168.150.117:1098/jndi/rmi://192.168.150.117:1099/jmxrmi
using admin:activemq as username:password (specified in jmx.access and jmx.password)
This is the activemq.log file:
2015-11-20 12:24:39,710 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#190c4838: startup date [Fri Nov 20 12:24:39 GMT 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2015-11-20 12:24:42,094 | INFO | PListStore:[/usr/share/activemq/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2015-11-20 12:24:42,191 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/share/activemq/data/kahadb] | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:42,232 | INFO | JMX consoles can connect to service:jmx:rmi://localhost:1098/jndi/rmi://localhost:1099/jmxrmi | org.apache.activemq.broker.jmx.ManagementContext | JMX connector
2015-11-20 12:24:42,464 | INFO | Apache ActiveMQ 5.12.0 (localhost, ID:activemq.cdl.vm-56262-1448022282329-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:42,492 | INFO | Listening for connections at: tcp://activemq.cdl.vm:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2015-11-20 12:24:42,498 | INFO | Connector openwire started | org.apache.activemq.broker.TransportConnector | main
2015-11-20 12:24:42,505 | INFO | Listening for connections at: amqp://activemq.cdl.vm:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2015-11-20 12:24:42,510 | INFO | Connector amqp started | org.apache.activemq.broker.TransportConnector | main
2015-11-20 12:24:42,525 | INFO | Listening for connections at: stomp://activemq.cdl.vm:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2015-11-20 12:24:42,532 | INFO | Connector stomp started | org.apache.activemq.broker.TransportConnector | main
2015-11-20 12:24:42,542 | INFO | Listening for connections at: mqtt://activemq.cdl.vm:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2015-11-20 12:24:42,550 | INFO | Connector mqtt started | org.apache.activemq.broker.TransportConnector | main
2015-11-20 12:24:42,693 | INFO | Listening for connections at ws://activemq.cdl.vm:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.ws.WSTransportServer | main
2015-11-20 12:24:42,698 | INFO | Connector ws started | org.apache.activemq.broker.TransportConnector | main
2015-11-20 12:24:42,706 | INFO | Apache ActiveMQ 5.12.0 (localhost, ID:activemq.cdl.vm-56262-1448022282329-0:1) started | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:42,720 | INFO | For help or more information please see: http://activemq.apache.org | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:42,730 | WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: /usr/share/activemq/data/kahadb only has 10221 mb of usable space - resetting to maximum available disk space: 10221 mb | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:42,737 | WARN | Temporary Store limit is 51200 mb, whilst the temporary data directory: /usr/share/activemq/data/localhost/tmp_storage only has 10221 mb of usable space - resetting to maximum available 10221 mb. | org.apache.activemq.broker.BrokerService | main
2015-11-20 12:24:43,444 | INFO | ActiveMQ WebConsole available at http://0.0.0.0:8161/ | org.apache.activemq.web.WebConsoleStarter | main
2015-11-20 12:24:43,444 | INFO | ActiveMQ Jolokia REST API available at http://0.0.0.0:8161/api/jolokia/ | org.apache.activemq.web.WebConsoleStarter | main
2015-11-20 12:24:43,538 | INFO | Initializing Spring FrameworkServlet 'dispatcher' | /admin | main
2015-11-20 12:24:43,950 | INFO | jolokia-agent: No access restrictor found at classpath:/jolokia-access.xml, access to all MBeans is allowed | /api | main
When I try to connect it just says "Secure Connection Failed. Retry insecurely?". It then tries and fails again with "Connection Failed: Retry?"
I set the following options on the ACTIVEMQ_SUNJMX_START environment variable:
export ACTIVEMQ_SUNJMX_START="\
-Dcom.sun.management.jmxremote\
-Dcom.sun.management.jmxremote.ssl=false\
-Dcom.sun.management.jmxremote.authenticate=false\
-Dcom.sun.management.jmxremote.local.only=false\
"
And it now works.

How to configure ActiveMQ with LevelDB JNI driver?

I am having trouble forcing ActiveMQ 5.10.1 on CentOS 6 (64bit) with Oracle JDK 8 to use JNI driver for LevelDB. When I set indexFactory="org.fusesource.leveldbjni.JniDBFactory" - my broker fails to start. When I omit it, it does start, but it uses Pure Java driver.
<persistenceAdapter>
<levelDB directory="${activemq.data}/leveldb" indexFactory="org.fusesource.leveldbjni.JniDBFactory"/>
</persistenceAdapter>
I did install LevelDB rpm on my OS, but after the AMQ start, its log file indicates that it uses the pure java driver:
2015-01-27 05:44:48,172 | INFO | Using Persistence Adapter: LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.broker.BrokerService | main
2015-01-27 05:44:48,233 | INFO | Using the pure java LevelDB implementation. | org.apache.activemq.leveldb.LevelDBClient | main
2
I try adding the level-db jni jar file to the classpath, but AMQ fails to find the classes. Here is running broker (note classpath with the leveldbjni-1.8.jar - AMQ docs does not really explain if those optional libs are loaded or not by default?, so I added it by hand):
/home/roman/jdk1.8.0_31/bin/java -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/home/roman/amq/DISK1/broker1/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/home/roman/amq/DISK1/broker1/tmp -Dactivemq.classpath=;/home/roman/amq/DISK1/broker1/conf;/home/roman/apache-activemq-5.10.1/lib/optional/leveldbjni-1.8.jar -Dactivemq.home=/home/roman/apache-activemq-5.10.1 -Dactivemq.base=/home/roman/amq/DISK1/broker1 -Dactivemq.conf=/home/roman/amq/DISK1/broker1/conf -Dactivemq.data=/home/roman/amq/DISK1/broker1/data -jar /home/roman/apache-activemq-5.10.1/bin/activemq.jar start
Here is the error I get in the log file when forcing JNI to be used for LevelDB:
2015-01-28 05:07:34,904 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2015-01-28 05:07:36,139 | INFO | Using Persistence Adapter: LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,193 | ERROR | Failed to start Apache ActiveMQ ([broker1, null], java.lang.Exception: Could not load any of the index factory classes: org.fusesource.leveldbjni.JniDBFactory) | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,198 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) is shutting down | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,201 | INFO | Connector openwire stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,205 | INFO | Connector amqp stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,208 | INFO | Connector stomp stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,212 | INFO | Connector mqtt stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,215 | INFO | Connector ws stopped | org.apache.activemq.broker.TransportConnector | main
2015-01-28 05:07:36,229 | INFO | Stopped LevelDB[/home/roman/amq/DISK1/broker1/data/leveldb] | org.apache.activemq.leveldb.LevelDBStore | main
2015-01-28 05:07:36,240 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) uptime 0.135 seconds | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,243 | INFO | Apache ActiveMQ 5.10.1 (broker1, null) is shutdown | org.apache.activemq.broker.BrokerService | main
2015-01-28 05:07:36,246 | INFO | Closing org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2015-01-28 05:07:36,252 | WARN | Exception thrown from LifecycleProcessor on context close | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.apache.activemq.xbean.XBeanBrokerFactory$1#6276ae34: startup date [Wed Jan 28 05:07:34 PST 2015]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.apache.activemq.hooks.SpringContextHook.run(SpringContextHook.java:30)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:809)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerService.stop(XBeanBrokerService.java:122)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:601)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.10.1.jar:5.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_31]
at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_31]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]
at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.1.jar:5.10.1]
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.10.1.jar:5.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_31]
at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0_31]
at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.10.1]
at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.10.1]
The AMQ doc does not explain on how to configure LevelDB for JNI to work. Any suggestions?
The reason I want to use JNI driver is because with pure Java driver my AMQ broker performs about ~20% slower than KahaDB in 80 concurrent user / 20 queues test. I am hoping JNI with LevelDB can make AMQ go faster than KahaDB configuration.
I know this is old, but I couldn't find the answer really documented anywhere else. All I needed to do was download the appropriate JNI library to the ActiveMQ lib directory. For example:
wget -O /etc/activemq/apache-activemq-5.13.0/lib/optional/leveldbjni-linux64-1.8.jar http://central.maven.org/maven2/org/fusesource/leveldbjni/leveldbjni-linux64/1.8/leveldbjni-linux64-1.8.jar

VLCJ on Mac OSX Unsatisfied Link Error (darwin/libvlc.dylib)

I'm trying to initialize VLCJ to do some streaming as part of an application I'm working on. Going by the official tutorial, I'm using the following code to try and load the library:
NativeLibrary.addSearchPath(
RuntimeUtil.getLibVlcLibraryName(), "/Applications/VLC/Contents/MacOS/lib"
);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
When I run it, I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': JNA native support (darwin/libvlc.dylib) not found in resource path (/Users/iamparker/Documents/workspace/VLCStreamer/target/classes:/usr/jar/vlc/vlcj-3.0.1-javadoc.jar:/usr/jar/vlc/vlcj-3.0.1-sources.jar:/usr/jar/vlc/vlcj-3.0.1-test-sources.jar:/usr/jar/vlc/vlcj-3.0.1-tests.jar:/usr/jar/vlc/vlcj-3.0.1.jar:/usr/jar/vlc/jna-4.1.0.jar:/usr/jar/vlc/jna-platform-4.1.0.jar)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:220)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:322)
at com.sun.jna.Library$Handler.<init>(Library.java:142)
at com.sun.jna.Native.loadLibrary(Native.java:387)
at com.sun.jna.Native.loadLibrary(Native.java:366)
at com.thundercats.vlcstreamer.Main.loadNative(Main.java:33)
at com.thundercats.vlcstreamer.Main.main(Main.java:16)
It looks like it's not even searching the path that I gave it. There is a perfectly good libvlc.dylib inside that directory.
Here is the output from running the VLCJ NativeDiscoveryTest:
vlcj: (Info.java:70) | INFO | vlcj: <version not available>
vlcj: (Info.java:71) | INFO | java: 1.6.0_65 Apple Inc.
vlcj: (Info.java:72) | INFO | java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
vlcj: (Info.java:73) | INFO | os: Mac OS X 10.8.5 x86_64
vlcj: (NativeDiscovery.java:98) | DEBUG | discover()
vlcj: (NativeDiscovery.java:101) | DEBUG | jnaLibraryPath=null
vlcj: (NativeDiscovery.java:106) | DEBUG | discoveryStrategy=uk.co.caprica.vlcj.discovery.linux.DefaultLinuxNativeDiscoveryStrategy#42b1b4c3
vlcj: (NativeDiscovery.java:109) | DEBUG | supported=false
vlcj: (NativeDiscovery.java:106) | DEBUG | discoveryStrategy=uk.co.caprica.vlcj.discovery.windows.DefaultWindowsNativeDiscoveryStrategy#60072ffb
vlcj: (NativeDiscovery.java:109) | DEBUG | supported=false
vlcj: (NativeDiscovery.java:106) | DEBUG | discoveryStrategy=uk.co.caprica.vlcj.discovery.mac.DefaultMacNativeDiscoveryStrategy#77df38fd
vlcj: (NativeDiscovery.java:109) | DEBUG | supported=true
vlcj: (AbstractNativeDiscoveryStrategy.java:49) | DEBUG | discover()
vlcj: (AbstractNativeDiscoveryStrategy.java:54) | DEBUG | directoryNames=[/Users/iamparker/Documents/workspace/NativeDiscoveryTest, /usr/bin, /bin, /usr/sbin, /sbin, /Applications/VLC.app/Contents/MacOS/lib]
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/Users/iamparker/Documents/workspace/NativeDiscoveryTest
vlcj: (AbstractNativeDiscoveryStrategy.java:95) | DEBUG | Failed to matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/usr/bin
vlcj: (AbstractNativeDiscoveryStrategy.java:95) | DEBUG | Failed to matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/bin
vlcj: (AbstractNativeDiscoveryStrategy.java:95) | DEBUG | Failed to matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/usr/sbin
vlcj: (AbstractNativeDiscoveryStrategy.java:95) | DEBUG | Failed to matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/sbin
vlcj: (AbstractNativeDiscoveryStrategy.java:95) | DEBUG | Failed to matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:57) | DEBUG | directoryName=/Applications/VLC.app/Contents/MacOS/lib
vlcj: (AbstractNativeDiscoveryStrategy.java:85) | DEBUG | Matched 'libvlc.dylib' in '/Applications/VLC.app/Contents/MacOS/lib'
vlcj: (AbstractNativeDiscoveryStrategy.java:85) | DEBUG | Matched 'libvlccore.dylib' in '/Applications/VLC.app/Contents/MacOS/lib'
vlcj: (AbstractNativeDiscoveryStrategy.java:88) | DEBUG | Matched all required files
vlcj: (AbstractNativeDiscoveryStrategy.java:63) | DEBUG | result=/Applications/VLC.app/Contents/MacOS/lib
vlcj: (NativeDiscovery.java:112) | DEBUG | path=/Applications/VLC.app/Contents/MacOS/lib
vlcj: (NativeDiscovery.java:114) | INFO | Discovery found libvlc at '/Applications/VLC.app/Contents/MacOS/lib'
vlcj: (Test.java:34) | DEBUG | found=true
vlcj: (LibVlcFactory.java:164) | INFO | vlc: 2.1.4 Rincewind, changeset 2.1.4-0-g2a072be
vlcj: (LibVlcFactory.java:165) | INFO | libvlc: /Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib
vlcj: (Test.java:36) | DEBUG | Version: {}2.1.4 Rincewind
Turns out it was just a silly mistake on my part. The path I gave was "/Applications/VLC/Contents/MacOS/lib", and it should have been "/Applications/VLC.app/Contents/MacOS/lib". I forgot that VLC had a .app extension. I'll go bury my head in the sand now.
cd src/main/resources/
cp -r /Applications/VLC.app/Contents/MacOS/lib darwin
rm darwin/*.*.*
cd darwin
install_name_tool -add_rpath #loader_path libvlc.dylib
mkdir vlc
cp -r /Applications/VLC.app/Contents/MacOS/plugins vlc/plugins
This is the macOS version. It worked for me. Maybe help you.
├── kotlin
│   └── App.kt
└── resources
└── darwin
├── libvlc.dylib
├── libvlccore.dylib
└── vlc
└── plugins
├── liba52_plugin.dylib
├── libaccess_concat_plugin.dylib
├── libaccess_imem_plugin.dylib
├── libaccess_mms_plugin.dylib
I update vlcj maven dependency to:
<dependency>
<groupId>uk.co.caprica</groupId>
<artifactId>vlcj</artifactId>
<version>3.12.1</version>
</dependency>
and it works

Resources