1

我已经使用 JAX-WS 开发了一个 Web 服务,并在一个运行良好的主类上对其进行了测试。我遵循本教程。但是当我尝试从 JSF 页面中的托管 bean 调用它时,它不起作用。这是我的托管 bean:

import javax.faces.event.ActionEvent;
import client.Calculator;
import client.CalculatorService;

public class addBean {

    private int n1;
    private int n2;
    private int somme;
         public addBean() {
    }

    public int getN1() {
        return n1;
    }

    public void setN1(int n1) {
        this.n1 = n1;
    }

    public int getN2() {
        return n2;
    }

    public void setN2(int n2) {
        this.n2 = n2;
    }

    public int getSomme() {
        return somme;
    }

    public void setSomme(int somme) {
        this.somme = somme;
    }

    public void countListener (ActionEvent event){
        CalculatorService calcService = new CalculatorService();
        Calculator calc = calcService.getCalculatorPort();
        somme = calc.add(n1, n2);  
    }
}

错误是

    javax.xml.ws.WebServiceException: Unable to create JAXBContext
4

0 回答 0