This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235475 - ClassNotFoundException: org.slf4j.LoggerFactory
Summary: ClassNotFoundException: org.slf4j.LoggerFactory
Status: RESOLVED DUPLICATE of bug 233456
Alias: None
Product: javafx
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-04 01:40 UTC by Ed888
Modified: 2013-09-05 05:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed888 2013-09-04 01:40:13 UTC
I installed Netbeans 7.4 yesterday and have all my codes migrated from NB7.3.1 to 7.4.

I can complie all codes, but I can not run any FXML projects. I go the 
following errors:
Executing C:\JavaWS\PaxSysProjGroup\JavaFXApplication8\dist\run678766717\JavaFXApplication8.jar using platform C:\Program Files\Java\jdk1.7.0_21\jre/bin/java
Exception in Application constructor
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.javafx.main.Main.launchApp(Main.java:642)
	at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class javafxapplication8.JavaFXApplication8
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:393)
	at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
	at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at javafxapplication8.JavaFXApplication8.<clinit>(JavaFXApplication8.java:24)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:276)
	... 3 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	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:423)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 9 more

Tried to add a new FXML project to the project group. I can compile and run it if I have not added a reference to slf4j and logback. Once I added a reference to slf4j and logback and added codes to my main class

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class JavaFXApplication8 extends Application
{
	private static final Logger LOG = LoggerFactory.getLogger(JavaFXApplication8.class);
...

The project can be compiled successfully, but I will get the same error aformentioned when I run the project.

BTW, I don't get any issue like that with NB7.3.1
Comment 1 Martin Entlicher 2013-09-04 07:24:42 UTC
The fact that there is a problem with Logger class does not mean that it has anything to do with the Logger module.
You need to assure, that you have org.slf4j.Logger on the class path of your project.
Have a look e.g. at http://searjeant.blogspot.cz/2008/11/logging-in-netbeans-using-slf4j_9366.html
Assure, that you have a library with slf4j-api.jar and that you have a proper dependency on the library.
Comment 2 Ed888 2013-09-05 03:15:22 UTC
Product Version: NetBeans IDE 7.4 Beta (Build 201307092200)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows XP version 5.1 running on x86; Cp1252; en_AU (nb)

It's a duplibate of exising bug 233456.

*** This bug has been marked as a duplicate of bug 233456 ***
Comment 3 Lou Dasaro 2013-09-05 05:00:22 UTC
Just FYI - This was a valid bug in the 7.4 beta - bug 233456

It was subsequently fixed in build 201307312300, but folks are still downloading the older Beta and reporting this (and other) errors present in the Beta.