• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

iTunes Import into DB

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ???
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic