Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9278817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:28:21+00:00 2026-06-18T17:28:21+00:00

I’m trying to send text messages from a swing heavy client (using Apache ActiveMQ

  • 0

I’m trying to send text messages from a swing heavy client (using Apache ActiveMQ library) to an instance of glassfish server which seems to use OpenMQ as the default JMS provider.

Below the very source basic code I’m using for my client :

try {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("jms/SaisieQueueFactory");
    connectionFactory.setBrokerURL("tcp://localhost:27676");
    Connection connection = connectionFactory.createConnection();
    connection.start();
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    Destination destination = session.createQueue("jms/SaisieQueue");
    MessageProducer producer = session.createProducer(destination);
    producer.setDeliveryMode(DeliveryMode.PERSISTENT);
    TextMessage message = session.createTextMessage("Score + 1");
    producer.send(message);
    session.close();
    connection.close();
} catch(Exception ex) {
    ex.printStackTrace();
}
  • I found the broker port in the system properties from the administration console of Glassfish server (JMS_PROVIDER_PORT)
  • The queue connection factory and the queue have been created when I deployed my MessageDrivenBean
  • For now the client and the glassfish instance are running on the same computer but I would like to have them working on two different machines (that’s why I’m not using vm:// as the transport protocol)

I got these exceptions :

javax.jms.JMSException: Cannot send, channel has already failed: tcp://127.0.0.1:7676
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1395)
    at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1481)
    at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:516)
    at testdate.TestDate.main(TestDate.java:44)
Caused by: org.apache.activemq.transport.InactivityIOException: Cannot send, channel has already failed: tcp://127.0.0.1:7676
    at org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:282)
    at org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:271)
    at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:85)
    at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:104)
    at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
    at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81)
    at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:86)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1366)
    ... 3 more
  • I considered the solution of changing the JMS provider of my Glassfish instance to ActiveMQ but if it is possible I would like to keep OpenMQ

PS: I’m a beginner with JMS and the Java EE framework

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:28:23+00:00Added an answer on June 18, 2026 at 5:28 pm

    The JMS API definies a java interface and an architecture for messaging, it does not define any specific wire protocol, it could be a carrier pigeon, in memory or any of the common formats (STOMP, OpenWire, AMQP, MQTT).

    Why can’t you use Open MQ libraries instead in your client? This is the way JMS is designed. You should only have to switch from the .jar files and change the ConnectionFactory.

    I don’t see any reason to switch to ActiveMQ just for the sake of using the ActiveMQ JMS client, since it should be pretty much the same thing as the Open MQ client. There are other reasons to switch though, such as different server side features and what not, but you did not mention that.

    That said, there is bridge component that is able to expose any JMS server over the STOMP protocol (which ActiveMQ supports).

    It’s called Stomp Connect and there are some rather old instructions at the OpenMQ page how to use it.

    From there, you should be able to connect with ActiveMQConnection factory specifying STOMP. But I have not really tried this combination myself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.