February 6, 2007, 3:00 pm by Alex
|
Comment
Spent the last couple of days trying to figure out why my clustering algorithm in Java wasn’t working properly – was working for some grids, but was totally messed up on others. I think I’ve tracked down why… the problem I think is to do with the precision of the datatypes I’m using in Java and MySQL. In Java I’m using the float type to store a latitude or longitude, then in the MySQL database I’m using decimal(15,12).
There appears to be a bit of a rounding problem somewhere along the line which I need to figure out. For some reason if I try and send a latitude of 52.2 from Java to be stored in the database, it gets stored as something like 52.2000007623. This means when I try and find all the points with latitude 52.2 it doesn’t pick up the record I’ve just inserted/updated.
I’ve not had much experience using this amount of decimal precision before, so the problems are probably due to my lack of understanding of the precision/accuracy of the various data types.
I think the way around this is to change my Java floats to be doubles for more precision and hopefully the problem won’t then occur – not totally sure what to try if that doesn’t work, so please let me know if you have any suggestions
May 1, 2006, 4:51 am by Alex
|
Comment
Am still attempting to get the SDK working, though still not having any luck, so getting quite frustrated with it all! When the my client code calls the service it just returns an error saying there is a communications link failure – but the service and correct method is actually called (I can see from some of the debugging output that it’s getting to the right method), though the id is not being passed over.
If I try to call up the service in the browser (ie by looking at: http://localhost:8080/EnterpriseServer/services/GroupManagementServiceSyncSoap?method=readGroup) I just get the follwoing error returned:
Tried to invoke method public void uk.ac.cetis.enterprise.group.http.GroupManagementServiceSyncSoapSkeleton.readGroup(uk.ac.cetis.enterprise.group.messages._readGroupRequest,uk.ac.cetis.enterprise.iaf.messages._syncRequestHeaderInfo,uk.ac.cetis.enterprise.group.messages.holders._readGroupResponseHolder,uk.ac.cetis.enterprise.iaf.messages.holders._syncResponseHeaderInfoHolder) throws java.rmi.RemoteException with arguments uk.ac.cetis.enterprise.group.messages._readGroupRequest,uk.ac.cetis.enterprise.group.messages.holders._readGroupResponseHolder,uk.ac.cetis.enterprise.iaf.messages.holders._syncResponseHeaderInfoHolder,null. The arguments do not match the signature.; nested exception is:
java.lang.IllegalArgumentException: argument type mismatch
I’m not sure why this is! I’ve been sent an example application which uses Axis 1.3, but I’ve not been able to run this as I need to get the database set up first. I’m also a bit wary of spending a lot of time trying to get something else running, and my feeling is that if I can’t get this running this week, then we’ll just have to stick with the sample database application I wrote a few weeks ago, as we know this works and we’ve got plenty more to be getting on with on the project other than Enterprise