Index: /trunk/objectmq/src/omq/client/proxy/Proxymq.java
===================================================================
--- /trunk/objectmq/src/omq/client/proxy/Proxymq.java	(revision 37)
+++ /trunk/objectmq/src/omq/client/proxy/Proxymq.java	(revision 38)
@@ -24,4 +24,5 @@
 import omq.common.util.Serializer;
 import omq.exception.NoContainsInstanceException;
+import omq.exception.OmqException;
 import omq.exception.RetryException;
 import omq.exception.SerializerException;
@@ -234,4 +235,11 @@
 		}
 
+		if (resp.getError() != null) {
+			OmqException error = resp.getError();
+			String name = error.getType();System.out.println("Name: "+name);
+			String message = error.getMessage();
+			throw (Exception) Class.forName(name).getConstructor(String.class).newInstance(message);
+		}
+
 		return resp.getResult();
 	}
Index: /trunk/objectmq/src/omq/common/broker/Broker.java
===================================================================
--- /trunk/objectmq/src/omq/common/broker/Broker.java	(revision 37)
+++ /trunk/objectmq/src/omq/common/broker/Broker.java	(revision 38)
@@ -196,5 +196,4 @@
 	 */
 	public static void tryConnection(Properties env) throws Exception {
-		System.out.println("hola");
 		Channel channel = connection.createChannel();
 		String message = "ping";
@@ -221,5 +220,5 @@
 
 		if (!message.equalsIgnoreCase(new String(delivery.getBody()))) {
-			throw new IOException("Ping-pong initialitzation has failed");
+			throw new IOException("Ping initialitzation has failed");
 		}
 	}
Index: /trunk/objectmq/src/omq/common/message/Request.java
===================================================================
--- /trunk/objectmq/src/omq/common/message/Request.java	(revision 37)
+++ /trunk/objectmq/src/omq/common/message/Request.java	(revision 38)
@@ -10,8 +10,8 @@
 	private static final long serialVersionUID = 6366255840200365083L;
 
+	private String method;
+	private Object[] params;
 	private String id;
-	private String method;
 	private boolean async = false;
-	private Object[] arguments;
 
 	private transient long timeout;
@@ -21,23 +21,23 @@
 	}
 
