Category Archives: Uncategorized

Add charles certificate to JVM

This is an example how to do that on a Mac:

sudo keytool -import -noprompt -alias charles-$(date +%Y%m%d%H%M%S) -file "Downloads/charles-ssl-proxying-certificate.pem" -keystore "/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/lib/security/cacerts" -storepass changeit


JBoss show JDBC Queries

Sometimes it is necessary to see which queries are executed and what the parameters of these queries have been. To get this data from a JBoss 7+ you have to follow these steps:

Enable JDBC-Spy on Datasource:


Or just add spy=”true” as attribute in standalone.xml.

Then you have to enable the spy by adding a loglevel:


If this doesn’t output anything your loglevel is above trace. Default is INFO. So nothing is displayed.

Add the following part to your logging configuration to enable TRACE-logging for a single package:

<subsystem xmlns="urn:jboss:domain:logging:2.0">
<console-handler name="TRACER">
  <level name="TRACE"/>
    <named-formatter name="COLOR-PATTERN"/>
<logger category="jboss.jdbc.spy" use-parent-handlers="false">
  <level name="TRACE"/>
    <handler name="TRACER"/>

I didn’t use command line for this but of course it would be possible to do so.

Java 8 Support in Eclipse Kepler 4.3.2 (SR2)

Java 8 released and the actual Eclipse version doesn’t support it out of the box. I found an official patch that adds this support to the actual version of Kepler SR2. Here is the update site:

Here the official JDT page that led me to this page:

Be sure to read the instructions as this patch is for Eclipse 4.3.2 only and is not intended to be used with other versions.

There is still a problem that there faceted projects doesn’t support 1.8 yet. I’ll update this post as soon as I find a working solution for 4.3.2. If there is no update I changed to 4.4 build ;-)

EDIT: Also no success with Luna (4.4) M6

ActiveMQ with JBoss 7.2.0.Alpha1 / EAP 6.1.0.Alpha1

Update 26.8.2013:

Described steps also work with Wildfly Alpha 4. Tested the described configuration with urn:jboss:domain:resource-adapters:1.1 + mdb part in the standalone.xml and the latest rar.


Working with an external ActiveMQ broker has become quite easy since my last attempts in the beginning of JBoss AS7. Here a short howto how to get it running in a few minutes – most of the steps are the same as already described under my former posting:

  1. Downloaded the latest release of the activemq.rar (.rar is – as .jar – a simple .zip file)
  2. Unzip the file and name the resulting folder activemq.rar
  3. Place this folder in the deployments directory of your JBoss AS
  4. Download ironjacamar.xml and place it into the META-INF folder of the activemq.rar folder
  5. Customize the existing ra.xml file if you don’t run activemq with default configuration on the same host
  6. Customize the ironjacamar.xml file as needed as queues and topics are configured here
  7. Edit the standalone.xml and add the following under urn:jboss:domain:ejb3:1.4. This change requires a restart (you could use the cli, I think…):
      <resource-adapter-ref resource-adapter-name="activemq.rar" />
      <bean-instance-pool-ref pool-name="mdb-strict-max-pool" />
  8. Create an empty file called activemq.rar.dodeploy

After these steps you should be able to deploy an application using MDB connected to ActiveMQ:

 * 2013 (c)

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.jboss.logging.Logger;

 * Class RemoteActiveMqListener demonstrating mdb with activemq.
 * @author manuel
@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType",
				propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination",
				propertyValue = "activemq/queue/TestQueue") })
public class RemoteActiveMqListener implements MessageListener {

	private static final Logger LOG = Logger

	 * (non-Javadoc)
	 * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
	public void onMessage(final Message msg) {
		LOG.debugf("received message: %s", msg);




instead of extracting the .rar file and customizing it, you can also configure the ressource  adapter in your standalone.xml file. To get the same configuration as before without any modification of the .rar file, simply add the following under urn:jboss:domain:resource-adapters:1.1 and deploy the original .rar file named activemq.rar:

	<resource-adapter id="activemq.rar">
		<config-property name="UseInboundSession">
		<config-property name="Password">
		<config-property name="UserName">
		<config-property name="ServerUrl">
				jndi-name="java:jboss/exported/ConnectionFactory" enabled="true"
				use-java-context="true" pool-name="ConnectionFactory" />
			<admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
				jndi-name="java:jboss/activemq/queue/TestQueue" use-java-context="true"
				<config-property name="PhysicalName">
			<admin-object class-name="org.apache.activemq.command.ActiveMQTopic"
				jndi-name="java:jboss/activemq/topic/TestTopic" use-java-context="true"
				<config-property name="PhysicalName">

Database problems after wordpress upgrade

I have to apologize that the blog was unusable the last few hours. I upgraded to the latest wordpress version and afterwards I wasn’t possible to create or edit posts anymore. So I decided to export and reimport all content and install wordpress from scratch. I don’t know exactly what the problem was but I lost all comments and some content of the posts. Sorry for that!