Re: Exception In GaimLog Backend
- From: "Kevin Kubasik" <kevin kubasik net>
- To: dashboard-hackers <dashboard-hackers gnome org>
- Subject: Re: Exception In GaimLog Backend
- Date: Wed, 22 Mar 2006 18:54:59 -0500
This patch partially fixes the problem (it might still let some issues
happen on the frontend when there are not dates to be displayed) but
it doesn't crash the daemon anymore. Although it does require a
re-index of all gaim logs.
Cheers,
Kevin Kubasik
On 3/21/06, Kevin Kubasik <kevin kubasik net> wrote:
> I've been getting this exception whenever I run a search, and it has
> now started appearing even when I am not searching (although its
> possible its an unclosed query from something else) I have deleted
> ~/.beagle twice and let it rebuild the index. Any thoughts?
>
> Warn: Caught exception calling DoQuery on 'GaimLog'
> Warn: System.NullReferenceException: Object reference not set to an
> instance of an object
> in [0x00000] (at /home/kevin/src/beagle/Util/ImBuddy.cs:105)
> Beagle.Util.GaimBuddyListReader:Format (System.String name)
> in [0x00008] (at /home/kevin/src/beagle/Util/ImBuddy.cs:290)
> Beagle.Util.GaimBuddyListReader:Search (System.String buddy)
> in [0x00011] (at
> /home/kevin/src/beagle/beagled/GaimLogQueryable/GaimLogQueryable.cs:259)
> Beagle.Daemon.GaimLogQueryable.GaimLogQueryable:HitFilter (Beagle.Hit
> hit)
> in (wrapper delegate-invoke) System.MulticastDelegate:invoke_bool_Hit
> (Beagle.Hit)
> in [0x0001f] (at /home/kevin/src/beagle/beagled/LuceneCommon.cs:874)
> Beagle.Daemon.LuceneCommon+AndHitFilter:HitFilter (Beagle.Hit hit)
> in (wrapper delegate-invoke) System.MulticastDelegate:invoke_bool_Hit
> (Beagle.Hit)
> in [0x003de] (at
> /home/kevin/src/beagle/beagled/LuceneQueryingDriver.cs:700)
> Beagle.Daemon.LuceneQueryingDriver:GenerateQueryResults
> (Lucene.Net.Index.IndexReader primary_reader,
> Lucene.Net.Search.IndexSearcher primary_searcher,
> Lucene.Net.Search.IndexSearcher secondary_searcher,
> Beagle.Util.BetterBitArray primary_matches, IQueryResult result,
> ICollection query_term_list, Int32 max_results,
> Beagle.Daemon.UriFilter uri_filter, Beagle.Daemon.HitFilter
> hit_filter)
> in [0x003a3] (at
> /home/kevin/src/beagle/beagled/LuceneQueryingDriver.cs:322)
> Beagle.Daemon.LuceneQueryingDriver:DoQuery (Beagle.Query query,
> IQueryResult result, ICollection search_subset_uris,
> Beagle.Daemon.UriFilter uri_filter, Beagle.Daemon.HitFilter
> hit_filter)
> in [0x00135] (at
> /home/kevin/src/beagle/beagled/LuceneQueryable.cs:319)
> Beagle.Daemon.LuceneQueryable:DoQuery (Beagle.Query query,
> IQueryResult query_result, IQueryableChangeData i_change_data)
> in [0x00009] (at /home/kevin/src/beagle/beagled/Queryable.cs:73)
> Beagle.Daemon.Queryable:DoQuery (Beagle.Query query, IQueryResult
> result, IQueryableChangeData change_data)
>
>
> --
> Cheers,
> Kevin Kubasik
> http://blog.kubasik.net/
>
--
Cheers,
Kevin Kubasik
http://blog.kubasik.net/
? GaimNullObjFix.diff
? beagle-mono-1.1.12-bludgeon.patch
? beagle.c
? beagle.mdp
? beagle.mds
? beagle.pidb
? no-eds.diff
? Filters/FilterTar.cs
? Filters/FilterZip.cs
? Filters/FilterZipFull.cs
? Util/NautilusTest.cs
? beagled/gaimIndexDump
? po/.intltool-merge-cache
? po/stamp-it
? wrappers/python/.deps
? wrappers/python/.libs
? wrappers/python/beagle.la
? wrappers/python/beagle.lo
? wrappers/python/beaglemodule.lo
Index: Util/ImBuddy.cs
===================================================================
RCS file: /cvs/gnome/beagle/Util/ImBuddy.cs,v
retrieving revision 1.9
diff -u -r1.9 ImBuddy.cs
--- Util/ImBuddy.cs 24 Oct 2005 20:16:59 -0000 1.9
+++ Util/ImBuddy.cs 22 Mar 2006 23:53:45 -0000
@@ -102,7 +102,7 @@
}
private string Format (string name) {
- return name.ToLower ().Replace (" ", "");
+ return name.ToLower().Replace(" ", "");
}
override public void Read ()
@@ -286,6 +286,15 @@
public ImBuddy Search (string buddy) {
+ //Console.WriteLine("From IMBUDDY.Search " +buddy);
+ //Console.WriteLine(buddyList.ToString());
+ //Console.WriteLine(buddyList[buddy]);
+ /*
+ if(buddy == null)
+ return null;
+ if(buddy.Equals(""))
+ return null;
+ */
return (ImBuddy)buddyList[Format(buddy)];
}
Index: Util/ImLog.cs
===================================================================
RCS file: /cvs/gnome/beagle/Util/ImLog.cs,v
retrieving revision 1.24
diff -u -r1.24 ImLog.cs
--- Util/ImLog.cs 18 Mar 2006 14:20:50 -0000 1.24
+++ Util/ImLog.cs 22 Mar 2006 23:53:45 -0000
@@ -130,7 +130,7 @@
public class GaimLog : ImLog {
public const string MimeType = "beagle/x-gaim-log";
-
+ private bool isHtml;
private static string StripTags (string line, StringBuilder builder)
{
int first = line.IndexOf ('<');
@@ -178,11 +178,15 @@
public GaimLog (FileInfo file, TextReader reader) : base ("gaim", file, reader)
{
string filename = file.Name;
-
+ isHtml = file.Name.EndsWith(".html");
// Parse what we can from the file path
try {
string str;
+ //this is safer then asking afterwords.
+ SpeakingTo = StringFu.HexUnescape (file.Directory.Name);
+ Identity = StringFu.HexUnescape (file.Directory.Parent.Name);
+ Protocol = file.Directory.Parent.Parent.Name;
// Character at position 17 will be either a dot, indicating the beginning
// of the extension for old gaim logs, or a plus or minus indicating a
// timezone offset for new gaim logs.
@@ -218,10 +222,7 @@
}
// Gaim likes to represent many characters in hex-escaped %xx form
- SpeakingTo = StringFu.HexUnescape (file.Directory.Name);
- Identity = StringFu.HexUnescape (file.Directory.Parent.Name);
-
- Protocol = file.Directory.Parent.Parent.Name;
+
Load ();
}
@@ -310,8 +311,8 @@
// Could the second line ever start w/ < in a non-html log?
// I hope not!
- bool isHtml = line.Length > 0 && line [0] == '<';
-
+ //bool isHtml = line.Length > 0 && line [0] == '<';
+
while ((line = TextReader.ReadLine ()) != null) {
if (isHtml)
line = StripTags (line, builder);
Index: beagled/GaimLogQueryable/GaimLogQueryable.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/GaimLogQueryable/GaimLogQueryable.cs,v
retrieving revision 1.51
diff -u -r1.51 GaimLogQueryable.cs
--- beagled/GaimLogQueryable/GaimLogQueryable.cs 18 Mar 2006 14:20:50 -0000 1.51
+++ beagled/GaimLogQueryable/GaimLogQueryable.cs 22 Mar 2006 23:53:45 -0000
@@ -254,8 +254,12 @@
override protected bool HitFilter (Hit hit)
{
+ /*
+ foreach( object o in hit.Properties.ToArray()){
+ Console.WriteLine(o);
+ }
+ */
ImBuddy buddy = list.Search (hit ["fixme:speakingto"]);
-
if (buddy != null) {
if (buddy.Alias != "")
hit ["fixme:speakingto_alias"] = buddy.Alias;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]