This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes iTunes Import into DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "iTunes Import into DB" Watch "iTunes Import into DB" New topic
Author

iTunes Import into DB

duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64










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: 41082
    
  43
How are you adding the Apache Commons library to the classpath? That seems to be missing.


Ping & DNS - my free Android networking tools app
duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
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

Joined: Jul 26, 2007
Posts: 10167
    
    8

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


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
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

Joined: Aug 16, 2005
Posts: 14074
    
  16

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: iTunes Import into DB
 
Similar Threads
Model or bean class is not available to Action Class
inserting queries advance
inserting queries
Insert query from java program
update db