When it reports that the connection has failed, and this is all on the same machine, same JVM, does that mean that it's connecting properly, or, rather, that activeMQ isn't properly configured? I realize some of that might be in the eye of the beholder, but..

thufir@doge:~$
thufir@doge:~$
thufir@doge:~$ apache-activemq-5.11.1/bin/activemq status
INFO: Loading '/home/thufir/apache-activemq-5.11.1/bin/env'
INFO: Using java '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'
ActiveMQ not running
thufir@doge:~$
thufir@doge:~$ apache-activemq-5.11.1/bin/activemq start
INFO: Loading '/home/thufir/apache-activemq-5.11.1/bin/env'
INFO: Using java '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details INFO: pidfile created : '/home/thufir/apache-activemq-5.11.1/data/activemq.pid' (pid '13035')
thufir@doge:~$
thufir@doge:~$ apache-activemq-5.11.1/bin/activemq status
INFO: Loading '/home/thufir/apache-activemq-5.11.1/bin/env'
INFO: Using java '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'
ActiveMQ is running (pid '13035')
thufir@doge:~$
thufir@doge:~$ groovy IdeaProjects/groovy/src/hi.groovy
Caught: org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException org.apache.activemq.ConnectionFailedException: The JMS connection has failed: java.io.EOFException at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1480) at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:523)
    at net.sf.gtools.jms.JmsCategory.connect(JmsCategory.groovy:64)
    at GroovyJMSExample$_sendMessage_closure1.doCall(hi.groovy:21)
    at GroovyJMSExample$_sendMessage_closure1.doCall(hi.groovy)
    at GroovyJMSExample.sendMessage(hi.groovy:19)
    at GroovyJMSExample.main(hi.groovy:31)
Caused by: java.io.EOFException
at org.apache.activemq.openwire.v10.BaseDataStreamMarshaller.looseUnmarshalConstByteArray(BaseDataStreamMarshaller.java:602) at org.apache.activemq.openwire.v10.WireFormatInfoMarshaller.looseUnmarshal(WireFormatInfoMarshaller.java:130) at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:373) at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:285) at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:221) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:213) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
thufir@doge:~$
thufir@doge:~$
thufir@doge:~$ cat IdeaProjects/groovy/src/hi.groovy
@Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
@Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
@Grab(group = "junit", module = "junit", version = "4.11")
@Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
@Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
@Grab(group = "junit", module = "junit", version = "4.11")
import net.sf.gtools.jms.JmsCategory
@Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
@Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
@Grab(group = "junit", module = "junit", version = "4.11")
@Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
@Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
@Grab(group = "junit", module = "junit", version = "4.11")
import net.sf.gtools.jms.JmsCategory
import org.apache.activemq.ActiveMQConnectionFactory

class GroovyJMSExample {
    def static sendMessage() {
        use(JmsCategory) {
            def jms = new ActiveMQConnectionFactory('tcp://localhost:3700')
            jms.connect { c ->
                c.queue("TEST-queue") { q ->
                    def msg = createTextMessage("test")
                    q.send(msg)
                }
            }
        }
    }

    static void main(String[] args) {
        sendMessage()
    }
}
thufir@doge:~$




thanks,

Thufir

Reply via email to