You probably closed some of the Objects you're using...
You probably closed the connection, the Session or the Producer itself.
When you close the Connection, the whole hierarchy of objects will be also created. For example,
If you do this:
Connection a = .... create the connection.
Session b = ... a.createSession....
MessageProducer c = b.createProducer...
when you do a.close();
both b and c will be closed after this call.