Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1171

Main-Class manifest issues

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.1.7
    • logback-classic
    • None
    • OSX 10.10.5

    Description

      I have edited the post as I found a typo in the java classpath in the instructions for running example 1.

      Either way , as shown below, I am still getting the NoClassDefFoundError for both HelloWorld1 and HelloWorld2.

      _java -classpath "lib/slf4j-api-1.7.20.jar;../logback-core-1.1.7.jar;../logback-classic-1.1.7.jar;../logback-examples/logback-examples-1.1.7.jar" chapters.introduction.HelloWorld1
      _Exception in thread "main" java.lang.NoClassDefFoundError: chapters/introduction/HelloWorld1
      Caused by: java.lang.ClassNotFoundException: chapters.introduction.HelloWorld1
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

      java chapters.introduction.HelloWorld1

      With this output:
      Exception in thread "main" java.lang.NoClassDefFoundError: chapters/introduction/HelloWorld1
      Caused by: java.lang.ClassNotFoundException: chapters.introduction.HelloWorld1
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

      I checked the list of class files in logback-examples-1.1.7.jar and chapters/introduction/HelloWorld1.class is in the list so I am not sure why this NoClassDef error is coming up. If anyone out there knows. If I find out how to fix this before then, I will post an update.

      Thanks a lot

      Attachments

        Activity

          People

            logback-dev Logback dev list
            kulsoom Kulsoom Abdullah
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: