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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:13:04+00:00 2026-05-29T08:13:04+00:00

Trying to use log4j’s built-in JMSAppender to log messages to a local message queue

  • 0

Trying to use log4j’s built-in JMSAppender to log messages to a local message queue (ActiveMQ).

I set up a test Driver that has an entry main method and that just instantiates the actual class I want to make the connection:

Driver.java:

public static void main(String[] args) {
    Log4jAmqBridge bridge = new Log4jAmqBridge();
    bridge.run();
}

Log4jAmqBridge.java:

public void run() {
    // ...
}

If I leave my run method totally empty (no instructions) and run the Driver, I just get an empty console (Eclipse). But the second I add the following constructor to run():

JMSAppender appender = new JMSAppender();

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/JMSException
    at test.jmsappender.Log4jAmqBridge.run(Log4jAmqBridge.java:11)
    at test.Driver.main(Driver.java:11)
Caused by: java.lang.ClassNotFoundException: javax.jms.JMSException
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

I checked the javadoc and it doesn’t look like the JMSAppender no-arg constructor throws an exception.

Does anybody know whats going on?

Edit:
I am actually using Maven to manage my dependencies and have included the following dependency declarations in my pom:

<dependency>
    <scope>compile</scope>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.6.4</version>
</dependency>
<dependency>
    <scope>compile</scope>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.6.4</version>
</dependency>

Which puts the following jars under the Maven Dependencies in my project (which are also added to the Eclipse workbench classpath):

  • slf4j-api-1.6.4
  • slf4j-log4j12-1.6.4
  • log4j-1.2.16

Thanks in advance!

  • 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-29T08:13:05+00:00Added an answer on May 29, 2026 at 8:13 am

    Log4jAmqBridge depends on the JMS API.

    Add this dependency to your pom.xml :

    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>jms</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    

    It should solve your problem.

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

Sidebar

Related Questions

I'm trying to use log4j my log4j.propreties: log4j.rootLogger=DEBUG, out log4j.logger.org.springframework=INFO log4j.logger.org.apache.activemq=INFO log4j.logger.org.apache.activemq.spring=WARN log4j.logger.org.apache.servicemix=DEBUG, stdout
Hy ppl, I'm having a problem trying to use Log4J's NTEventLogAppender. I've set my
I was trying use a set of filter functions to run the appropriate routine,
I'm trying out log4j in a simple test app. I create a new Java
i'm trying to convert my log4j.properties into log4j.xml because i need to use some
I'm trying to configure log4j to use the SMTPAppender but I keep getting relay
I am trying to use log4j for my Java desktop application that i am
I'm trying to use log4j to handle the logs for a web-service which is
I am trying to use Log4j as part of the Spring Framework, as far
I'm currently trying to make Log4J log into a JTextPane . I want to

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.