Cannot include Neuroph library in Netbeans - java

Downloaded the Neuroph 2.9 library to include in my Java project. The library is linked into the project like so:
But using any classes in the library results in the error:
Full admission: I am a noob with linking libraries in Java, and Google doesn't seem to have anything useful. Apparently I need to dive into the "Classpath" or some .xml config file, does anyone with more Java experience know where to start (do they recognise the java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory error)? I don't think it's necessarily an issue with this particular library, but I've linked it in the wrong way or missed an important step.

Solved by adding neuroph-2.9\libs\slf4j-api-1.7.5 and neuroph-2.9\libs\slf4j-nop-1.7.6 to the Project Libraries.
Do not link all of the jars inside that folder. This results in the error "SLF4J: Class path contains multiple SLF4J bindings."

Related

NoClassDefFoundError, trouble loading library I created before I use it in my main jar

I understand what this error is 'java.lang.NoClassDefFoundError', and why it is caused. My issue is that I don't know how to solve it.
I am attempting to use an external utility library I made for creating inventories in a plugin of mine, and I compiled that library jar in with the plugin I was creating, and upon start up it gave me that error. Any ideas on how to solve this?
I figured that if I compiled the library with my .jar, it should load first to solve this issue...?
If you are using an external library you will need to shade the dependency into your plugin. Or if it is another plugin, ensure your plugin depends and loads after.
https://maven.apache.org/plugins/maven-shade-plugin/
https://bukkit.gamepedia.com/Plugin_YAML
I also highly recommend you ask for help on SpigotMC.org or Bukkit.org. There are thousands of Bukkit-Specific plugin developers on there willing to help.

Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at runtime [duplicate]

I am trying to run GWT RequestFactory and facing this error:
ClassNotFoundException: org.slf4j.LoggerFactory
I have tried to download slf4j-api-1.3.1.jar but it didnt resolve the issue
Any idea exactly which jar I need to download ?
Better to always download as your first try, the most recent version from the developer's site
I had the same error message you had, and by downloading the jar from the above (slf4j-1.7.2.tar.gz most recent version as of 2012OCT13), untarring, uncompressing, adding 2 jars to build path in eclipse (or adding to classpath in comand line):
slf4j-api-1.7.2.jar
slf4j-simple-1.7.2.jar
I was able to run my program.
Try downloading jar from here
You can find, it holds the class you need.
EDIT
Seems like the website has changed its structure. You need to choose which jar file you need for your project.
For slf4j-api jar file for latest version as of now, please visit this link
For slf4j-simple jar file for latest version as of now, please visit this link
i know this is an old Question , but i faced this problem recently and i looked for it in google , and i came across this documentation here from slf4j website .
as it describes the following :
This error is reported when the org.slf4j.impl.StaticLoggerBinder
class could not be loaded into memory. This happens when no
appropriate SLF4J binding could be found on the class path.
Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar,
slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class
path should solve the problem.
SINCE 1.6.0 As of SLF4J version 1.6, in
the absence of a binding, SLF4J will default to a no-operation (NOP)
logger implementation.
Hope that will help someone .
For a bit more explanation: keep in mind that the "I" in "api" is interface. The slf4j-api jar only holds the needed interfaces (actually LoggerFactory is an abstract class). You also need the actual implementations (an example of which, as noted above, can be found in slf4j-simple). If you look in the jar, you'll find the required classes under the "org.slf4j.impl" package.
You'll need to download SLF4J's jars from the official site as either a zip (v1.7.4) or tar.gz (v1.7.4)
The download contains multiple jars based on how you want to use SLF4J. If you're simply trying to resolve the requirement of some other library (GWT, I assume) and don't really care about using SLF4J correctly, then I would probably pick the slf4j-api-1.7.4.jar since the Simple jar suggested by another answer does not contain, to my knowledge, the specific class you're looking for.
add this dependency
https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.28
will help fix error
I got this problem too and I fixed it in this way.
I was trying to run mapreduce job locally through Eclipse, after set the configurations, I met this error (in Linux, Virtual Box)
To solve it,
right click on the project you want to run,
go "Properties"->"Java
Build Path"->"Add External Jars",
then go to
file:/usr/lib/Hadoop/client-0.20, choose the three jars named started
by "slf4j".
Then you'll be able to run the job locally.
Hope my experience will help someone.
Add the following JARs to the build path or lib folder of the project:
slf4j-api-1.7.2.jar
slf4j-jdk14-1.7.2.jar
It needs "slf4j-simple-1.7.2.jar" to resolve the problem.
I downloaded a zip file "slf4j-1.7.2.zip" from http://slf4j.org/download.html. I extracted the zip file and i got slf4j-simple-1.7.2.jar
I had the same on Android. This is how i fixed it:
including ONLY the file:
slf4j-api-1.7.6.jar
in my libs/ folder
Having any additional slf4j* file, caused the NoClassDefFoundError.
Obviously, the rest of the libs can be there (android-support-v4, etc)
Versions:
Eclipse Kepler 2013 06 14 - 02 29
ADT 22.3
Android SDK: 4.4.2
Hope someone saves the time i wasted thanks to this!

