Archive for the 'java' Category

Java MP3 tag reader

veena

I found an interesting library today. Java ID3, http://www.dusbabek.org/~garyd/id3/ a useful library to read the tags of mp3 files. I was doing some experiment with music folder today. It helped me a lot. very simple api and fast rendering of tags. Good one! It has some problems while reading UTF based tags. I have written a mail to the enthusiastic developer. Hope he will get back to me!

Way to Struts 1.2 DataSource

hurray

Today I had downloaded struts 1.2.7 and tried to write an application. (I know I am selecting a bit old.) I configured the datasource in struts. Alas. When I tried to start my server, tomcat 6.0, I got the error saying "java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource". With Googling I found struts-legacy.jar need to downloaded and copied to lib folder of Tomcat. (I couldnt get the recent version of struts-legacy. I found something in archive). Happily restarted the server. I saw java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool.. oof.. again I need to download commons-dbcp-1.2.2.jar and commons-pool.jar.

My search come to an end :) It is working fine now.

log4j:WARN No appenders could be found for logger

baby by side

I had written a simple core-java program to test the log4j functionality. I decided to test RollingFileAppender and console appender with that. Everything goes fine, till I run the file. When I run the file I count see the log; instead I have seen a warning like

log4j:WARN No appenders could be found for logger

when I added BasicConfigurator.configure(); I have seen console appender is working fine. But I need to add PropertyConfigurator.configure("log4j.properties") to get the log in the rolling file.

BasicConfigurator is used to do the quick configuration so that the log can be displayed in the screen.

PropertyConfigurator of log4j instructs PropertyConfigurator to parse a configuration file and set up logging accordingly.

You can see a get started guide to log4j in the loose-sheets

« Previous PageNext Page »