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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:14:34+00:00 2026-05-27T14:14:34+00:00

I am trying to use JMS in a JBoss AS 7 application. Publishing normal

  • 0

I am trying to use JMS in a JBoss AS 7 application. Publishing normal messages seems to work OK, however when I try to use hornetq specific features (to exclude duplicate messages), an exception is thrown.
This is the code:

om.setStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID.toString(), application+rs.getString("stream")+ rs.getInt("site"));

And here is the stack trace:

java.lang.ClassNotFoundException: org.hornetq.api.core.Message from [Module "deployment.TestRestEasy.war:main" from Service Module Loader]
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
sample.Processor.processStreamSite(Processor.java:82)
sample.Processor.processSitesForStream(Processor.java:63)
sample.Processor.process(Processor.java:55)
sample.HelloWorld.process(HelloWorld.java:31)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

I believe I have configured the standalone.xml configuration file correctly, as the standard JMS code works. Is there anything special I need to do to access HornetQ specific features?

Update:
Was worried was related to RestEasy stuff I was using, so moved into standalone Servlet, but still had same issue. Code and exception below

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   try {
    Context ic = new InitialContext();

  QueueConnectionFactory qcf = (QueueConnectionFactory) ic.lookup("java:/ConnectionFactory");
  Queue q = (Queue) ic.lookup("queue/test");

  QueueConnection qc = qcf.createQueueConnection();
  QueueSession qsess = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  QueueSender qsend = qsess.createSender(q);

  ObjectMessage om = qsess.createObjectMessage();
  om.setObject((Serializable)new InboundDirectory("X", "Y", 9));
  om.setStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID.toString(), "X");
  qsend.send(om);
  System.out.println("X");
  }
  catch (Exception e) {
     e.printStackTrace();
  }
}

And here is the exception:

java.lang.ClassNotFoundException: org.hornetq.api.core.Message from [Module "deployment.TestRestEasy.war:main" from Service Module Loader]
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
TestServlet.doPost(TestServlet.java:65)
TestServlet.doGet(TestServlet.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

Further update:
Got it working by using the String value instead, but I don’t think that is ideal, the property key is not guaranteed that string forever.

om.setStringProperty("_HQ_DUPL_ID", "X:Y:9");

Any idea the proper way to do it?

Update: Thanks @Vadzim for pointing me in the right direction. For anybody else struggling with this specific problem I updated the Manifest.MF as follows:

Manifest-Version: 1.0
Class-Path: 
Dependencies: org.hornetq

Note, (as I struggled with this for a while), the parsing of this file is very ‘fragile’. The Space after the ‘Class-Path:’ entry line is essential.

  • 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-27T14:14:35+00:00Added an answer on May 27, 2026 at 2:14 pm

    Classloading model changed in JBoss 7. It hides much stuff that’s not explicitly declared.

    You have to get familar with these links:

    https://docs.jboss.org/author/display/AS7/Developer+Guide#DeveloperGuide-HowtoresolveClassNotFoundExceptionsandNoCLassDefFoundErrors

    https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7

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

Sidebar

Related Questions

We are trying to use the HornetQ store and forward mechanism... however forwarding messages
Trying to use log4j's built-in JMSAppender to log messages to a local message queue
I am trying to build a application with several camel routes which re use
I'm trying use the Str[fixnum] to return a specific portion of a string. #
I'm trying to use embedded ActiveMQ broker for unit testing, as explained here: http://activemq.apache.org/how-to-unit-test-jms-code.html
I'm trying to refactor some legacy code to use Spring to handle the jms
I am trying to use QPid as a JMS provider. Maven is used as
I'm trying to run the Camel Example camel-example-spring-jms (also at http://activemq.apache.org/camel/tutorial-jmsremoting.html ). However, when
I am trying to develop a JMS standalone application to read and write to
I've been trying to figure out how to send JMS messages from Ruby. I've

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.