Priya,

If you look in the source code of JDBCTargetFactory it tries to get the DataSource 
from the javax.naming.InitialContext.If you do not have it there it will throw this 
configuration exception.You have intialize the DataSourceComponent and give it to the 
log target factory.

Simple solution without using the naming context is to extends the JDBCTargetFactory 
and  configure and intialize by your own the datasource component in your extended 
factory.


Raj
 

-----Original Message-----
From: Priya Soparkar [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 8:39 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Avalon Apache Database configuration


Hi,
Can someone send me the detailed configuration required for logging messages into 
MySQL database using Avalon logkit  ? 
 
I could successfully log messages into file .
 
When i specify 
 
<target>
 <jdbc id="database">
        <datasource>java:/LogTargetDataSource</datasource>
        <normalized>true</normalized>
        <table name="log">
       <time>TIME</time>
       <priority>PRIORITY</priority>
       <category>CATEGORY</category>
       <message>MESSAGE</message>
       <throwable>THROWABLE</throwable>      
       <hostname>HOSTNAME</hostname>
     </table>
  </jdbc>
</target>
It gives me "org.apache.avalon.framework.configuration.ConfigurationException: Cannot 
lookup data source"  Exception .
 
I have already created a table named "log" in my "MySQL" database.
 

Please correct me if i am missing some settings of setting something wrong .
Any pointers on this will be a great help .
 
 
Thanks,
Priya
 





                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to