Pergunta

I am testing BoneCP along with other Connection pool solutions and I am having trouble getting BoneCP to work. (Using a simple Java application in Eclipse)

The code I am using is copied from the BoneCP JDBC Example.

Following the BoneCP Requirements I have configured the build path by importing the following external JARs:

  • SLF4J - slf4j-jdk14-1.7.5.jar
  • Google Guava - guava-14.0.1.jar

The following is the error I get when I attempt to run the Java Application:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at com.jolbox.bonecp.BoneCPConfig.(BoneCPConfig.java:60) at Main.BoneCP(Main.java:70) at Main.main(Main.java:24) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory 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)

Any help or expertise would be appreciated.

Foi útil?

Solução

The class you are missing is in the slf4j-api jar, currently at version slf4j-api-1.7.5.jar. You can get it here. Add it to your build path and remove the one you have slf4j-jdk14 if you are on java version > 1.4.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top