-	public Request(String id, String method, Object[] arguments) {
+	public Request(String id, String method, Object[] params) {
 		this.id = id;
 		this.method = method;
-		this.arguments = arguments;
+		this.params = params;
 	}
 
-	private Request(String id, String method, boolean async, Object[] arguments) {
+	private Request(String id, String method, boolean async, Object[] params) {
 		this.id = id;
 		this.method = method;
 		this.async = async;
-		this.arguments = arguments;
+		this.params = params;
 	}
 
-	public static Request newSyncRequest(String id, String method, Object[] arguments) {
-		return new Request(id, method, false, arguments);
+	public static Request newSyncRequest(String id, String method, Object[] params) {
+		return new Request(id, method, false, params);
 	}
 
-	public static Request newSyncRequest(String id, String method, Object[] arguments, int retries, long timeout) {
-		Request req = new Request(id, method, false, arguments);
+	public static Request newSyncRequest(String id, String method, Object[] params, int retries, long timeout) {
+		Request req = new Request(id, method, false, params);
 		req.setRetries(retries);
 		req.setTimeout(timeout);
@@ -45,6 +45,6 @@
 	}
 
-	public static Request newAsyncRequest(String id, String method, Object[] arguments) {
-		return new Request(id, method, true, arguments);
+	public static Request newAsyncRequest(String id, String method, Object[] params) {
+		return new Request(id, method, true, params);
 	}
 
@@ -65,10 +65,10 @@
 	}
 
-	public Object[] getArguments() {
-		return arguments;
+	public Object[] getParams() {
+		return params;
 	}
 
-	public void setArguments(Object[] arguments) {
-		this.arguments = arguments;
+	public void setParams(Object[] params) {
+		this.params = params;
 	}
 
Index: /trunk/objectmq/src/omq/common/message/Response.java
===================================================================
--- /trunk/objectmq/src/omq/common/message/Response.java	(revision 37)
+++ /trunk/objectmq/src/omq/common/message/Response.java	(revision 38)
@@ -2,4 +2,6 @@
 
 import java.io.Serializable;
+
+import omq.exception.OmqException;
 
 public class Response implements Serializable {
@@ -10,15 +12,17 @@
 	private static final long serialVersionUID = 3368363997012527189L;
 
+	private Object result;
+	private OmqException error;
 	private String id;
 	private String idOmq;
-	private Object result;
 
 	public Response() {
 	}
 
-	public Response(String id, String idOmq, Object result) {
+	public Response(String id, String idOmq, Object result, OmqException error) {
 		this.id = id;
 		this.idOmq = idOmq;
 		this.result = result;
+		this.error = error;
 	}
 
@@ -47,3 +51,11 @@
 	}
 
+	public OmqException getError() {
+		return error;
+	}
+
+	public void setError(OmqException error) {
+		this.error = error;
+	}
+
 }
Index: /trunk/objectmq/src/omq/common/util/Serializers/GsonImp.java
===================================================================
--- /trunk/objectmq/src/omq/common/util/Serializers/GsonImp.java	(revision 37)
+++ /trunk/objectmq/src/omq/common/util/Serializers/GsonImp.java	(revision 38)
@@ -6,4 +6,5 @@
 import omq.common.message.Request;
 import omq.common.message.Response;
+import omq.exception.OmqException;
 import omq.exception.SerializerException;
 import omq.server.RemoteObject;
@@ -69,5 +70,8 @@
 		Object result = gson.fromJson(jsonElement, type);
 
-		return new Response(id, idOmq, result);
+		JsonElement jsonError = jsonObj.get("error");
+		OmqException error = gson.fromJson(jsonError, OmqException.class);
+
+		return new Response(id, idOmq, result, error);
 	}
 
@@ -77,5 +81,5 @@
 			String json = new String(bytes);
 			System.out.println(json);
-			
+
 			JsonParser parser = new JsonParser();
 			JsonObject jsonObj = parser.parse(json).getAsJsonObject();
Index: /trunk/objectmq/src/omq/exception/OmqException.java
===================================================================
--- /trunk/objectmq/src/omq/exception/OmqException.java	(revision 38)
+++ /trunk/objectmq/src/omq/exception/OmqException.java	(revision 38)
@@ -0,0 +1,38 @@
+package omq.exception;
+
+import java.io.Serializable;
+
+public class OmqException implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private String type;
+	private String message;
+
+	public OmqException() {
+	}
+
+	public OmqException(String type, String message) {
+		this.type = type;
+		this.message = message;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+}
Index: /trunk/objectmq/src/omq/server/InvocationThread.java
===================================================================
--- /trunk/objectmq/src/omq/server/InvocationThread.java	(revision 37)
+++ /trunk/objectmq/src/omq/server/InvocationThread.java	(revision 38)
@@ -1,4 +1,5 @@
 package omq.server;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.BlockingQueue;
 
@@ -6,4 +7,5 @@
 import omq.common.message.Response;
 import omq.common.util.Serializer;
+import omq.exception.OmqException;
 
 import com.rabbitmq.client.AMQP.BasicProperties;
@@ -35,5 +37,5 @@
 				// Deserialize the json
 				Request request = Serializer.deserializeRequest(delivery.getBody(), obj);
-				//Log.saveLog("Server-Deserialize", delivery.getBody());
+				// Log.saveLog("Server-Deserialize", delivery.getBody());
 
 				String methodName = request.getMethod();
@@ -42,10 +44,19 @@
 				System.out.println("Invoke method: " + methodName + " CorrID: " + requestID);
 
-				 // Invoke the method
-				 Object result = obj.invokeMethod(request.getMethod(),
-				 request.getArguments());
+				// Invoke the method
+				Object result = null;
+				OmqException error = null;
+				try {
+					result = obj.invokeMethod(request.getMethod(), request.getParams());
+				} catch (InvocationTargetException e) {
+					Throwable throwable = e.getTargetException();
+					error = new OmqException(throwable.getClass().getCanonicalName(), throwable.getMessage());
+				} catch (NoSuchMethodException e) {
+					error = new OmqException(e.getClass().getCanonicalName(), e.getMessage());
+				}
 
+				// Reply if it's necessary
 				if (!request.isAsync()) {
-					Response resp = new Response(request.getId(), obj.getRef(), result);
+					Response resp = new Response(request.getId(), obj.getRef(), result, error);
 
 					Channel channel = obj.getChannel();
@@ -58,5 +69,5 @@
 					channel.basicPublish("", props.getReplyTo(), replyProps, bytesResponse);
 
-					//Log.saveLog("Server-Serialize", bytesResponse);
+					// Log.saveLog("Server-Serialize", bytesResponse);
 				}
 
@@ -69,5 +80,6 @@
 			}
 
-		}System.out.println("Invocation Thread dies!!");
+		}
+		System.out.println("Invocation Thread dies!!");
 	}
 
Index: /trunk/objectmq/src/omq/server/RemoteObject.java
===================================================================
--- /trunk/objectmq/src/omq/server/RemoteObject.java	(revision 37)
+++ /trunk/objectmq/src/omq/server/RemoteObject.java	(revision 38)
@@ -166,29 +166,31 @@
 
 	private Method loadMethodWithPrimitives(String methodName, Class<?>[] argArray) throws NoSuchMethodException {
-		Method[] methods = this.getClass().getMethods();
-		int length = argArray.length;
-
-		for (Method method : methods) {
-			String name = method.getName();
-			int argsLength = method.getParameterTypes().length;
-
-			if (name.equals(methodName) && length == argsLength) {
-				// This array can have primitive types inside
-				Class<?>[] params = method.getParameterTypes();
-
-				boolean found = true;
-
-				for (int i = 0; i < length; i++) {
-					if (params[i].isPrimitive()) {
-						Class<?> paramWrapper = primitiveClasses.get(params[i].getName());
-
-						if (!paramWrapper.equals(argArray[i])) {
-							found = false;
-							break;
+		if (argArray != null) {
+			Method[] methods = this.getClass().getMethods();
+			int length = argArray.length;
+
+			for (Method method : methods) {
+				String name = method.getName();
+				int argsLength = method.getParameterTypes().length;
+
+				if (name.equals(methodName) && length == argsLength) {
+					// This array can have primitive types inside
+					Class<?>[] params = method.getParameterTypes();
+
+					boolean found = true;
+
+					for (int i = 0; i < length; i++) {
+						if (params[i].isPrimitive()) {
+							Class<?> paramWrapper = primitiveClasses.get(params[i].getName());
+
+							if (!paramWrapper.equals(argArray[i])) {
+								found = false;
+								break;
+							}
 						}
 					}
-				}
-				if (found) {
-					return method;
+					if (found) {
+						return method;
+					}
 				}
 			}
Index: /trunk/objectmq/test/calculatorTest/Calculator.java
===================================================================
--- /trunk/objectmq/test/calculatorTest/Calculator.java	(revision 37)
+++ /trunk/objectmq/test/calculatorTest/Calculator.java	(revision 38)
@@ -21,5 +21,8 @@
 
 	@AsyncMethod
-	public void divideByZero() throws IOException, SerializerException;
+	public void asyncDivideByZero() throws IOException, SerializerException;
+
+	@SyncMethod
+	public int divideByZero();
 
 }
Index: /trunk/objectmq/test/calculatorTest/CalculatorImpl.java
===================================================================
--- /trunk/objectmq/test/calculatorTest/CalculatorImpl.java	(revision 37)
+++ /trunk/objectmq/test/calculatorTest/CalculatorImpl.java	(revision 38)
@@ -3,5 +3,4 @@
 import java.io.IOException;
 
-import omq.client.annotation.AsyncMethod;
 import omq.common.broker.Broker;
 import omq.exception.SerializerException;
@@ -17,8 +16,10 @@
 	private static final long serialVersionUID = 1L;
 
+	@Override
 	public int add(int x, int y) {
 		return x + y;
 	}
 
+	@Override
 	public void mult(int x, int y) {
 		mult = x * y;
@@ -33,5 +34,6 @@
 	}
 
-	public void divideByZero() throws IOException, SerializerException {
+	@Override
+	public void asyncDivideByZero() throws IOException, SerializerException {
 		ZeroEvent ze = new ZeroEvent("my zero event", "zero-event");
 		Broker.trigger(ze);
@@ -40,11 +42,14 @@
 
 	@Override
-	@AsyncMethod
 	public void sendMessage(Message m) {
 		System.out.println("Code = "+m.getCode());
 		System.out.println("Message = "+m.getMessage());
 	}
-	
-	
+
+	@Override
+	public int divideByZero() {
+		int x = 2 / 0;
+		return x;
+	}
 
 }
Index: /trunk/objectmq/test/calculatorTest/ClientTest.java
===================================================================
--- /trunk/objectmq/test/calculatorTest/ClientTest.java	(revision 37)
+++ /trunk/objectmq/test/calculatorTest/ClientTest.java	(revision 38)
@@ -26,5 +26,5 @@
 		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
 		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
-		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.kryo);
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
 		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
 
@@ -80,5 +80,5 @@
 		remoteCalc.addListener(zL);
 
-		remoteCalc.divideByZero();
+		remoteCalc.asyncDivideByZero();
 
 		Thread.sleep(200);
@@ -90,3 +90,8 @@
 		remoteCalc.sendMessage(m);
 	}
+
+	@Test(expected = ArithmeticException.class)
+	public void divideByZero() {
+		remoteCalc.divideByZero();
+	}
 }
Index: /trunk/objectmq/test/calculatorTest/ServerTest.java
===================================================================
--- /trunk/objectmq/test/calculatorTest/ServerTest.java	(revision 37)
+++ /trunk/objectmq/test/calculatorTest/ServerTest.java	(revision 38)
@@ -20,5 +20,5 @@
 		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
 		env.setProperty(ParameterQueue.DURABLE_QUEUES, "true");
-		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.kryo);
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
 		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
 
Index: /trunk/objectmq/test/exceptionTest/ClientInterface.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/ClientInterface.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/ClientInterface.java	(revision 38)
@@ -0,0 +1,33 @@
+package exceptionTest;
+
+import omq.Remote;
+import omq.client.annotation.AsyncMethod;
+import omq.client.annotation.RemoteInterface;
+import omq.client.annotation.SyncMethod;
+
+@RemoteInterface
+public interface ClientInterface extends Remote {
+	@AsyncMethod
+	public void addWheels(int numWheels);
+
+	@AsyncMethod
+	public void addHp(int hp);
+
+	@AsyncMethod
+	public void addTrailer(Trailer t);
+
+	@AsyncMethod
+	public void setPrice(double price);
+
+	@SyncMethod(timeout = 1000)
+	public Trailer getTrailer();
+
+	@SyncMethod(timeout = 1000)
+	public int getHp();
+
+	@SyncMethod(timeout = 1000)
+	public int getWheels();
+
+	@SyncMethod(timeout = 1000)
+	public double getPrice();
+}
Index: /trunk/objectmq/test/exceptionTest/ClientTest.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/ClientTest.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/ClientTest.java	(revision 38)
@@ -0,0 +1,85 @@
+package exceptionTest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ClientTest {
+	private static ClientInterface client;
+
+	@BeforeClass
+	public static void startClient() throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Set host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+
+		// Set info about the queue & the exchange where the ResponseListener
+		// will listen to.
+		env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, "reply_queue");
+		env.setProperty(ParameterQueue.EVENT_REPLY_QUEUE, "event_queue");
+
+		Broker.initBroker(env);
+		client = (ClientInterface) Broker.lookup("server", ClientInterface.class);
+	}
+
+	@Test
+	public void addWheels() throws Exception {
+		int wheels = 4;
+		client.addWheels(wheels);
+		Thread.sleep(200);
+		int result = client.getWheels();
+
+		assertEquals(wheels, result);
+	}
+
+	@Test
+	public void addHp() throws Exception {
+		int hp = 200;
+		client.addHp(hp);
+		Thread.sleep(200);
+		int result = client.getHp();
+
+		assertEquals(hp, result);
+	}
+
+	@Test
+	public void addTrailer() throws Exception {
+		Trailer t = new Trailer(1200);
+		client.addTrailer(t);
+		Thread.sleep(200);
+	}
+
+	@Test(expected = NoSuchMethodException.class)
+	public void getTrailer() throws Exception {
+		client.getTrailer();
+	}
+
+	@Test
+	public void setPrice() throws Exception {
+		double price = 4999.99;
+		client.setPrice(price);
+		Thread.sleep(200);
+	}
+
+	@Test(expected = ClassCastException.class)
+	public void getPrice() throws Exception {
+		client.getPrice();
+	}
+}
Index: /trunk/objectmq/test/exceptionTest/OmqServerImpl.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/OmqServerImpl.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/OmqServerImpl.java	(revision 38)
@@ -0,0 +1,44 @@
+package exceptionTest;
+
+import omq.server.RemoteObject;
+
+public class OmqServerImpl extends RemoteObject implements ServerInterface {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private int numWheels;
+	private int hp;
+	private int price;
+
+	@Override
+	public void addWheels(int numWheels) {
+		this.numWheels = numWheels;
+	}
+
+	@Override
+	public void addHp(int hp) {
+		this.hp = hp;
+	}
+
+	@Override
+	public int getHp() {
+		return hp;
+	}
+
+	@Override
+	public int getWheels() {
+		return numWheels;
+	}
+
+	@Override
+	public void setPrice(int price) {
+		this.price = price;
+	}
+
+	@Override
+	public int getPrice() {
+		return price;
+	}
+
+}
Index: /trunk/objectmq/test/exceptionTest/ServerInterface.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/ServerInterface.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/ServerInterface.java	(revision 38)
@@ -0,0 +1,17 @@
+package exceptionTest;
+
+import omq.Remote;
+
+public interface ServerInterface extends Remote {
+	public void addWheels(int numWheels);
+
+	public void addHp(int hp);
+
+	public int getHp();
+
+	public int getWheels();
+
+	public void setPrice(int price);
+
+	public int getPrice();
+}
Index: /trunk/objectmq/test/exceptionTest/ServerTest.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/ServerTest.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/ServerTest.java	(revision 38)
@@ -0,0 +1,32 @@
+package exceptionTest;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+public class ServerTest {
+
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "true");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		OmqServerImpl server = new OmqServerImpl();
+
+		Broker.initBroker(env);
+		Broker.bind("server", server);
+	}
+}
Index: /trunk/objectmq/test/exceptionTest/Trailer.java
===================================================================
--- /trunk/objectmq/test/exceptionTest/Trailer.java	(revision 38)
+++ /trunk/objectmq/test/exceptionTest/Trailer.java	(revision 38)
@@ -0,0 +1,34 @@
+package exceptionTest;
+
+import java.io.Serializable;
+
+public class Trailer implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private int kg;
+
+	public Trailer(int kg) {
+		this.kg = kg;
+	}
+
+	public int getKg() {
+		return kg;
+	}
+
+	public void setKg(int kg) {
+		this.kg = kg;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (obj instanceof Trailer) {
+			Trailer t = (Trailer) obj;
+			return kg == t.getKg();
+		}
+		return false;
+	}
+}
