Q:

Jetty Server Startup on Amazon Server gives RabbitMQ Error

I have a simple web application that send messages to RabbitMQ Server. I can able to execute this appliation on my local machine. But when I move the setup to Amazon Server it gives me following error at server startup:
Exception in thread "SimpleAsyncTaskExecutor-1" org.springframework.amqp.UncategorizedAmqpException: java.lang.NullPointerException
    at org.springframework.amqp.rabbit.support.RabbitUtils.convertRabbitAccessException(RabbitUtils.java:120)
    at org.springframework.amqp.rabbit.support.RabbitUtils.closeMessageConsumer(RabbitUtils.java:141)
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.stop(BlockingQueueConsumer.java:157)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.restart(SimpleMessageListenerContainer.java:345)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$600(SimpleMessageListenerContainer.java:49)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:431)
    at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NullPointerException
    at com.rabbitmq.client.impl.ValueWriter.writeShortstr(ValueWriter.java:48)
    at com.rabbitmq.client.impl.MethodArgumentWriter.writeShortstr(MethodArgumentWriter.java:76)
    at com.rabbitmq.client.impl.AMQImpl$Basic$Cancel.writeArgumentsTo(AMQImpl.java:2645)
    at com.rabbitmq.client.impl.Method.toFrame(Method.java:90)
    at com.rabbitmq.client.impl.AMQCommand.transmit(AMQCommand.java:168)
    at com.rabbitmq.client.impl.AMQChannel.quiescingTransmit(AMQChannel.java:301)
    at com.rabbitmq.client.impl.AMQChannel.quiescingTransmit(AMQChannel.java:283)
    at com.rabbitmq.client.impl.AMQChannel.quiescingRpc(AMQChannel.java:218)
    at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:209)
    at com.rabbitmq.client.impl.ChannelN.basicCancel(ChannelN.java:815)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:223)
    at $Proxy18.basicCancel(Unknown Source)
    at org.springframework.amqp.rabbit.support.RabbitUtils.closeMessageConsumer(RabbitUtils.java:128)
    ... 5 more

RabbitMQ, Erlang, Jetty server are properly configured on Amazon Server. I have also enabled ports 8088, 5672 on Server (don't know if this error is related to ports or what). Can anyone please guide me what problem can cause this error.

A:

This error is because there is no queue defined in mnesia. The queue folder under mnesia folder is not on Amazon server.
The project is working on local machine because may be when I was developing my project, the queue persist in mnesia with some code that I have removed later. When I execute the code on local machine it always find the persist queue and doesn't give errors. When I change the queue name on local machine it starts giving me the same error.
So I found that I was not declaring the queue before using it. So I add following line in my Spring configuration file:
<rabbit:queue name="myQueue"/>

After that the projects works fine on both local and amazon machines.