Java LWJGL (linux): Could not initialize class org.lwjgl.system.MemoryAccess

I just added lwjgl 3.1 to a project in Intellij IDEA. To verify everything was done correctly I tried to run the guide code in the webpage (https://www.lwjgl.org/guide), but when compiling the following error came out:
"Exception in thread "main" java.lang.NoClassDefFoundError: Could not
initialize class org.lwjgl.system.MemoryAccess"
After a google search I found out that the possible error is in the configuration of the native libraries, which I have added when configuring the library in the project.
When LWJGL was downloaded from the webpage, I got a a zip file with all the jar files of the modules (classes, docs, natives and sources), what I did was to separate them accordingly and then add them as a single library in the global libraries section of the IDE.
Global Libraries
After this, the library appears as a module of the project.
Still, the program won't compile. Is there anything else I should configure?
You claim that this is a compile-time error, however, after looking through the documentation, I have found out that this is a runtime error, where you successfully compile, but the JVM is unable to find the class at runtime. To solve this, I would suggest merging your .jar output and the lwjgl jar using jarsplice to see if that fixes it. If it fixes it, the problem is with intelliJ not correctly adding your libraries to your jar.

Info about version dependancies of enterprise java libraries

I am new to enterprise application developement and trying to create a REST server with Spring REST, JPA taking to mySQL database and Javascript on the client side. As I see loads of opensource libraries doing specific task, I started off with using 'maven project' with different 'arch type' (which is nothing but predefined POM with relevent libraries as I understand) provided by Eclipse. But I often run into version mismatch issues, in many cases found specific solution to that perticular libraries in StackOverflow or other sites.
Hence I started looking for a information these version dependancies such as, this version of JPA works with that version of Hibernate library and so on. I checked maven repository of major libraries, I did not find such information so far.
My queries are:
Where can I find these information about the versions dependancies?
Are these pre defined POM in eclipse reliable? Who owns them, where can I get last modified dates on these maven 'arch types'? (I find the ones I choose having fairly old version of libraries).
If I have to start off on my own creating a Maven dependacies, where will I get information about what are the dependent libraries, for example, if I need spring MVC, for sure it needs java servlet library. I am worried becuase the maven 'spring-mvc-jap' arch type whooping 50 libaries as dependancies.(Coming from embeded domain, I find to too hard to digest :D). So not sure if it is the right way.
Please correct if I am missing anything in my understanding.
You can find this information, if you are using maven and some IDE you can go to the dependancy and make click un > and this will show the librarys used for this dependancy or if you want to use the console you have http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html this will show the same that the IDE.
After normally in the documentation of the library used, you can find some doc about the dependancy about this.
Other solution is get the .jar and use 7zip to see the POM and know the dependancy used.
And for finish my answer if the IDE tell you that you dont have x dependancy normally you have to add this because any of the other dependancy used have it (they used only for the compiling task), but sometime somes projet change a lots of code between the version .a to .b so you will have some problem using the version .b, at this moment i didnt find one good and easy way to fix this, only using the way that i told you (only if i found some problem in the compilation)
3> I am not sure how it works in eclipse but in IntelliJ IDEA when you start using some class without proper dependency IDEA suggest you to add proper dependency automatically. The same approach should be in eclipse.

Java based Atom/RSS Library that works in Google App Engine

I am trying to publish an Atom/RSS feed in my Java based Google App Engine code. I have tried using Rome and keep getting the following error (tried googling without success), also the code I am running that generates the error is the demo code (so I get the feeling Rome won't work with GAE)
java.lang.NoClassDefFoundError: org/jdom/JDOMException
at com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44)
What I am looking for is recommendations for a simple Java library to create and publish an Atom feed from within Google App Engine.
Thanks.
java.lang.NoClassDefFoundError: org/jdom/JDOMException
This just means that the particular class is missing in the runtime classpath (while it was available in the compiletime classpath, that's the difference with ClassNotFoundException).
Logical next step would be to include the particular class (or more actually, the JAR file with the particular class) in the runtime classpath. Then this error wil gone.
Check your compiletime classpath if it is there and add it to runtime classpath. Or if it is actually a dependency which you don't have yet, then it's good to know that the package name already hints that you could find and download it at http://jdom.org.
#Adriana and any other people late to the thread:
What Balus meant was that the original poster, was missing the JDOM library, which can be downloaded at http://jdom.org/. You just need to add the .jar to the classpath, which the ROME demo code apparently was lacking.

Categories

Resources