-1
RadiusClient rc = new RadiusClient("xx.xx.xx.xx","0000");
AccountingRequest acc = new AccountingRequest("michael",AccountingRequest.ACCT_STATUS_TYPE_START); 
acc.addAttribute("Framed-IP-Address", "1.1.1.1");
acc.addAttribute("Class","Key CL: PT=C");
rc.account(acc);
rc.close(); 

i try to send an accounting request to my accounting server by create a jsp page as above.

However, only

 acc.addAttribute("Framed-IP-Address", "1.1.1.1")
can be accpeted, there is error occured while sending attribute type no.25 "Class" by using
 acc.addAttribute("Class","Key CL: PT=C")
where is going wrong ?!
Michael
  • 1
  • 3
  • the exception error showed "cannot set the value of attribute 25 as a string" ,however the method addAttribute is only accept (string,string) – Michael Apr 16 '18 at 07:50

1 Answers1

0

Finally i found the answer, attribute "Class" , need to be added by method :

    acc.addAttribute(new StringAttribute(25,"Key CL: PT=C"));
Michael
  • 1
  • 3