Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Wattdepot problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert Brewer  
View profile  
 More options May 26 2011, 3:51 pm
From: Robert Brewer <rbre...@lava.net>
Date: Thu, 26 May 2011 09:51:09 -1000
Local: Thurs, May 26 2011 3:51 pm
Subject: Re: Wattdepot problem

Hello Martin. I hope you don't mind, but I've Cc'ed the
wattdepot-users mailing list so others may benefit from the debugging.
You might want to subscribe to the list, it's very low traffic at this
point.

The section of server code that does the check is this:

      // Return failure if the SensorData Source doesn't match the uriSource
      Source source = dbManager.getSource(uriSource);
      if (!source.toUri(server).equals(data.getSource())) {
        setStatusMiscError("SensorData payload Source field does not
match source field in URI");
        return;
      }

From the look of the error message and your Wireshark sniffing, it
appears that the source name is "temp" in both places, as it should
be. I think the problem might be that the server error message doesn't
quite describe the check being performed. The error message says that
the source names don't match, but here I am actually checking that the
whole Source URI contained in the SensorData matches the URI that the
server thinks the Source should have.

Does your wattdepot-server.properties file have a
"wattdepot-server.hostname" property entry? If so, the WattDepot
server will listen on the specified IP address and expect that to be
the canonical form of its URI, but it will also accept requests from
localhost (127.0.0.1). If you are using the hostname property to
listen on a particular IP address, when the server starts up it will
print something like:

2010/02/26 18:25:31  Host: http://server.wattdepot.org:8182/wattdepot/

If you see that, then your client needs to send SensorData objects
that have a source URI that looks like

http://server.wattdepot.org:8182/wattdepot/sources/temp

and not like

http://127.0.0.1:8182/wattdepot/sources/temp

If your server outputs something like this on startup:

2011/05/26 09:39:57  Host: http://127.0.0.1:8182/wattdepot/

then I am still stumped as to what is going on.

In the short term, I will add an issue to change the error message to
be more descriptive by indicating the that source URIs don't match and
actually printing the server's expected Source URI.

Longer term, requiring that SensorData include the Source URI was a
bad design decision stemming from drinking the REST API kool aid.
While there are aspects of RESTfulness in the REST API, it isn't fully
RESTful, yet we still incur the cost of silly things like Source URIs
in the SensorData representation. If I ever get around to a major
rewrite, this kind of thing will be removed, making life easier for
server and client.

Can I ask what project you are using WattDepot for?

--
Robert Brewer
http://excitedcuriosity.wordpress.com/
https://www.facebook.com/kukuicup


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »