You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Wayne1285 <Wa...@hotmail.com> on 2006/04/03 08:20:25 UTC

EOFException

I am using ActiveMQ 4.0-RC1, persisitng to MySQL 5.0  running Java 1.5

I have opened a connection to a Broker on a server from a client and created
a session.  The connection registers in the JMX browser on the server.  When
I try to send a simple text message, I receive an EOFException.  I have
tested this with a Broker on the client and it works fine.

Here is a portion of the log
========================================
DEBUG  JmsCommunicator.connect() session=ActiveMQSession
{id=ID:irwin-3800-3505-1144043685484-1:0:1,started=false} -- 12:54:46.125
 DEBUG  JmsCommunicator.sendMessage() message=ActiveMQTextMessage {commandId
= 0, responseRequired = false, messageId = null, originalDestination = null,
originalTransactionId = null, producerId = null, destination = null,
transactionId = null, expiration = 0, timestamp = 0, arrival = 0,
correlationId = null, replyTo = null, persistent = false, type = null,
priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null,
compressed = false, userID = null, content = null, marshalledProperties =
null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
null, readOnlyProperties = false, readOnlyBody = false, text = Message 1} --
12:54:46.140
 DEBUG  JmsCommunicator.getMessageSender()
destination=queue://playerActivity -- 12:54:46.140
 DEBUG  JmsCommunicator.getMessageSender() sender=ActiveMQMessageProducer {
value=ID:irwin-3800-3505-1144043685484-1:0:1:1 } -- 12:54:46.156
 DEBUG  Sending message: ActiveMQTextMessage {commandId = 0,
responseRequired = false, messageId =
ID:irwin-3800-3505-1144043685484-1:0:1:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:irwin-3800-3505-1144043685484-1:0:1:1, destination =
queue://playerActivity, transactionId =
TX:ID:irwin-3800-3505-1144043685484-1:0:1, expiration = 0, timestamp =
1144043686156, arrival = 0, correlationId = null, replyTo = null, persistent
= true, type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true,
text = Message 1} -- 12:54:46.156
 ERROR  JmsCommunicator.onException() javax.jms.JMSException:
java.io.EOFException-java.io.EOFException - java.io.EOFException --
12:54:47.171
  WARN  JmsCommunicator.disconnectFromJMSServer() Did not close up-loader
cleanly. javax.jms.JMSException: Cannot write to the stream any more it has
already been closed -- 12:54:47.171
  WARN  JmsCommunicator.disconnectFromJMSServer() Did not close session
cleanly. javax.jms.JMSException: Cannot write to the stream any more it has
already been closed -- 12:54:47.171
  WARN  JmsCommunicator.disconnectFromJMSServer() Did not close connection
cleanly. javax.jms.JMSException: Cannot write to the stream any more it has
already been closed -- 12:54:47.171
==============================================

Here is the relevant code
==============================================
    public void sendMessage(String _message) throws CommunicatorException {

        if (m_session == null) {
            throw new IllegalStateException(
                    "Connection not established.  Call connect() before
sendMessage()");
        }

        String tryingTo = "";
        try {
            tryingTo = "prepare the content for sending";
            TextMessage message = m_session.createTextMessage(_message);
            s_logger.debug("JmsCommunicator.sendMessage() message=" +
message);

            tryingTo = "send the content";
            getMessageSender().send(message);
            m_session.commit();
            s_logger.debug("JmsCommunicator.sendMessage() Sent message. '" +
message.getText()
                    + "'");
            m_sentCount++;

        } catch (JMSException e) {
            throw new CommunicatorException("Could not sendMessage. Trying
to " + tryingTo + ". "
                    + e);
        }
    }

    protected MessageProducer getMessageSender() throws
CommunicatorException {
        // If already setup, just return it.
        if (m_messageSender != null) {
            return m_messageSender;
        }

        if (m_session == null) {
            throw new IllegalStateException(
                    "Connection not established.  Call connect() before
getMessageSender()");
        }

        // Create a new message sender.
        String tryingTo = "";
        try {
            tryingTo = "create queue " + getSendQueueName();
            Destination destination =
m_session.createQueue(getSendQueueName());
            s_logger.debug("JmsCommunicator.getMessageSender() destination="
+ destination);

            m_messageSender = m_session.createProducer(destination);
            m_messageSender.setDeliveryMode(DeliveryMode.PERSISTENT);
            s_logger.debug("JmsCommunicator.getMessageSender() sender=" +
m_messageSender);
            return m_messageSender;
        } catch (JMSException e) {
            throw new CommunicatorException("Could not getMessageSender().
Trying to " + tryingTo
                    + ".", e);
        }
    }
=================================================


--
View this message in context: http://www.nabble.com/EOFException-t1385203.html#a3720526
Sent from the ActiveMQ - User forum at Nabble.com.


Re: EOFException

Posted by James Strachan <ja...@gmail.com>.
I've no idea really. Is there a long delay between creating the connection
and using it? Other than that I've no idea. Maybe turning on debug logging
on the broker then sending us the log?

On 4/3/06, Wayne1285 <Wa...@hotmail.com> wrote:
>
>
> I am using ActiveMQ 4.0-RC1, persisitng to MySQL 5.0  running Java 1.5
>
> I have opened a connection to a Broker on a server from a client and
> created
> a session.  The connection registers in the JMX browser on the
> server.  When
> I try to send a simple text message, I receive an EOFException.  I have
> tested this with a Broker on the client and it works fine.
>
> Here is a portion of the log
> ========================================
> DEBUG  JmsCommunicator.connect() session=ActiveMQSession
> {id=ID:irwin-3800-3505-1144043685484-1:0:1,started=false} -- 12:54:46.125
> DEBUG  JmsCommunicator.sendMessage() message=ActiveMQTextMessage
> {commandId
> = 0, responseRequired = false, messageId = null, originalDestination =
> null,
> originalTransactionId = null, producerId = null, destination = null,
> transactionId = null, expiration = 0, timestamp = 0, arrival = 0,
> correlationId = null, replyTo = null, persistent = false, type = null,
> priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null,
> compressed = false, userID = null, content = null, marshalledProperties =
> null, dataStructure = null, redeliveryCounter = 0, size = 0, properties =
> null, readOnlyProperties = false, readOnlyBody = false, text = Message 1}
> --
> 12:54:46.140
> DEBUG  JmsCommunicator.getMessageSender()
> destination=queue://playerActivity -- 12:54:46.140
> DEBUG  JmsCommunicator.getMessageSender() sender=ActiveMQMessageProducer {
> value=ID:irwin-3800-3505-1144043685484-1:0:1:1 } -- 12:54:46.156
> DEBUG  Sending message: ActiveMQTextMessage {commandId = 0,
> responseRequired = false, messageId =
> ID:irwin-3800-3505-1144043685484-1:0:1:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:irwin-3800-3505-1144043685484-1:0:1:1, destination =
> queue://playerActivity, transactionId =
> TX:ID:irwin-3800-3505-1144043685484-1:0:1, expiration = 0, timestamp =
> 1144043686156, arrival = 0, correlationId = null, replyTo = null,
> persistent
> = true, type = null, priority = 4, groupID = null, groupSequence = 0,
> targetConsumerId = null, compressed = false, userID = null, content =
> null,
> marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
> size = 0, properties = null, readOnlyProperties = true, readOnlyBody =
> true,
> text = Message 1} -- 12:54:46.156
> ERROR  JmsCommunicator.onException() javax.jms.JMSException:
> java.io.EOFException-java.io.EOFException - java.io.EOFException --
> 12:54:47.171
>   WARN  JmsCommunicator.disconnectFromJMSServer() Did not close up-loader
> cleanly. javax.jms.JMSException: Cannot write to the stream any more it
> has
> already been closed -- 12:54:47.171
>   WARN  JmsCommunicator.disconnectFromJMSServer() Did not close session
> cleanly. javax.jms.JMSException: Cannot write to the stream any more it
> has
> already been closed -- 12:54:47.171
>   WARN  JmsCommunicator.disconnectFromJMSServer() Did not close connection
> cleanly. javax.jms.JMSException: Cannot write to the stream any more it
> has
> already been closed -- 12:54:47.171
> ==============================================
>
> Here is the relevant code
> ==============================================
>     public void sendMessage(String _message) throws CommunicatorException
> {
>
>         if (m_session == null) {
>             throw new IllegalStateException(
>                     "Connection not established.  Call connect() before
> sendMessage()");
>         }
>
>         String tryingTo = "";
>         try {
>             tryingTo = "prepare the content for sending";
>             TextMessage message = m_session.createTextMessage(_message);
>             s_logger.debug("JmsCommunicator.sendMessage() message=" +
> message);
>
>             tryingTo = "send the content";
>             getMessageSender().send(message);
>             m_session.commit();
>             s_logger.debug("JmsCommunicator.sendMessage() Sent message. '"
> +
> message.getText()
>                     + "'");
>             m_sentCount++;
>
>         } catch (JMSException e) {
>             throw new CommunicatorException("Could not sendMessage. Trying
> to " + tryingTo + ". "
>                     + e);
>         }
>     }
>
>     protected MessageProducer getMessageSender() throws
> CommunicatorException {
>         // If already setup, just return it.
>         if (m_messageSender != null) {
>             return m_messageSender;
>         }
>
>         if (m_session == null) {
>             throw new IllegalStateException(
>                     "Connection not established.  Call connect() before
> getMessageSender()");
>         }
>
>         // Create a new message sender.
>         String tryingTo = "";
>         try {
>             tryingTo = "create queue " + getSendQueueName();
>             Destination destination =
> m_session.createQueue(getSendQueueName());
>             s_logger.debug("JmsCommunicator.getMessageSender()
> destination="
> + destination);
>
>             m_messageSender = m_session.createProducer(destination);
>             m_messageSender.setDeliveryMode(DeliveryMode.PERSISTENT);
>             s_logger.debug("JmsCommunicator.getMessageSender() sender=" +
> m_messageSender);
>             return m_messageSender;
>         } catch (JMSException e) {
>             throw new CommunicatorException("Could not getMessageSender().
> Trying to " + tryingTo
>                     + ".", e);
>         }
>     }
> =================================================
>
>
> --
> View this message in context:
> http://www.nabble.com/EOFException-t1385203.html#a3720526
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/