I am working on a project module in which i have to insert all the changes or updates done in the xml file of all the song tracks into a database, through this program. but unfortunately when i tried to run this program then i am getting this error. kindly tell me how to overcome with it.
here is the error...
log4j:WARN No appenders could be found for logger (com.iremote.itunes.XmlReader).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/apache/commons/collections/Predicate
at com.iremote.itunes.XmlReader.getTracksFromXml(XmlReader.java:30)
at com.iremote.itunes.ReaderThread.run(ReaderThread.java:24)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Predicate
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)
... 2 more
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
How are you adding the Apache Commons library to the classpath? That seems to be missing.
thanks all.... now i added the required library successfully but now i am getting exception in class ReaderThread t line no. 25. here is the exception.....
log4j:WARN No appenders could be found for logger (com.iremote.itunes.XmlReader).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "Thread-0" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.util.Vector;
at com.iremote.itunes.ReaderThread.run(ReaderThread.java:25)
The error message tells you exactly where this error happens: line 25 of ReaderThread.java.
It also tells you what the problem is: you're getting an array of objects (indicated by [Ljava.lang.Object;) and you're casting that to an array of vectors (indicated by [Ljava.util.Vector;).
The object that you're getting isn't an array of vectors, so you get a ClassCastException. Don't cast it to something that it isn't.