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 3780960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:52:51+00:00 2026-05-19T10:52:51+00:00

I’m attempting to use activemq in glassfish using the genericra resource adapter provided with

  • 0

I’m attempting to use activemq in glassfish using the genericra resource adapter provided with glassfish 2.1. I have found a few pages with helpful information including http://activemq.apache.org/sjsas-with-genericjmsra.html.

I have actually had success and been able to get MDBs to use activemq as their JMS provider, but I’m running into an issue as I’m trying to do some more complicated configuration. I want to set up a master-slave configuration, which would require my clients to use a brokerURL of failover:(tcp://broker1:61616,tcp://broker2:61616). In order to do this, I set the following property when calling asadmin create-resource-adapter-config (I have to escape ‘=’ and ‘:’):

ConnectionFactoryProperties=brokerURL\=failover\:(tcp\://127.0.0.1\:61616,tcp\://127.0.0.1\:61617)

However, I am now getting a StringIndexOutOfBoundsException when my application starts up. I suspect the comma in between the two URLs is the culprit, since this works fine:

brokerURL\=failover\:(tcp\://127.0.0.1\:61616)

Just wondering if anyone has dealt with this issue before. Also wondering if there is a better way to integrate with glassfish than using the generic resource adapter.

EDIT: I forgot to escape the colon after the second tcp, but unfortunately that didn’t fix the issue I’m seeing.

  • 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-05-19T10:52:51+00:00Added an answer on May 19, 2026 at 10:52 am

    I ended up switching to use the resource adapter provided by activemq that comes in the lib/optional directory.

    In case anyone is interested, here are the steps I followed to get it working

    asadmin create-resource-adapter-config --property ServerUrl=failover\:(tcp\://localhost\:61616,tcp\://localhost\:61617) activemqra
    
    asadmin deploy --name activemqra <path to activemq-rar-5.4.2.rar>
    

    Then to create resources:

    asadmin create-connector-connection-pool --raname --connectiondefinition javax.jms.ConnectionFactory --transactionsupport XATransaction jms/MyQueueFactoryPool
    
    asadmin create-connector-resource --poolname jms/MyQueueFactoryPool jms/MyQueueQFactory
    
    asadmin create-admin-object --raname activemqra --restype javax.jms.Queue --property PhysicalName=MyQueue jms/MyQueue
    

    To get an mdb hooked up, I had to add this in the sun-ejb-jar.xml

    <mdb-resource-adapter>
                    <resource-adapter-mid>activemqra</resource-adapter-mid>
                    <activation-config>
                        <activation-config-property>
                            <activation-config-property-name>DestinationType
                            </activation-config-property-name>
                            <activation-config-property-value>javax.jms.Queue
                            </activation-config-property-value>
                        </activation-config-property>
                        <activation-config-property>
                            <activation-config-property-name>destination
                            </activation-config-property-name>
                            <activation-config-property-value>MyQueue
                            </activation-config-property-value>
                        </activation-config-property>
                    </activation-config>
                </mdb-resource-adapter>
    

    To hook this up to a spring JMSTemplate:

    <bean id="ConFac" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>jms/MyQueueQQFactory</value>
            </property>
            <property name="resourceRef">
                <value>true</value>
            </property>
        </bean>
        <bean id="myqueue" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>jms/MyQueue</value>
            </property>
            <property name="resourceRef">
                <value>true</value>
            </property>
        </bean>
        <bean id="mdbTemplate" class="org.springframework.jms.core.JmsTemplate">
            <property name="connectionFactory" ref="conFac" />
            <property name="defaultDestination" ref="myqueue" />
        </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.