在调试过程中,调用RMI服务部分出现问题,
1、有的时候可以执行clientuser.addCustomer(customer);有的时候不可以执行,会报错误说不符合唯一性约束。
我估计是因为前面的set语句已经将对象的记录,插入到表中,
2、执行System.out.println("Customer : " + clientuser.getCustomer(customer));的时候如果同时执行
Customer customerRecord = clientuser.getCustomerAccountInfo(customer);语句和
System.out.println("Customer Found , User Id is " + customerRecord.getUserId());语句
报错,说为空指针错误。
3、如果只执行System.out.println("Customer : " + clientuser.getCustomer(customer));和
Customer customerRecord = clientuser.getCustomerAccountInfo(customer);语句就会出现,
上文的System.out.println语句都未执行,只执行Customer customerRecord这一句,
而且会在函数调用后程序一直执行,不能自动停止。
以上问题从29号开始出现,至今没有解决。我感觉要知道RMI服务的调用原理才好修改此问题。但是目前还不知道原理……
也有可能是某个我不注意的地方,出现的调用的语法错误,或者其他逻辑错误,才导致这些问题,只是我没找到。