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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:13:18+00:00 2026-06-01T11:13:18+00:00

Using JBoss AS 6.1.0 Final with default deployment profile. I like to send a

  • 0

Using JBoss AS 6.1.0 Final with “default” deployment profile.

I like to send a JMS message from a Session Bean.
I set the following:

/server/default/deploy/my-hornetq-jms:

<configuration xmlns="urn:hornetq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

    <queue name="queue/DummyMDBean">
        <entry name="jms/DummyMDBean"/>
    </queue>
</configuration>

In the bean I have:

@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class Demo implements DemoRemote, DemoLocal {
    ...
    @Resource(mappedName = "java:/ConnectionFactory")
    private static QueueConnectionFactory queueConnectionFactory;

    @Resource(mappedName = "/jms/DummyMDBean")
    private static Queue queue;

    public void example() {
        QueueConnection queueConnection = null;
        try {
            queueConnection = queueConnectionFactory.createQueueConnection();
        } catch (JMSException e) {
            System.out.println("Exception occurred: " + e.toString());
            e.printStackTrace();
        }

        try {
            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            QueueSender queueSender = queueSession.createSender(queue);

            // Send a text message:
            TextMessage textMessage = queueSession.createTextMessage();
            textMessage.setText("Hello World");

            queueSender.send(textMessage);
        } catch (JMSException e) {
            System.out.println("Exception occurred: " + e.toString());
            e.printStackTrace();
        } finally {
            closeConnection(queueConnection);
        }
    }

I get the following error:

15:46:05,011 INFO  [STDOUT] Exception occurred: javax.jms.JMSException: Failed to create session factory
15:46:05,661 ERROR [STDERR] javax.jms.JMSException: Failed to create session factory
15:46:05,666 ERROR [STDERR]     at    org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)
15:46:05,667 ERROR [STDERR]     at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:131)
15:46:05,668 ERROR [STDERR]     at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:126)
15:46:05,669 ERROR [STDERR]     at com.demo.Demo.example(Demo.java:109)

...

15:46:05,782 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:722)
15:46:05,783 ERROR [STDERR] Caused by: java.lang.NullPointerException
15:46:05,784 ERROR [STDERR]     at org.hornetq.core.client.impl.ServerLocatorImpl.removeFromConnecting(ServerLocatorImpl.java:682)
15:46:05,784 ERROR [STDERR]     at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:751)
15:46:05,785 ERROR [STDERR]     at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)
15:46:05,785 ERROR [STDERR]     ... 180 more

line 109 is the “queueConnection = queueConnectionFactory.createQueueConnection();”.

I didn’t change anything from the default except of the xml above.
Any ideas about the problem, and how to fix it?

  • 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-01T11:13:20+00:00Added an answer on June 1, 2026 at 11:13 am

    Is line 109 in Demo.java corresponding to the following line?

    QueueSender queueSender = queueSession.createSender(queue);
    

    I guess that queue might be null. You could try to declare your queue as follows:

    <queue name="queue/DummyMDBean">
        <entry name="/jms/DummyMDBean"/>
    </queue>
    

    Update:

    The used connection factory can also be problematic in an EJB environment. In AS 6.10 /ConnectionFactory is a kind of unmanaged factory that works in Servlets and JSF managed beans to create direct destination listeners (which is otherwise forbidden in the container).

    For usage in EJB it seems you now actually should use java:/jmsXA instead (this was different in 6.0 and 5.x). E.g.

    @Resource(mappedName = "java:/JmsXA")
    private ConnectionFactory queueConnectionFactory;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jboss-as-7.1.0.Final-SNAPSHOT and trying to set up custom login module that uses
I'm using Jboss AS 7.1.1.final and I'm trying to add an oracle Datasource: <datasource
I'm using Jboss 7.1.1 and I have the following log definition: <subsystem xmlns=urn:jboss:domain:logging:1.1> <console-handler
Given a web application built using Jboss seam with following details: dynamic web module:
I'm trying to implement an ejb-call by using JNDI-naming. Setup: JBoss-6.1.0.Final ear-deploy: gwt.war ejb.jar
I am using Hibernate 3.6.0 with JPA 2 on Jboss AS 6.0.0 final. In
I'm trying to install Jboss 7.1.0-Final as a service using the Java service wrapper
We're using Jboss, but we are really only using its JMS stuff. So, is
I've setup hibernate via JNDI in JBoss 6.0.0.Final by following alot of articles and
I'm using Mojarra 2.0.3 on JBoss 6.1.0 final. I'm having a problem with the

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.