File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iTunes Import into DB

 
duhit Choudhary
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator










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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you adding the Apache Commons library to the classpath? That seems to be missing.
 
duhit Choudhary
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:How are you adding the Apache Commons library to the classpath? That seems to be missing.


i think i have added all the files correctly...
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
duhit Choudhary wrote:
Ulf Dittmer wrote:How are you adding the Apache Commons library to the classpath? That seems to be missing.

i think i have added all the files correctly...

The error is telling you...not really
 
duhit Choudhary
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

Is there any way by which I can resolve this ???
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic