Tuesday, April 17, 2012

How to arrange windows across monitors and spaces (MAC)

If you are a mac user with more than one monitor and spaces  you may find frustrated some times when you arrange all your windows so nicely and you are scared or sad that when you unplug the second monitor everything will be lost...

Then, this post it's for you, I just gave a try to "Stay" and it works like a charm.

Check it out!

Stay:
http://cordlessdog.com/stay/

Wednesday, March 30, 2011

[WARN] org.apache.activemq.broker.TransportConnection - Unexpected extra broker info command received

If you have been using AMQ I'm pretty sure you have run into this problem.

Basically, it happens when you use network brokers with forwarding data policy.

Where AMQ1 is the producer and AMQ2 is the consumr, AMQ1 forwards data to AMQ2.

Architecture:

FE-AMQ will be considered AMQ1 and INBOUND AMQ will be AMQ2.

For example:
=== AMQ 1===


<networkConnectors>
<networkConnector uri="static:failover:(tcp://amq2:61616)?initialReconnectDelay=10000&amp;maxReconnectDelay=10000&amp;useExponentialBackOff=false" />
</networkConnectors>

In this case, AMQ1 forwards data to AMQ2.

When you bring both AMQ up for the first time you will see that AMQ1 shows:


INFO  DemandForwardingBridge         - Network connection between vm://amq-01#0 and tcp://amq2:61616(amq2-inboundBroker) has been established.

Which it's perfect, just what we want, now, if you restart AMQ2, sometimes you will get:

WARN  TransportConnection            - Unexpected extra broker info command received: BrokerInfo.


I have noticed that this behavior happens when using AMQ 5.3.2 or older versions, one of the solutions will be to upgrade to AMQ 5.4.2 and make brokerName and brokerId the same.

=== AMQ1 ===
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq1" brokerId="amq1" dataDirectory="${activemq.base}/data">

=== AMQ2 ===
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq2" brokerId="amq2" dataDirectory="${activemq.base}/data">

When you restart any of the AMQ the DemandForwardingBridge is successfully reconnected and you get rid of the WARN  TransportConnection message.

Monday, March 21, 2011

Downgrade/Upgrade Mac OS X maven version

If you recently upgrade your JVM using apples automatic upgrades, you might notice that other java dependencies were upgraded as well.

All of a sudden my MVN project stop working and it wasn't because of the JAVA upgrade to the JVM, it was because MVN it also got upgrade from 2.2.1 to 3.0.2.

Notes:
For this tutorial to work, you need to have a soft link shown in step 3.
If you have a directory, then follow this solution: http://www.gridshore.nl/2008/01/28/upgrading-maven-on-the-mac/

Follow this steps to downgrade:

1. Verify that you have the desired maven version here:
/usr/share/java


drwxr-xr-x   9 root  wheel  306 Jul 20  2009 apache-maven-2.0.9
drwxr-xr-x   9 root  wheel  306 May 21  2010 maven-2.2.0
drwxr-xr-x   9 root  wheel  306 Sep 21 14:10 maven-2.2.1
drwxr-xr-x   9 root  wheel  306 Mar 21 09:39 maven-3.0.2


2. If your version is there you will be fine, if it's not, then you will have to download and unzip/untar the version you want in this directory (http://maven.apache.org/download.html).

3. Now check that you have a soft link here pointing to maven.
/usr/share

It will look like this:
lrwxr-xr-x    1 root   wheel    16 Mar 21 10:16 maven -> java/maven-3.0.2

4. Now we will change to the desired version:
sudo rm maven
sudo ln -s java/maven-2.2.1 maven

5. Open a new terminal window and verify that the change was successful:
mvn -version


Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_24
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.6" arch: "x86_64" Family: "mac"

Enjoy.