Using apache directory ldap in Servicemix - ldap

I have an osgi application running on Servicemix 6. I added some code that uses apache directory for ldap lookups (org.apache.directory.api.ldap).
I got an error when deploying the app in Servicemix:
Unresolved constraint...
(osgi.wiring.package=org.apache.directory.api.ldap.model.cursor)
Can I use this apache lib in Servicemix? How can I import it?
Or, should I use some other lib?

I ran this command, which I think wraps my dependency as osgi-compatible.
bundle:install -s wrap:mvn:org.apache.directory.api/api-all/1.0.0-M33

Related

JavaMelody error - Monitoring of sql requests and of jdbc connections in GlassFish v4.1

I want to use JavaMelody to monitor the SQL requested by a Glassfish Application Server. There are step-by-step instructions on https://github.com/javamelody/javamelody/wiki/UserGuideAdvanced#monitoring-of-sql-requests-and-of-jdbc-connections-in-glassfish-v3
I followed the instructions (I didn't download javamelody-objectfactory.jar but used javamelody-core-1.54.0.jar instead) and I get this error when clicking on the refresh button (javamelody web page) :
server.log :
exception while collecting data
java.lang.NoClassDefFoundError: org/jrobin/core/RrdException
at net.bull.javamelody.Collector.getCounterJRobin(Collector.java:836)
at net.bull.javamelody.Collector.collectJRobinValues(Collector.java:489)
...
any idea how to resolve this ?
jrobin-1.5.9.1.jar is installed in the lib folder of glassfish (and in my ear project).
thanks !
javamelody-objectfactory.jar (java source included in the jar) and javamelody-core jar file are absolutely different things. The first is to make the datasource monitorable in Glassfish and the second is the monitoring tool itself.
First fix the exception. You should probably put javamelody-core jar and jrobin jar files in your ear project (and not one in lib folder of Glassfish and one in ear).
Then if the monitoring reports don't include SQL monitoring for the datasource declared in Glassfish, use the javamelody-objectfactory.jar including all steps as said in the doc.

Error creating an Apache Apollo broker

I downloaded and unzipped the Apache Apollo distribution as described in their site.
~/Developer/Web/MQTT/apache-apollo-1.7.1/bin/apollo create mybroker
I got teh below output in the Terminal.
Creating apollo instance at: mybroker
ERROR: mybroker/etc/log4j.properties (No such file or directory)
That command is supposed to create the etc sub directory among others.
Any idea why this error is occurring?
Okay, I resolved it. I installed Apollo via Homebrew successfully. Then I cd'ed to /var/lib and ran the following command. This time with sudo.
sudo apollo create mybroker
It created the broker successfully. Then I ran the below command to run it. Again with sudo.
sudo mybroker/bin/apollo-broker run
Which started the broker and I could login via the web dashboard at http://127.0.0.1:61680/ too.
I use Ubuntu 16.0.4. And I encountered the same problem. I resolved by this:
use "sudo apollo create......"
it seems because the apollo didn't have authorities to create document in /etc/

Running Jboss 7 using different config folder under standalone-servers

I'm used to jboss 5 deployment schemes where i use this command to deploy:
D:\jboss5\bin\run.bat -c ZZZ
which will deploy whatever in the jboss5\server\ZZZ folder
I have this structure on my jboss7:
D:\jboss7\
+standalone-servers
++ZZZ
+++modules
when i try to run jboss7 like this:
D:\jboss7\bin\standalone-servers.bat -c ZZZ
it complains with the following:
org.jboss.modules.ModuleNotFoundException: Module
org.jboss.as.standalone:main is not found in local module loader
#7559ec47 (roots: D:\jboss7\standalone-servers\modules) at
org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
at
org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
at
org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
at
org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:204)
at org.jboss.modules.Main.main(Main.java:262)
how to tell jboss7 to look for the right configuration that resides in the folder ZZZ?
appreciate for answers
By default the base directory for a standalone JBoss EAP 6 / JBoss AS 7 instance is ${JBOSS_HOME}/standalone
You can override this by supplying -Djboss.server.base.dir=ZZZ
You need to create ZZZ/configuration and ZZZ/deployment directories, and
place your standalone.xml file in ZZZ/configuration, then start jboss using the option.
standalone.bat -Djboss.server.base.dir=path_to_ZZZ
If your JBoss configuration file is not called standalone.xml then you will also need to add
-Dtarget.appserver.configfile=my_standalone_config.xml
The JBoss instance base directory does not need to be within the ${JBOSS_HOME} subdirectory tree. In fact it is better to keep it somewhere separate as it allows you to update / reinstall JBOSS binaries without overwriting your configuration files.
The modules folder should remain within ${JBOSS_HOME}
So if your ${JBOSS_HOME} were c:\jboss7 it would look something like
C:\jboss7
+bin
+modules
+standalone <- not used!
... etc
c:\standalone-servers
+ZZZ
++configuration
+++standalone.xml
++deployments
A possible reason is your jboss runtime is corrupt. Reason for
**org.jboss.modules.ModuleNotFoundException: org.jboss.as.standalone:main
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:224)
at org.jboss.modules.Main.main(Main.java:341)**
is that jboss-eap-6.2\modules\system\layers\base\org\jboss\as\server\main package is missing inside your jboss directory. This package contains jboss-as-server-7.3.0.Final-redhat-14.jar and module.xml which are essential to run jboss server.

