|
[
Permlink
| « Hide
]
Shay Banon added a comment - 03/Oct/06 05:23 PM
I have no problem with adding this constructor, it is pretty simple. What I am concerned about is that something is wrong in how Compass can be configured in Spring with the wrapper maybe? You have other optional things to inject into JpaGpsDevice, and they won't be injected in such a case that you describe. I will try to run able and check why things are not injected, will report back.
This sounds a lot like the same problem I was having with ResultSetJdbcGpsDevice. It happens when using autowiring, e.g. default-autowire="byType". The reason is that AbstractGpsDevice has a setGps and Spring therefore thinks that the Gps bean needs to be populated before the GpsDevice bean. Just remove the autowiring, possibly only for the GpsDevice bean, and the wiring will work fine.
I don't know if any changes should be done so users can avoid this. Perhaps the check for device name should be moved to a later stage. Otherwise a warning about autowiring somewhere could be helpful. Very simple fix, I change the setGps method name to injectGps. Since this is used internally, no problem here (when adding a device to CompassGps, it will inject itself into the device).
|
|||||||||||||||||||||||||||||||||||||||