Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS: Cannot initialize ConnectionFactory

Joe Cheung
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am learning JMS and so I have downloaded "Java EE SDK 5 Update 2" (available at;jsessionid=500D73F57050D281F4B6B 5289DA3C254) and installed it on my window machine. From the package, I can use "Sun Java System Application Server" to define the necessary resources used in the JMS example programs. I have followed the instruction to create the resources before I run the example with the following output to confirm that ConnectionFactory, Queue and Topic are successfully created:

C:\temp>asadmin list-jms-resources
Command list-jms-resources executed successfully.


However, I got NullPointerException for when I executed the ( that the ConnectionFactory cannot be created:

@Resource(mappedName = "jms/ConnectionFactory")
private static ConnectionFactory connectionFactory;
Connection connection = connectionFactory.createConnection(); // NullPointerException here

Do you think I have sth missing to be defined or created in the "Sun Java System Application Server" or anything else?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic