The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Re: java xAPlib bug


  • Subject: Re: Re: java xAPlib bug
  • From: Jon Payne <jgpayne@xxxxxxxxxxxxxx>
  • Date: Tue, 27 Feb 2007 14:38:18 +0000 (GMT)

Hi Shaf,

I think I too found those issues, but it was ages ago and I've reworked
this quite a bit because I'm using a TINI (embedded system) which uses
Java1.1/1.2 so I've changed things to use the older collections libraries
and also to make sending of xap messages more efficient (will several
processes running the creation and sending of one xap message takes about 1
second!) I've yet to use receiving of messages on the TINI but now need to
on the PC for logging temperatures so I will also rework that part...

Cheers,
Jon

----- Original Message ----
From: Shaf Ali <shaf@xxxxxxx>
To: xAP_developer@xxxxxxx
Sent: Monday, 26 February, 2007 4:18:48 AM
Subject: [xAP_developer] Re: java xAPlib bug


Screw it


if (trimmedSection.compareToIgnoreCase("xap-header")
== 0) {
trimmedSection = trimmedSection.toLowerCase();
}

changed to

trimmedSection = trimmedSection.toLowerCase();

ALWAYS lowercase the section ! This bug is not specific to xap-header.

I'm done with this -

So anyone using this library or have I picked up an old borked one :/




Shaf Ali wrote:
> And here's the fix but I also noticed that the message blocks are not
> in order but thats not a major issue :)
>
>
> xAPParser.java
>
>                    // Shaf fix
>
>                    String trimmedSection=iSection.toString().trim();
>
>                    if
> (trimmedSection.compareToIgnoreCase("xap-header") == 0) {
>                        trimmedSection = trimmedSection.toLowerCase();
>                    }
>
>                    String trimmedKeyname=iKeyname.toString().trim();
>                    String trimmedKeyvalue=iKeyvalue.toString().trim();
>                   //                   
System.out.println("Section
> ["+trimmedSection.trim()+"]");                   //
> System.out.println("Name
["+trimmedKeyname.trim()+"]");
> //                    System.out.println("Value
> ["+trimmedKeyvalue.trim()+"]");
>                                                          iNVPair=new
> xAPNameValuePair(trimmedSection, trimmedKeyname,trimmedKeyvalue
> );                                      // End Shaf
>
> from
>
>                    String trimmedSection=iSection.toString();
>                    String trimmedKeyname=iKeyname.toString();
>                    String trimmedKeyvalue=iKeyvalue.toString();
>                   //                   
System.out.println("Section
> ["+trimmedSection.trim()+"]");                   //
> System.out.println("Name
["+trimmedKeyname.trim()+"]");
> //                    System.out.println("Value
> ["+trimmedKeyvalue.trim()+"]");
>                                                          iNVPair=new
> xAPNameValuePair(trimmedSection.trim(),
> trimmedKeyname.trim(),trimmedKeyvalue.trim() );
>
>
>
>
>
> Shaf Ali wrote:
>> Caused by hard coded references to 'xap-header'
>>
>> Some/most xAP apps identify the header as 'xAP-header'
>>
>> Oh well
>>
>>
>> Shaf Ali wrote:
>>> Anyone still use this lib ?
>>> (http://patrick.lidstone.net/haweb/java.htm)
>>>
>>> Thought I'd give my Java some oiling the trace is at the
bottom.
>>>
>>> Here's the breakpoint
>>>
>>> this    xAPParser  (id=20)      gBlockCursor    null
>>> gNVBlockCursor    null      iMessageItems   
HashMap<K,V>  (id=33)
>>> aNVPair    xAPNameValuePair  (id=24)      iBlock   
"xAP-header"
>>>        count    10          hash    -1579644813         
offset
>>> 0          value    char[11]  (id=48)      iName   
"hop"
>>> iValue    "1"   iNVPairSet    null  Heres the quick
hack I'll see
>>> what the cause is.
>>>
>>> xAPMessageObject.java
>>>
>>>        // block must now exist, add pair
>>>        // 20070226 shaf hack : hmmm I wouldn't be too sure if
I were
>>> you
>>> //        iNVPairSet.add(aNVPair);
>>>        if (iNVPairSet != null) {
>>>            iNVPairSet.add(aNVPair);                  }
>>>
>>>
>>> =========== Got a xAP message
>>> Null source
>>> Null class
>>> firstblock = [xap-hbeat]
>>> =========== End xAP message
>>>
>>> [xap-header] debug[name] : v
>>> [xap-header] debug[valu] : 12
>>> [xap-header] debug[name] : hop
>>> [xap-header] debug[valu] : 1
>>> [xap-header] debug[name] : uid
>>> [xap-header] debug[valu] : FF342300
>>> [xap-header] debug[name] : Class
>>> [xap-header] debug[valu] : Web.Service
>>> [xap-header] debug[name] : Source
>>> [xap-header] debug[valu] : mi4.news.FRESH
>>> [Server.Start] debug[name] : Name
>>> [Server.Start] debug[valu] : News
>>> [Server.Start] debug[name] : Desc
>>> [Server.Start] debug[valu] : News feed viewer
>>> Exception in thread "Thread-0"
java.lang.NullPointerException
>>>        at
>>>
xAPlib.xAPMessageObject.addNameValuePair(xAPMessageObject.java:58)
>>>        at xAPlib.xAPParser.<init>(xAPParser.java:104)
>>>        at
ListenAndParse$1.myEventOccurred(ListenAndParse.java:40)
>>>        at xAPlib.xAPNetwork.fireMyEvent(xAPNetwork.java:69)
>>>        at xAPlib.xAPNetwork.run(xAPNetwork.java:140)
>>>
>>>
>>>
>>
>>
>
>






xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.