Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10071

camel-sip - hard dependency on log4j 1.2.x JAR

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Implemented
    • 2.17.1
    • 2.18.0
    • camel-sip
    • None
    • n/a

    • Unknown

    Description

      Trying to use log4j 2.x and the log4j-1.2-api (to emulate log4j 1.2 support), starting a route with camel-sip fails to initialize:

      Failed to create Producer for endpoint: Endpoint[sip://test@... stackName=client]. Reason: javax.sip.PeerUnavailableException: The Peer SIP Stack: gov.nist.javax.sip.SipStackImpl could not be instantiated. Ensure the Path Name has been set.

      Further down the stack trace, it has:

      Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/SimpleLayout
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:190)
      at gov.nist.javax.sip.SipStackImpl.<init>(SipStackImpl.java:666)
      ... 65 more

      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.SimpleLayout
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 68 more

      The original log4j 1.2.x JAR needs to be on the classpath to provide that class.

      The problem is at SipStackImpl.java:666 which appears to be in the dependency jain-sip-api-1.2.jar

      Attachments

        Activity

          People

            Unassigned Unassigned
            daniel.pocock Daniel Pocock
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: