Hi all,
I was trying a simple calculator soap service and ran into the
following exception. Please suggest on what can be done to overcome this
exception.
SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of
IllegalAnnotationExceptions
com.samples.simpleCalculatorSOAP.EmployeeInterface is an interface, and JAXB
can't handle interfaces.
this problem is related to the following location:
at com.samples.simpleCalculatorSOAP.EmployeeInterface
at public com.samples.simpleCalculatorSOAP.EmployeeInterface
com.samples.simpleCalculatorSOAP.Employee1.getEmployeeInterface()
at com.samples.simpleCalculatorSOAP.Employee1
com.samples.simpleCalculatorSOAP.EmployeeInterface does not have a no-arg
default constructor.
this problem is related to the following location:
at com.samples.simpleCalculatorSOAP.EmployeeInterface
at public com.samples.simpleCalculatorSOAP.EmployeeInterface
com.samples.simpleCalculatorSOAP.Employee1.getEmployeeInterface()
at com.samples.simpleCalculatorSOAP.Employee1
The class that is exposed as soap service is as below.
package com.samples.simpleCalculatorSOAP;
import org.osoa.sca.annotations.Remotable;
@Remotable
public class SimpleCalculatorServiceImpl extends
SimpleCalculatorServiceImplBase {
public String add(double n1, double n2){
Double temp = n1+n2; return temp.toString();
}
public String subtract(double n1, double n2){
Double temp = n1-n2; return temp.toString();
}
public String multiply(double n1, double n2){
Double temp = n1*n2; return temp.toString();
}
public String divide(double n1, double n2){
Double temp = n1/n2; return temp.toString();
}
}
The definition of the remaining classes/interfaces is as below.
---------------------------------------------------------------------------------------
package com.samples.simpleCalculatorSOAP;
public class SimpleCalculatorServiceImplBase {
public final void setEmployee1(Employee1 e){
System.out.println(e.getId()+" "+e.getName());
}
}
---------------------------------------------------------------------------------------
package com.samples.simpleCalculatorSOAP;
public final class Employee1 {
private EmployeeInterface ei = null;
public void setEmployeeInterface(EmployeeInterface e){
this.ei=e;
}
public EmployeeInterface getEmployeeInterface(){
return ei;
}
}
---------------------------------------------------------------------------------------
package com.samples.simpleCalculatorSOAP;
public interface EmployeeInterface {
public String exportValue( String nameid );
public Object importValue( String name, String id );
}
---------------------------------------------------------------------------------------
package com.samples.simpleCalculatorSOAP;
public class EmployeeImpl implements EmployeeInterface
{ private String name=""; private String id="";
public String exportValue( String nameid ){
return nameid;
}
public Object importValue( String name, String id ){
this.name=name; this.id=id; return name+id;
}
}
---------------------------------------------------------------------------------------
The example does not make sense on the implementation stand point, I
mean we are looking into the calculator implementation and then we have some
piece that talks about Employee. I was not looking to get this sample right,
this sample was meant for experimenting a few things and then hit the
IllegalAnnotationsException. Please suggest what annotations have to be
added to make this sample working. It would be great if you guys can added
the annotations in the above pseudo code itself to make this sample working.
By working I mean atleast deploying since I am hitting the issue while
deploying this app.
Thanks.