mod_ldap and mod_authnz_ldap not building for Apache httpd 2.4.4 and SVN

Problem: I am trying to compile the Apache web server using the latest sources of httpd, apr and apr-util, and enabling LDAP support. My current steps do not seem to be commpiling mod_ldap.so and mod_authnz_ldap.so.
Environment background: Build and target OS are RHEL5. A non-LDAP enabled instance of httpd is already on the server (2.4.1) and SVN 1.7.3 is already installed and works anonymously with httpd-2.4.1
Steps to reproduce:
Following the compilation instructions here I have downloaded:
httpd-2.4.4 in /path/apache/src/httpd-2.4.4
apr 1.4.6 in /path/apache/src/apr-1.4.6
apr-utils 1.5.2 /path/apache/src/apr-util-1.5.2
OpenLDAP and Berkley DB (for the LDAP libraries to build apr-util against) in /path/openldap-2.4.35_src and /path/db-5.3.21_src
With the sources in place, I:
compiled BDB and installed it to /path/db-5.3.21
compiled OpenLDAP using the installed BDB and installed it in /path/openldap-2.4.35
configured apr, compiled and installed it in /path/apache/apr
configured apr-util with:
./configure --with-ldap --prefix=/path/apache/apr-util-1.5.2 --with-apr=/path/apache/apr-1.4.6 --with-ldap-lib=/path/openldap-2.4.35/lib --with-ldap-include=/path/openldap-2.4.35/include
Afterwards, I built and installed with make and make install.
Finally, I configured httpd with the following:
./configure --prefix=/path/apache/httpd-2.4.4 --with-apr=/path/apache/apr-1.4.6 --with-apr-util=/path/apache/apr-util-1.5.2 --with-pcre=/path/apache/pcre-8.30 --with-ldap --enable-ldap
This was successful, and I was able to run make and make install
I now have a httpd instance in /path/apache/httpd-2.4.4/. Using /path/httpd-2.4.1/httpd.conf as a model, I matched the existing configuration and loaded modules, adding:
LoadModule mod_ldap modules/mod_ldap.so
LoadModule mod_authnz_ldap modules/mod_authnz_ldap.so
However, if I run apachectl start I get a syntax error:
/path/apache/httpd-2.4.4> ./bin/apachectl start
httpd: Syntax error on line 148 of /path/apache/httpd-2.4.4/conf/httpd.conf: Can't locate API module structure 'mod_ldap' in file /path/apache/httpd-2.4.4/modules/mod_ldap.so: /path/apache/httpd-2.4.4/modules/mod_ldap.so: undefined symbol: mod_ldap
Looking within the httpd-2.4.4/modules directory, the modules mod_ldap.so and mod_authnz.ldap.so are missing. I have tried the above steps without success. I have discovered that within the src/httpd-2.4.4 directory, the files ./modules/aaa/.libs/mod_authnz_ldap.so and ./modules/ldap/.libs/mod_ldap.so exist, but copying those over to httpd-2.4.4/modules does not alleviate the issue.
Can someone assist me in diagnosing the error in my steps? I know I'm missing something, but I have been unable to find it so far. I will also add any other required information if needed.
As configured above, LDAP is supported through a shared module. To enable the modules defined (including LDAP in my case) you need to configure apache with the --enable-so flag. This will generate the shared modules and place them within the modules directory when compiled/installed.
Additional reference can be found in this SO article: Compiling Apache Web Server with Dynamic Module Support

How to fix java IOException: Can't find resource 'solrconfig.xml' in classpath?

I was trying to install Apache Solr 4.0.0 with apache Tomcat, but it is giving an error like this:
SolrCore Initialization Failures
collection1: java.io.IOException:java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or 'solr\collection1\conf/', cwd=C:\apps\tomcat-solr\apache-tomcat-7.0.35\bin
There are no SolrCores running.
Using the Solr Admin UI currently requires at least one SolrCore.
After this I have installed apache solr 3.6.2 and it working perfectly well. I still cannot understand why i am not able to use solr 4.0.0 with the same server configuration.
I hope you will be able to tell me the mistake i have committed.
The directory structure changed in Solr 4.0. Have a look at the one in the example/solr directory. You will see that Solr 4 now has collection1 directory inside that and conf directory is now one level lower inside that. That's basically what the error message said.
If you don't like that, I think you can change it by putting solr.xml with the single core definition in it and directory paths setup the way you like it.